diff --git a/Admin/Command.cs b/Admin/Command.cs index cbb2580c9..8f183357e 100644 --- a/Admin/Command.cs +++ b/Admin/Command.cs @@ -167,10 +167,15 @@ namespace IW4MAdmin { E.Target.LastOffense = Utilities.removeWords(E.Data, 1); E.Target.lastEvent = E; // needs to be fixed + String Message; #if DEBUG - String Message = "^1Player Banned: ^5" + E.Target.LastOffense + "^7 (appeal at nbsclan.org)"; + Message = "^1Player Banned: ^5" + E.Target.LastOffense + "^7 (appeal at nbsclan.org)"; #else - String Message = "^1Player Banned: ^5" + E.Target.LastOffense; + if (E.Owner.Website == null) + Message = "^1Player Banned: ^5" + E.Target.LastOffense; + else + Message = "^1Player Banned: ^5" + E.Target.LastOffense + "^7 (appeal at " + E.Owner.Website + ")"; + #endif if (E.Origin.getLevel() > E.Target.getLevel()) { @@ -219,8 +224,8 @@ namespace IW4MAdmin { if (P == null) continue; - - E.Origin.Tell(String.Format("[^3{0}^7]{3}[^3{1}^7] {2}", P.getLevel(), P.getClientNum(), P.getName(), Utilities.getSpaces(Player.Permission.SeniorAdmin.ToString().Length - P.getLevel().ToString().Length))); + + E.Origin.Tell(String.Format("[^3{0}^7]{3}[^3{1}^7] {2}", Utilities.levelToColor(P.getLevel()), P.getClientNum(), P.getName(), Utilities.getSpaces(Player.Permission.SeniorAdmin.ToString().Length - P.getLevel().ToString().Length))); } } @@ -252,11 +257,21 @@ namespace IW4MAdmin else { + int count = 0; + String _commands = String.Empty; + foreach (Command C in E.Owner.getCommands()) - { + { if (E.Origin.getLevel() >= C.getNeededPerm()) { - E.Origin.Tell(" [^3" + C.getName() + "^7] "); + _commands = _commands + " [^3" + C.getName() + "^7] "; + if (count >= 3) + { + E.Origin.Tell(_commands); + _commands = String.Empty; + count = 0; + } + count++; } } E.Origin.Tell("Type !help to get command usage example"); @@ -351,7 +366,7 @@ namespace IW4MAdmin { if (P != null && P.getLevel() > Player.Permission.User) { - E.Origin.Tell(String.Format("[^3{0}^7]{3} {1}", P.getLevel(), P.getName(), Utilities.getSpaces(Player.Permission.SeniorAdmin.ToString().Length - P.getLevel().ToString().Length))); + E.Origin.Tell(String.Format("[^3{0}^7] {1}", Utilities.levelToColor(P.getLevel()), P.getName())); } } } @@ -411,7 +426,7 @@ namespace IW4MAdmin foreach (Player P in db_players) { - String mesg = String.Format("[^3{0}^7] [^3@{1}^7] - {2}", P.getName(), P.getDBID(), P.getID()); + String mesg = String.Format("[^3{0}^7] [^3@{1}^7] - {2} [{3}^7]", P.getName(), P.getDBID(), P.getID(), Utilities.levelToColor(P.getLevel())); E.Origin.Tell(mesg); } diff --git a/Admin/File.cs b/Admin/File.cs index dfd3d13bd..c4cd735cb 100644 --- a/Admin/File.cs +++ b/Admin/File.cs @@ -28,7 +28,7 @@ namespace IW4MAdmin public file(String file, bool write) { Name = file; - writeHandle = new StreamWriter(new FileStream(Name, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite)); + writeHandle = new StreamWriter(new FileStream(Name, FileMode.Create, FileAccess.Write, FileShare.ReadWrite)); sze = 0; } diff --git a/Admin/IW4M ADMIN.csproj b/Admin/IW4M ADMIN.csproj index c4777c8fb..c56609be0 100644 --- a/Admin/IW4M ADMIN.csproj +++ b/Admin/IW4M ADMIN.csproj @@ -29,7 +29,7 @@ true publish.htm 5 - 0.3.0.%2a + 0.4.0.%2a false true true diff --git a/Admin/Main.cs b/Admin/Main.cs index f909c3287..cd014c09e 100644 --- a/Admin/Main.cs +++ b/Admin/Main.cs @@ -10,7 +10,7 @@ namespace IW4MAdmin static String IP; static int Port; static String RCON; - static public double Version = 0.3; + static public double Version = 0.4; static public double latestVersion; static void Main(string[] args) diff --git a/Admin/Server.cs b/Admin/Server.cs index b4303efdf..e635b9edc 100644 --- a/Admin/Server.cs +++ b/Admin/Server.cs @@ -413,6 +413,23 @@ namespace IW4MAdmin Thread.Sleep(FLOOD_TIMEOUT); + //get _Website + p = RCON.responseSendRCON("_Website"); + + if (p == null) + { + Log.Write("Could not website name!", Log.Level.All); + return false; + } + + p = p[1].Split('"'); + if (p[0].Trim() != "Unknown command") + Website = (p[3].Substring(0, p[3].Length - 2).Trim()); + p = null; + //END + + Thread.Sleep(FLOOD_TIMEOUT); + //GET fs_basepath p = RCON.responseSendRCON("fs_basepath"); @@ -811,6 +828,7 @@ namespace IW4MAdmin public Queue events; public Database stats; public Heartbeat HB; + public String Website; //Info private String IP; diff --git a/Admin/Utilities.cs b/Admin/Utilities.cs index 301ac3d54..52f9f7037 100644 --- a/Admin/Utilities.cs +++ b/Admin/Utilities.cs @@ -79,5 +79,24 @@ namespace IW4MAdmin { return Regex.Replace(str, @"\^[0-9]", ""); } + + public static String levelToColor(Player.Permission level) + { + switch (level) + { + case Player.Permission.Banned: + return "^1" + Player.Permission.Banned; + break; + case Player.Permission.Owner: + return "^5" + Player.Permission.Owner; + break; + case Player.Permission.User: + return "^3" + Player.Permission.User; + break; + default: + return "^2" + level; + break; + } + } } } diff --git a/Admin/version.txt b/Admin/version.txt index d55bea3a0..5cce9b370 100644 --- a/Admin/version.txt +++ b/Admin/version.txt @@ -1 +1 @@ -0.2 \ No newline at end of file +0.4 \ No newline at end of file diff --git a/IW4M Admin.sln b/IW4M Admin.sln index 2d8df26e6..da90d349f 100644 --- a/IW4M Admin.sln +++ b/IW4M Admin.sln @@ -13,8 +13,8 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Any CPU.Build.0 = Debug|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE