diff --git a/Admin/App.config b/Admin/App.config deleted file mode 100644 index 9902b6f1..00000000 --- a/Admin/App.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/Admin/Command.cs b/Admin/Command.cs index 4d131bee..a2d42b0e 100644 --- a/Admin/Command.cs +++ b/Admin/Command.cs @@ -725,9 +725,11 @@ namespace IW4MAdmin E.Origin.Tell(message.ToString()); } + message = new StringBuilder(); + if (E.Target.Alias.getIPS() != null) { - message.Append("IPS: "); + message.Append("IPs: "); foreach (Player P2 in playerAliases) { diff --git a/Admin/IW4M ADMIN.csproj b/Admin/IW4M ADMIN.csproj index 4014bda2..1db3ee36 100644 --- a/Admin/IW4M ADMIN.csproj +++ b/Admin/IW4M ADMIN.csproj @@ -56,18 +56,22 @@ LocalIntranet - - Properties\app.manifest - + true - 4D1.ico + IW4MAdmin.ico IW4MAdmin.Program + + true + + + OnOutputUpdated + ..\packages\Kayak.0.7.2\lib\Kayak.dll @@ -97,12 +101,6 @@ - - - True - True - Settings.settings - @@ -138,9 +136,6 @@ PreserveNewest - - Designer - PreserveNewest @@ -168,8 +163,6 @@ PreserveNewest - - SettingsSingleFileGenerator Settings.Designer.cs @@ -188,9 +181,8 @@ - + - copy $(TargetDir)$(TargetFileName) $(SolutionDir)OFFICIAL\Release\$(TargetFileName) diff --git a/Admin/4D1.ico b/Admin/IW4MAdmin.ico similarity index 100% rename from Admin/4D1.ico rename to Admin/IW4MAdmin.ico diff --git a/Admin/Properties/AssemblyInfo.cs b/Admin/Properties/AssemblyInfo.cs index b5235435..80721185 100644 --- a/Admin/Properties/AssemblyInfo.cs +++ b/Admin/Properties/AssemblyInfo.cs @@ -33,5 +33,5 @@ using System.Resources; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.*")] +[assembly: AssemblyVersion("0.8.1")] [assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/Admin/Server.cs b/Admin/Server.cs index 34071945..3c18310c 100644 --- a/Admin/Server.cs +++ b/Admin/Server.cs @@ -209,10 +209,34 @@ namespace IW4MAdmin aliasDB.updatePlayer(NewPlayer.Alias); clientDB.updatePlayer(NewPlayer); + if (NewPlayer.getLevel() == Player.Permission.Banned) // their guid is already banned so no need to check aliases + { + String Message; + + Log.Write("Banned client " + P.getName() + " trying to connect...", Log.Level.Debug); + + if (NewPlayer.getLastO() != null) + Message = "^7Player Kicked: Previously banned for ^5" + NewPlayer.getLastO() + " ^7(appeal at " + Website + ")"; + else + Message = "Player Kicked: Previous Ban"; + + NewPlayer.Kick(Message); + + if (players[NewPlayer.getClientNum()] != null) + { + lock (players) + { + players[NewPlayer.getClientNum()] = null; + } + } + + return true; + } + List newPlayerAliases = new List(); getAliases(newPlayerAliases, NewPlayer); - foreach (Player aP in newPlayerAliases) + foreach (Player aP in newPlayerAliases) // lets check their aliases { if (aP == null) continue; @@ -220,39 +244,12 @@ namespace IW4MAdmin if (aP.getLevel() == Player.Permission.Flagged) NewPlayer.setLevel(Player.Permission.Flagged); - String Reason = String.Empty; - String Message = String.Empty; - - if (NewPlayer.getLevel() == Player.Permission.Banned) - { - Log.Write("Banned client " + P.getName() + " trying to connect...", Log.Level.Debug); - - if (aP.getLastO() != null) - Message = "^7Player Kicked: Previously banned for ^5" + aP.getLastO() + " ^7(appeal at " + Website+ ")"; - else - Message = "Player Kicked: Previous Ban"; - - NewPlayer.Kick(Message); - - if (players[NewPlayer.getClientNum()] != null) - { - lock (players) - { - players[NewPlayer.getClientNum()] = null; - } - } - - return true; - } - Ban B = isBanned(aP); - if (B != null && aP != null) + if (B != null) { - Log.Write("Banned alias " + aP.getName() + " trying to connect...", Log.Level.Debug); - - aP.lastEvent = NewPlayer.lastEvent; - aP.LastOffense = "Evading"; + Log.Write(String.Format("Banned client {0} is connecting with new alias {1}", aP.getName(), NewPlayer.getName()), Log.Level.Debug); + NewPlayer.LastOffense = String.Format("Evading ( {0} )", aP.getName()); if (B.getReason() != null) NewPlayer.Ban("^7Previously Banned: ^5" + B.getReason() + " ^7(appeal at " + Website + ")", NewPlayer); @@ -276,7 +273,7 @@ namespace IW4MAdmin #if DEBUG == FALSE NewPlayer.Tell("Welcome ^5" + NewPlayer.getName() + " ^7this is your ^5" + Utilities.timesConnected(NewPlayer.getConnections()) + " ^7time connecting!"); #endif - Log.Write("Client " + NewPlayer.getName() + " connecting...", Log.Level.Debug); + Log.Write("Client " + NewPlayer.getName() + " connecting...", Log.Level.Debug); // they're clean if (NewPlayer.getLevel() == Player.Permission.Flagged) ToAdmins("^1NOTICE: ^7Flagged player ^5" + NewPlayer.getName() + "^7 has joined!"); @@ -384,6 +381,10 @@ namespace IW4MAdmin //Check ban list for every banned player and return ban if match is found public Ban isBanned(Player C) { + + if (C.getLevel() == Player.Permission.Banned) + return Bans.Find(p => p.getID().Equals(C.getID())); + foreach (Ban B in Bans) { if (B.getID().Length < 5 || B.getIP().Length < 5) @@ -584,7 +585,7 @@ namespace IW4MAdmin if (event_ != null) { if (event_.Origin == null) - event_.Origin = new Player("WORLD", "-1", -1, 0); + continue; event_.Origin.lastEvent = event_; event_.Origin.lastEvent.Owner = this; @@ -631,14 +632,35 @@ namespace IW4MAdmin { lastPoll = DateTime.Now; timesFailed = 0; - if (statusPlayers.Count > clientnum) + if (statusPlayers.Count != clientnum) { lock (statusPlayers) { + List toRemove = new List(); + lock (players) + { + foreach (Player P in players) + { + if (P == null) + continue; + + Player Matching; + statusPlayers.TryGetValue(P.getID(), out Matching); + if (Matching == null) // they are no longer with us + toRemove.Add(P); + } + + foreach (Player Removing in toRemove) // cuz cant modify collections + removePlayer(Removing.getClientNum()); + } + foreach (var P in statusPlayers.Values) { if (P == null) + { + Log.Write("Null player found in statusPlayers", Log.Level.Debug); continue; + } if (!addPlayer(P)) Log.Write("Error adding " + P.getName() + " at client slot #" + P.getClientNum(), Log.Level.Debug); @@ -646,25 +668,6 @@ namespace IW4MAdmin } } - else if (statusPlayers.Count < clientnum) - { - List toRemove = new List(); - - foreach (Player P in players) - { - if (P == null) - continue; - - Player Matching; - statusPlayers.TryGetValue(P.getID(), out Matching); - if (Matching == null) // they are no longer with us - toRemove.Add(P); - } - - foreach (Player Removing in toRemove) // cuz cant modify collections - removePlayer(Removing.getClientNum()); - } - clientnum = statusPlayers.Count; } @@ -694,6 +697,7 @@ namespace IW4MAdmin if (infoResponse == null || infoResponse.Length < 2) { Log.Write("Could not get server status!", Log.Level.All); + hostname = "Offline"; // for the web front return false; } @@ -728,7 +732,7 @@ namespace IW4MAdmin Website = infoResponseDict["_website"]; } - catch (Exception E) + catch (Exception) { Website = "this server's website"; Log.Write("Seems not to have website specified", Log.Level.Debug); @@ -803,7 +807,7 @@ namespace IW4MAdmin //END //get iw4m_onelog - p =RCON.addRCON("iw4m_onelog"); + p = RCON.addRCON("iw4m_onelog"); if (p[0] == String.Empty || p[1].Length < 15) { @@ -820,7 +824,7 @@ namespace IW4MAdmin logPath = Basepath + '\\' + "m2demo" + '\\' + log; else logPath = Basepath + '\\' + Mod + '\\' + log; -//#if DEBUG == FALSE && System.Environment.GetEnvironmentVariable("COMPUTERNAME") != "michael-surface" + if (!File.Exists(logPath)) { Log.Write("Gamelog does not exist!", Log.Level.All); @@ -828,7 +832,6 @@ namespace IW4MAdmin } logFile = new file(logPath); -//#endif Log.Write("Log file is " + logPath, Log.Level.Debug); //get players ip's @@ -847,7 +850,6 @@ namespace IW4MAdmin System.IO.Stream ftpStream = tmp.GetResponse().GetResponseStream(); String ftpLog = new StreamReader(ftpStream).ReadToEnd();*/ //logPath = "games_old.log"; - //logFile = new file("C:\\Users\\Michael\\text.txt"); #endif Log.Write("Now monitoring " + this.getName(), Log.Level.Debug); return true; @@ -862,7 +864,7 @@ namespace IW4MAdmin //Process any server event public bool processEvent(Event E) { - /*if (E.Type == Event.GType.Connect) + /*if (E.Type == Event.GType.Connect) // this is anow handled by rcon status :( { if (E.Origin == null) Log.Write("Connect event triggered, but no client is detected!", Log.Level.Debug); @@ -870,6 +872,11 @@ namespace IW4MAdmin return true; }*/ + if (E.Type == Event.GType.Connect) + { + return true; + } + if (E.Type == Event.GType.Disconnect) { if (E.Origin == null) @@ -924,7 +931,7 @@ namespace IW4MAdmin Log.Write(E.Origin.getName() + " killed " + E.Target.getName() + " with a " + E.Data, Log.Level.Debug); } - else //Suicide + else // suicide/falling { E.Origin.stats.Deaths++; E.Origin.stats.updateKDR(); @@ -990,7 +997,8 @@ namespace IW4MAdmin Log.Write("New map loaded - " + clientnum + " active players", Log.Level.Debug); String[] statusResponse = E.Data.Split('\\'); if (statusResponse.Length >= 15 && statusResponse[13] == "mapname") - mapname = maps.Find(m => m.Name.Equals(statusResponse[14])).Alias; //update map for heartbeat + mapname = maps.Find(m => m.Name.Equals(statusResponse[14])).Alias; //update map for heartbeat + return true; } if (E.Type == Event.GType.MapEnd) @@ -1325,7 +1333,6 @@ namespace IW4MAdmin //Will probably move this later - //public Dictionary IPS; public Dictionary statusPlayers; public bool isRunning; private DateTime lastPoll; diff --git a/Admin/WebFront.cs b/Admin/WebFront.cs index 471bcc77..188bb796 100644 --- a/Admin/WebFront.cs +++ b/Admin/WebFront.cs @@ -120,7 +120,7 @@ namespace IW4MAdmin_Web List Bans = new List(); if (totalBans > 0) - Bans = IW4MAdmin.Program.Servers[0].Bans.GetRange(start, range); + Bans = IW4MAdmin.Program.Servers[0].Bans.GetRange(start, range).OrderByDescending(x => x.getTime()).ToList(); else Bans.Add(new IW4MAdmin.Ban("No Bans", "0", "0", DateTime.Now, "")); @@ -180,7 +180,7 @@ namespace IW4MAdmin_Web range = (totalStats - start); else range = 30; - List Stats = IW4MAdmin.Program.Servers[server].statDB.getMultipleStats(start, range); + List Stats = IW4MAdmin.Program.Servers[server].statDB.getMultipleStats(start, range).OrderByDescending(x => x.Skill).ToList(); buffer.Append("NameKillsDeathsKDRRating"); cycleFix = 0; for (int i = 0; i < totalStats; i++) diff --git a/Admin/packages.config b/Admin/packages.config deleted file mode 100644 index f2dfb35b..00000000 --- a/Admin/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Admin/version.txt b/Admin/version.txt index 3583e200..fa1469b5 100644 --- a/Admin/version.txt +++ b/Admin/version.txt @@ -1,22 +1,8 @@ -VERSION: 0.8 +VERSION: 0.8.1 CHANGELOG: --added mask command --added baninfo command --added alias command and removed redundant output from `find` --added rcon command --added webfront (http://127.0.0.1:1624) --true skill is officially implemented --find now shows last connect time --noise on pm (if gsc_enabled) --force 8 line chat height (if gsc_enabled) --tell admins the number of reports on join --enhanced ban tracking --ip wait timeout added --remove report on ban --can't report yourself --remove reported players when banned --fixed rare crash with toadmins backend --fixed crash when finding player stats that don't exist --fixed a bug that caused owner command to reactivate only `creator` rank player existed --fixed a bug that caused certain notifications to be sent to all players --various small fixes \ No newline at end of file +-no longer have `world` client handle broken events +-hopefully fixed an issue with clients missing connection event +-fixed ban order in webfront +-fixed alias output duplicating +-fixed missing evade reason +-cleaned up project files \ No newline at end of file