fixed weird issue of players with 0 skill showing up in topstats

client name changes are now updated in the database oops
removed clientindex for admins command
This commit is contained in:
RaidMax 2015-03-10 22:32:23 -05:00
parent 74312d5b4e
commit 3aef7619fc
5 changed files with 13 additions and 5 deletions

View File

@ -351,7 +351,7 @@ namespace IW4MAdmin
{ {
if (P != null && P.getLevel() > Player.Permission.User) if (P != null && P.getLevel() > Player.Permission.User)
{ {
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} {1}", P.getLevel(), P.getName(), Utilities.getSpaces(Player.Permission.SeniorAdmin.ToString().Length - P.getLevel().ToString().Length)));
} }
} }
} }

View File

@ -170,7 +170,7 @@ namespace IW4MAdmin
public List<Stats> topStats() public List<Stats> topStats()
{ {
String Query = String.Format("SELECT * FROM STATS WHERE SKILL > '{0}' LIMIT 4", 20); String Query = String.Format("SELECT * FROM STATS WHERE SKILL > '{0}' ORDER BY SKILL DESC LIMIT 4", 20);
DataTable Result = GetDataTable(Query); DataTable Result = GetDataTable(Query);
List<Stats> Top = new List<Stats>(); List<Stats> Top = new List<Stats>();
@ -180,7 +180,8 @@ namespace IW4MAdmin
foreach (DataRow D in Result.Rows) foreach (DataRow D in Result.Rows)
{ {
Stats S = new Stats(Convert.ToInt32(D["Number"]), Convert.ToInt32(D["DEATHS"]), Convert.ToDouble(D["KDR"]), Convert.ToDouble(D["SKILL"])); Stats S = new Stats(Convert.ToInt32(D["Number"]), Convert.ToInt32(D["DEATHS"]), Convert.ToDouble(D["KDR"]), Convert.ToDouble(D["SKILL"]));
Top.Add(S); if (S.Skill > 20)
Top.Add(S);
} }
} }

View File

@ -97,6 +97,11 @@ namespace IW4MAdmin
return LastOffense; return LastOffense;
} }
public void updateName(String n)
{
Name = n;
}
// BECAUSE IT NEEDS TO BE CHANGED! // BECAUSE IT NEEDS TO BE CHANGED!
public void setLevel(Player.Permission Perm) public void setLevel(Player.Permission Perm)
{ {

View File

@ -102,6 +102,8 @@ namespace IW4MAdmin
//messy way to prevent loss of last event //messy way to prevent loss of last event
Player A; Player A;
A = DB.getPlayer(P.getID(), P.getClientNum()); A = DB.getPlayer(P.getID(), P.getClientNum());
if (A.getName() != P.getName())
A.updateName(P.getName());
A.lastEvent = P.lastEvent; A.lastEvent = P.lastEvent;
P = A; P = A;
} }

View File

@ -13,8 +13,8 @@ Global
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {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}.Debug|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.ActiveCfg = Debug|Any CPU
{DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Any CPU.Build.0 = Release|Any CPU {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE