diff --git a/Admin/Command.cs b/Admin/Command.cs index 88d4c982..8f3361fe 100644 --- a/Admin/Command.cs +++ b/Admin/Command.cs @@ -149,14 +149,25 @@ namespace IW4MAdmin public override void Execute(Event E) { + StringBuilder playerList = new StringBuilder(); lock (E.Owner.getPlayers()) { + int count = 0; foreach (Player P in E.Owner.getPlayers()) { if (P == null) continue; - E.Origin.Tell(String.Format("[^3{0}^7]{3}[^3{1}^7] {2}", SharedLibrary.Utilities.levelToColor(P.Level), P.clientID, P.Name, SharedLibrary.Utilities.getSpaces(Player.Permission.SeniorAdmin.ToString().Length - P.Level.ToString().Length))); + playerList.AppendFormat("[^3{0}^7]{3}[^3{1}^7] {2}", SharedLibrary.Utilities.levelToColor(P.Level), P.clientID, P.Name, SharedLibrary.Utilities.getSpaces(Player.Permission.SeniorAdmin.ToString().Length - P.Level.ToString().Length)); + if (count == 2) + { + E.Origin.Tell(playerList.ToString()); + count = 0; + playerList = new StringBuilder(); + continue; + } + + count++; } } } @@ -519,6 +530,13 @@ namespace IW4MAdmin public override void Execute(Event E) { + if (E.Data != null && E.Data.ToLower().Contains("clear")) + { + E.Owner.Reports = new List(); + E.Origin.Tell("Reports successfully cleared!"); + return; + } + if (E.Owner.Reports.Count < 1) { E.Origin.Tell("No players reported yet."); @@ -659,5 +677,19 @@ namespace IW4MAdmin E.Origin.Tell("Successfuly sent RCON command!"); } } + + class Plugins : Command + { + public Plugins(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } + + public override void Execute(Event E) + { + E.Origin.Tell("^5Loaded Plugins:"); + foreach (Plugin P in PluginImporter.potentialPlugins) + { + E.Origin.Tell(String.Format("^3{0} ^7[^3{1}^7] by ^5{2}^7", P.Name, P.Version, P.Author)); + } + } + } } \ No newline at end of file diff --git a/Admin/Main.cs b/Admin/Main.cs index 0a24a750..a19c741c 100644 --- a/Admin/Main.cs +++ b/Admin/Main.cs @@ -30,7 +30,7 @@ namespace IW4MAdmin Console.WriteLine(" Version " + Version + " (unable to retrieve latest)"); Console.WriteLine("====================================================="); - serverManager = new IW4MAdmin.Manager(); + serverManager = new Manager(); Thread serverMGRThread = new Thread(serverManager.Init); serverMGRThread.Name = "Server Manager thread"; @@ -42,11 +42,11 @@ namespace IW4MAdmin } if (serverManager.getServers() != null) - Program.getManager().mainLog.Write("IW4M Now Initialized!", Log.Level.Production); + getManager().mainLog.Write("IW4M Now Initialized!", Log.Level.Production); String userInput; Server serverToExecuteOn = serverManager.getServers()[0]; - Player Origin = new Player("IW4MAdmin Console", "", -1, Player.Permission.Console, -1, "", 0, ""); + Player Origin = new Player("IW4MAdmin", "", -1, Player.Permission.Console, -1, "", 0, ""); do { @@ -68,7 +68,7 @@ namespace IW4MAdmin { try { - foreach (Server S in IW4MAdmin.Program.getServers()) + foreach (Server S in getServers()) { if (S == null) continue; @@ -77,12 +77,12 @@ namespace IW4MAdmin S.isRunning = false; if (Utilities.shutdownInterface(S.pID())) - Program.getManager().mainLog.Write("Successfully removed IW4MAdmin from server with PID " + S.pID(), Log.Level.Debug); + getManager().mainLog.Write("Successfully removed IW4MAdmin from server with PID " + S.pID(), Log.Level.Debug); else - Program.getManager().mainLog.Write("Could not remove IW4MAdmin from server with PID " + S.pID(), Log.Level.Debug); + getManager().mainLog.Write("Could not remove IW4MAdmin from server with PID " + S.pID(), Log.Level.Debug); } - Program.getManager().shutDown(); + getManager().shutDown(); return false; } diff --git a/Admin/Server.cs b/Admin/Server.cs index 973ae3ef..50647a20 100644 --- a/Admin/Server.cs +++ b/Admin/Server.cs @@ -589,6 +589,12 @@ namespace IW4MAdmin // basic info dvars hostname = SharedLibrary.Utilities.stripColors(getDvar("sv_hostname").current); mapname = getDvar("mapname").current; + Map localizedMapName = maps.Find(x => x.Name.Equals(mapname)); + + if (localizedMapName != null) + mapname = localizedMapName.Alias; + + IW_Ver = getDvar("shortversion").current; maxClients = -1; Int32.TryParse(getDvar("party_maxplayers").current, out maxClients); @@ -910,6 +916,9 @@ namespace IW4MAdmin if(owner == null) commands.Add(new Owner("owner", "claim ownership of the server", "owner", Player.Permission.User, 0, false)); + foreach (Command C in PluginImporter.potentialCommands) + commands.Add(C); + commands.Add(new Kick("kick", "kick a player by name. syntax: !kick .", "k", Player.Permission.Moderator, 2, true)); commands.Add(new Say("say", "broadcast message to all players. syntax: !say .", "s", Player.Permission.Moderator, 1, false)); commands.Add(new TempBan("tempban", "temporarily ban a player for 1 hour. syntax: !tempban .", "tb", Player.Permission.Moderator, 2, true)); @@ -942,10 +951,7 @@ namespace IW4MAdmin commands.Add(new Alias("alias", "get past aliases and ips of a player. syntax: !alias ", "known", Player.Permission.Moderator, 1, true)); commands.Add(new _RCON("rcon", "send rcon command to server. syntax: !rcon ", "rcon", Player.Permission.Owner, 1, false)); commands.Add(new FindAll("findall", "find a player by their aliase(s). syntax: !findall ", "fa", Player.Permission.Moderator, 1, false)); - - foreach (Command C in PluginImporter.potentialCommands) - commands.Add(C); - + commands.Add(new Plugins("plugins", "view all loaded plugins. syntax: !plugins", "p", Player.Permission.Administrator, 0, false)); } //Objects diff --git a/Admin/plugins/SimpleStatsPlugin.dll b/Admin/plugins/SimpleStatsPlugin.dll index 72863cc5..8d8afd99 100644 Binary files a/Admin/plugins/SimpleStatsPlugin.dll and b/Admin/plugins/SimpleStatsPlugin.dll differ diff --git a/Admin/plugins/WebfrontPlugin.dll b/Admin/plugins/WebfrontPlugin.dll index 2f91c507..63fa1258 100644 Binary files a/Admin/plugins/WebfrontPlugin.dll and b/Admin/plugins/WebfrontPlugin.dll differ diff --git a/Admin/webfront/footer.html b/Admin/webfront/footer.html index 978f2f0c..d64bef17 100644 --- a/Admin/webfront/footer.html +++ b/Admin/webfront/footer.html @@ -1,9 +1,4 @@  -
", S.pID(), '\"'); - //if (S.getClientNum() > 0) - // buffer.AppendFormat("
", S.pID(), '\"'); + if (UserPrivelege || Authenticated) + buffer.AppendFormat("
", S.pID(), '\"'); + } buffer.Append("
"); } return Input.Replace(Macro, buffer.ToString()); @@ -352,7 +357,7 @@ namespace Webfront_Plugin Player P = bannedPlayers[i]; Player B; - if (Bans[i].bannedByID == Bans[i].npID) + if (P.npID == Bans[i].bannedByID) B = new Player("IW4MAdmin", "", 0, SharedLibrary.Player.Permission.Banned, 0, "", 0, ""); else @@ -441,9 +446,6 @@ namespace Webfront_Plugin case "graph": requestedPage = new graph(); return processTemplate(requestedPage.Load(), request.QueryString); - case "stats": - requestedPage = new stats(); - break; case "chat": requestedPage = new chat(); return processTemplate(requestedPage.Load(), request.QueryString); @@ -552,19 +554,6 @@ namespace Webfront_Plugin } } - class stats : Page - { - public override String Name - { - get { return "stats"; } - } - - public override String Load() - { - return loadHTML(); - } - } - class graph : Page { public override String Name