From 1cd23d6c12e41a9c76aac2f0ddfc55d4d29e65a0 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 11 Jul 2018 11:56:07 +1000 Subject: [PATCH] Fix /clones from console --- MCGalaxy/Commands/Information/CmdClones.cs | 3 ++- MCGalaxy/Commands/Moderation/CmdBanip.cs | 2 +- MCGalaxy/Commands/Moderation/CmdUnbanip.cs | 2 +- MCGalaxy/Games/ZombieSurvival/ZSGame.Plugin.cs | 2 +- MCGalaxy/Server/Tasks/ModerationTasks.cs | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/MCGalaxy/Commands/Information/CmdClones.cs b/MCGalaxy/Commands/Information/CmdClones.cs index 6b583f0ea..8445f3bd3 100644 --- a/MCGalaxy/Commands/Information/CmdClones.cs +++ b/MCGalaxy/Commands/Information/CmdClones.cs @@ -30,7 +30,8 @@ namespace MCGalaxy.Commands.Info { } public override void Use(Player p, string message, CommandData data) { - if (message.Length == 0 && p != null) { + if (message.Length == 0) { + if (p.IsSuper) { SuperRequiresArgs(p, "IP address"); return; } message = p.ip; } else { message = ModActionCmd.FindIP(p, message, "find alts of", "clones"); diff --git a/MCGalaxy/Commands/Moderation/CmdBanip.cs b/MCGalaxy/Commands/Moderation/CmdBanip.cs index abbbdbec8..1debd61c9 100644 --- a/MCGalaxy/Commands/Moderation/CmdBanip.cs +++ b/MCGalaxy/Commands/Moderation/CmdBanip.cs @@ -39,7 +39,7 @@ namespace MCGalaxy.Commands.Moderation { IPAddress ip; if (!IPAddress.TryParse(args[0], out ip)) { p.Message("\"{0}\" is not a valid IP.", args[0]); return; } if (IPAddress.IsLoopback(ip)) { p.Message("You cannot IP ban the server."); return; } - if (p != null && p.ip == args[0]) { p.Message("You cannot IP ban yourself."); return; } + if (p.ip == args[0]) { p.Message("You cannot IP ban yourself."); return; } if (Server.bannedIP.Contains(args[0])) { p.Message("{0} is already IP banned.", args[0]); return; } // Check if IP is shared by any other higher ranked accounts if (!CheckIP(p, args[0])) return; diff --git a/MCGalaxy/Commands/Moderation/CmdUnbanip.cs b/MCGalaxy/Commands/Moderation/CmdUnbanip.cs index 5d4b628fc..1e9eeef3e 100644 --- a/MCGalaxy/Commands/Moderation/CmdUnbanip.cs +++ b/MCGalaxy/Commands/Moderation/CmdUnbanip.cs @@ -36,7 +36,7 @@ namespace MCGalaxy.Commands.Moderation { IPAddress ip; if (!IPAddress.TryParse(args[0], out ip)) { p.Message("\"{0}\" is not a valid IP.", args[0]); return; } - if (p != null && p.ip == args[0]) { p.Message("You cannot un-IP ban yourself."); return; } + if (p.ip == args[0]) { p.Message("You cannot un-IP ban yourself."); return; } if (!Server.bannedIP.Contains(args[0])) { p.Message(args[0] + " is not a banned IP."); return; } string reason = args.Length > 1 ? args[1] : ""; diff --git a/MCGalaxy/Games/ZombieSurvival/ZSGame.Plugin.cs b/MCGalaxy/Games/ZombieSurvival/ZSGame.Plugin.cs index 87823e41f..024e62ea7 100644 --- a/MCGalaxy/Games/ZombieSurvival/ZSGame.Plugin.cs +++ b/MCGalaxy/Games/ZombieSurvival/ZSGame.Plugin.cs @@ -239,7 +239,7 @@ namespace MCGalaxy.Games { Command.Find("Take").Use(Player.Console, p.name + " 10 Auto fine for pillaring"); p.Message(" %WThe next time you pillar, you will be &4kicked!"); } else { - ModAction action = new ModAction(p.name, null, ModActionType.Kicked, "Auto kick for pillaring"); + ModAction action = new ModAction(p.name, Player.Console, ModActionType.Kicked, "Auto kick for pillaring"); OnModActionEvent.Call(action); p.Kick("No pillaring allowed!"); } diff --git a/MCGalaxy/Server/Tasks/ModerationTasks.cs b/MCGalaxy/Server/Tasks/ModerationTasks.cs index 44d538558..7809bdfdd 100644 --- a/MCGalaxy/Server/Tasks/ModerationTasks.cs +++ b/MCGalaxy/Server/Tasks/ModerationTasks.cs @@ -56,7 +56,7 @@ namespace MCGalaxy.Tasks { internal static void FreezeCalcNextRun() { CalcNextRun(freezeTask, Server.frozen); } static void FreezeCallback(string[] args) { - ModAction action = new ModAction(args[0], null, ModActionType.Unfrozen, "auto unfreeze"); + ModAction action = new ModAction(args[0], Player.Console, ModActionType.Unfrozen, "auto unfreeze"); OnModActionEvent.Call(action); }