Files
PemukulPaku/GameServer/Commands/TargetCommand.cs
TerminalAide0017 f2e83c93dd More Helpful Help Command (#5)
* Deleted TestCommand.cs

No longer needed.

* Update AbyssCommand.cs

Added a command to adjust the player's bracket at will.

* Update User.cs

Added Abyss Group Value

* Update Command.cs

Added Examples[] to the constructor and handler.

* Update HelpCommand.cs

Made the Help command more helpful!

* Update AbyssCommand.cs

Added Help Examples

* Update GiveCommand.cs

Added help examples,
handles negative inputs again,
added more aliases,
can add or remove materials by ID,
can now for add all skipped characters with `give avatars-scuffed`

* Update AbyssCommand.cs

missed a quote

* Update UltraEndlessGetMainDataReqHandler.cs

Bracket can now be set with commands.

Need to unscuff the fight cycle.

* Update GiveCommand.cs

Cheeky give gold command

* Further refined the Help Command

---------

Co-authored-by: TerminalAide0017 <Sucks@code>
2023-06-09 14:23:54 +07:00

36 lines
1.3 KiB
C#

namespace PemukulPaku.GameServer.Commands
{
[CommandHandler("target", "[id], displays and selects User sessions for commands", CommandType.Console)]
internal class TargetCommand : Command
{
public override void Run(string[] args)
{
if(args.Length == 0)
{
Console.ForegroundColor = ConsoleColor.White;
Console.Write("Selected Session: ");
Console.ForegroundColor = ConsoleColor.DarkGray;
Console.WriteLine(ReadLine.GetInstance().session?.Id ?? "None");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("Active Sessions:");
Console.ResetColor();
foreach (KeyValuePair<string, Session> session in Server.GetInstance().Sessions)
{
c.Trail(session.Key);
}
} else
{
if(Server.GetInstance().Sessions.TryGetValue(args[0], out Session? session))
{
ReadLine.GetInstance().session = session;
c.Log("Session set to " + session.Id);
}
else
{
c.Error("Session not found with key " + args[0]);
}
}
}
}
}