Adds /ip <player> and returns the Internet Protocol Version 4 address of the player.
Closes #219
This commit is contained in:
parent
da60e1cd0c
commit
cf7323d653
1 changed files with 19 additions and 0 deletions
|
|
@ -162,6 +162,7 @@ namespace TShockAPI
|
||||||
ChatCommands.Add(new Command(Rules, "rules"));
|
ChatCommands.Add(new Command(Rules, "rules"));
|
||||||
ChatCommands.Add(new Command("logs", Rules, "displaylogs"));
|
ChatCommands.Add(new Command("logs", Rules, "displaylogs"));
|
||||||
ChatCommands.Add(new Command("manageusers", ManageUsers, "user") { DoLog = false });
|
ChatCommands.Add(new Command("manageusers", ManageUsers, "user") { DoLog = false });
|
||||||
|
ChatCommands.Add(new Command("manageusers", GrabUserIP, "ip"));
|
||||||
ChatCommands.Add(new Command(AttemptLogin, "login") { DoLog = false });
|
ChatCommands.Add(new Command(AttemptLogin, "login") { DoLog = false });
|
||||||
ChatCommands.Add(new Command("cfg", Broadcast, "broadcast", "bc"));
|
ChatCommands.Add(new Command("cfg", Broadcast, "broadcast", "bc"));
|
||||||
ChatCommands.Add(new Command("whisper", Whisper, "whisper", "w", "tell"));
|
ChatCommands.Add(new Command("whisper", Whisper, "whisper", "w", "tell"));
|
||||||
|
|
@ -363,6 +364,24 @@ namespace TShockAPI
|
||||||
|
|
||||||
#region Player Management Commands
|
#region Player Management Commands
|
||||||
|
|
||||||
|
private static void GrabUserIP(CommandArgs args)
|
||||||
|
{
|
||||||
|
if (args.Parameters.Count < 1)
|
||||||
|
{
|
||||||
|
args.Player.SendMessage("Invalid syntax! Proper syntax: /ip <player>", Color.Red);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var players = Tools.FindPlayer(args.Parameters[0]);
|
||||||
|
if (players.Count > 1)
|
||||||
|
{
|
||||||
|
args.Player.SendMessage("More than one player matched your query.", Color.Red);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
args.Player.SendMessage(players[0].IP, Color.Green);
|
||||||
|
}
|
||||||
|
|
||||||
private static void Kick(CommandArgs args)
|
private static void Kick(CommandArgs args)
|
||||||
{
|
{
|
||||||
if (args.Parameters.Count < 1)
|
if (args.Parameters.Count < 1)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue