diff --git a/Admin/IW4_GameStructs.cs b/Admin/IW4_GameStructs.cs index 7811ef54..b1e1c3ed 100644 --- a/Admin/IW4_GameStructs.cs +++ b/Admin/IW4_GameStructs.cs @@ -72,7 +72,7 @@ namespace IW4MAdmin public uint flags; [FieldOffset(12)] - short type; + public short type; [FieldOffset(16)] public IntPtr current; @@ -94,21 +94,13 @@ namespace IW4MAdmin public struct dvar { public String name; - public String description; - public int flags; - - short type; - + public short type; public String current; - public String latched; - public String _default; - public int min; - public int max; } diff --git a/Admin/Server.cs b/Admin/Server.cs index e0aa6591..047f953e 100644 --- a/Admin/Server.cs +++ b/Admin/Server.cs @@ -351,14 +351,12 @@ namespace IW4MAdmin { players[cNum] = null; } - clientnum = statusPlayers.Count; return true; } else { Log.Write("Error - Client disconnecting has an invalid client index!", Log.Level.Debug); - clientnum = statusPlayers.Count; return false; } } @@ -628,6 +626,7 @@ namespace IW4MAdmin if ((DateTime.Now - lastPoll).Milliseconds > 750) { int numberRead = 0; + int activeClients = 0; for (int i = 0; i < players.Count; i++) { @@ -639,10 +638,13 @@ namespace IW4MAdmin if (eachClient.state == 0) removePlayer(i); else if (eachClient.state > 1) - addPlayer(new Player(eachClient.name, eachClient.steamid.ToString("x16"), i, 0, i, null, 0, Helpers.NET_AdrToString(eachClient.adr).Split(':')[0])); + addPlayer(new Player(Utilities.stripColors(Utilities.cleanChars(eachClient.name)), eachClient.steamid.ToString("x16"), i, 0, i, null, 0, Helpers.NET_AdrToString(eachClient.adr).Split(':')[0])); + if (eachClient.state > 2) + activeClients++; } lastPoll = DateTime.Now; + clientnum = activeClients; } #endif @@ -1363,6 +1365,7 @@ namespace IW4MAdmin Macros.Add("WISDOM", Wisdom()); Macros.Add("TOTALPLAYERS", clientDB.totalPlayers()); Macros.Add("TOTALKILLS", totalKills); + Macros.Add("VERSION", IW4MAdmin.Program.Version); } diff --git a/Admin/Utilities.cs b/Admin/Utilities.cs index 516a73a6..a5c929aa 100644 --- a/Admin/Utilities.cs +++ b/Admin/Utilities.cs @@ -353,6 +353,7 @@ namespace IW4MAdmin else dvar_actual.latched = dvar_raw.latched.ToString(); + dvar_actual.type = dvar_raw.type; dvar_actual.flags = getIntFromPointer((int)dvar_raw.flags, Handle); dvar_actual.max = getIntFromPointer((int)dvar_raw.max, Handle); dvar_actual.min = getIntFromPointer((int)dvar_raw.min, Handle); diff --git a/Admin/config/messages.cfg b/Admin/config/messages.cfg index 9fa6ee72..eef2903e 100644 --- a/Admin/config/messages.cfg +++ b/Admin/config/messages.cfg @@ -1,5 +1,5 @@ 60 -This server uses ^5IW4M Admin v0.9 ^7get it at ^5raidmax.org +This server uses ^5IW4M Admin v{{VERSION}} ^7get it at ^5raidmax.org/IW4MAdmin ^5IW4M Admin ^7sees ^5YOU! This server has harvested the information of ^5{{TOTALPLAYERS}} ^7players! Cheaters are ^1unwelcome ^7 on this server