Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Alex10 committed Dec 29, 2024
1 parent 1df57a6 commit 0f90582
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
6 changes: 6 additions & 0 deletions ArabicaCliento/Commands/Arabica.Friend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ public class ArabicaFriendCommand : IConsoleCommand

public void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length != 1)
{
shell.WriteError("Invalid args count");
return;
}

if (ArabicaConfig.FriendsSet.Add(args[0]))
shell.WriteLine("Username is successfully added");
else
Expand Down
18 changes: 16 additions & 2 deletions ArabicaCliento/Commands/Arabica.FriendList.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
using Content.Shared.Administration;
using Robust.Shared.Console;

namespace ArabicaCliento.Commands;

public class Arabica_FriendList
[AnyCommand]
public class ArabicaFriendList : IConsoleCommand
{

public string Command => "arabica.friend_list";
public string Description => "Output a friendlist";
public string Help => "arabica.friend_list";

public void Execute(IConsoleShell shell, string argStr, string[] args)
{
foreach (var friend in ArabicaConfig.FriendsSet)
{
shell.WriteLine(friend);
}
}
}
11 changes: 6 additions & 5 deletions ArabicaCliento/Commands/Arabica.PlayerList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ namespace ArabicaCliento.Commands;
[AnyCommand]
public class ArabicaPlayerList : IConsoleCommand
{
public string Command => "arabica.friend_list";
public string Description => "Output a friendlist";
public string Help => "arabica.friend_list";
public string Command => "arabica.player_list";
public string Description => "Output a playerlist";
public string Help => "arabica.player_list";

public void Execute(IConsoleShell shell, string argStr, string[] args)
{
foreach (var friend in ArabicaConfig.FriendsSet)
var man = IoCManager.Resolve<IPlayerManager>();
foreach (var ses in man.Sessions)
{
shell.WriteLine(friend);
shell.WriteLine(ses.Name);
}
}
}
6 changes: 6 additions & 0 deletions ArabicaCliento/Commands/Arabica.Unfriend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ public class ArabicaUnfriendCommand : IConsoleCommand

public void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length != 1)
{
shell.WriteError("Invalid args count");
return;
}

if (ArabicaConfig.FriendsSet.Remove(args[0]))
shell.WriteLine("Username is successfully removed");
else
Expand Down

0 comments on commit 0f90582

Please sign in to comment.