diff --git a/Admin/Database.cs b/Admin/Database.cs index 809f701f..7a2833ce 100644 --- a/Admin/Database.cs +++ b/Admin/Database.cs @@ -450,6 +450,9 @@ namespace IW4MAdmin //Update stat information of specified player public void updatePlayer(Player P) { + if (P.stats == null) + return; + Dictionary updatedPlayer = new Dictionary(); updatedPlayer.Add("KILLS", P.stats.Kills); diff --git a/Admin/Helpers.cs b/Admin/Helpers.cs new file mode 100644 index 00000000..461c0515 --- /dev/null +++ b/Admin/Helpers.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace IW4MAdmin +{ + class pHistory + { + public pHistory(DateTime w, int cNum) + { + When = w; + Players = cNum; + } + public DateTime When { get; private set; } + public int Players { get; private set; } + } +} diff --git a/Admin/IW4M ADMIN.csproj b/Admin/IW4M ADMIN.csproj index b5db5b98..ebbc76fd 100644 --- a/Admin/IW4M ADMIN.csproj +++ b/Admin/IW4M ADMIN.csproj @@ -97,6 +97,7 @@ + @@ -130,6 +131,9 @@ Always + + Always + Always @@ -146,7 +150,7 @@ PreserveNewest - PreserveNewest + Always PreserveNewest diff --git a/Admin/Server.cs b/Admin/Server.cs index 4f7d4258..268cae75 100644 --- a/Admin/Server.cs +++ b/Admin/Server.cs @@ -39,7 +39,7 @@ namespace IW4MAdmin Skills = new Moserware.TrueSkill(); statusPlayers = new Dictionary(); chatHistory = new List(); - playerHistory = new Queue(); + playerHistory = new Queue(); lastWebChat = DateTime.Now; nextMessage = 0; initCommands(); @@ -529,9 +529,15 @@ namespace IW4MAdmin isRunning = true; #if DEBUG - // Random rnd = new Random(); - // while (playerHistory.Count < 144) - // playerHistory.Enqueue(rnd.Next(0, 18)); + /* Random rnd = new Random(); + DateTime testTOD = DateTime.Now; + while (playerHistory.Count < 144) + { + playerHistory.Enqueue(new pHistory(testTOD, rnd.Next(14, 19))); + testTOD = testTOD.AddMinutes(5); + } + + Console.WriteLine("There are " + playerHistory.Count + " player counts");*/ #endif //Handles new rcon requests in a fashionable manner @@ -579,9 +585,9 @@ namespace IW4MAdmin if ((lastCount - playerCountStart).TotalMinutes > 4) { - while (playerHistory.Count > 144 ) + while (playerHistory.Count > 144 ) // 12 times a minute for 12 hours playerHistory.Dequeue(); - playerHistory.Enqueue(clientnum); + playerHistory.Enqueue(new pHistory(lastCount, clientnum)); playerCountStart = DateTime.Now; } @@ -1406,7 +1412,7 @@ namespace IW4MAdmin public int totalKills = 0; public List Reports; public List chatHistory; - public Queue playerHistory; + public Queue playerHistory; //Info diff --git a/Admin/WebFront.cs b/Admin/WebFront.cs index e138d0c6..70bc4fee 100644 --- a/Admin/WebFront.cs +++ b/Admin/WebFront.cs @@ -463,19 +463,20 @@ namespace IW4MAdmin_Web test.Append("
"); test.Append(""); - test.Append(""); - body = test.ToString(); + IW4MAdmin.file Graph = new IW4MAdmin.file("webfront\\graph.html"); + var graph = Graph.getLines(); + Graph.Close(); + body = test.ToString() + graph ; } else if (request.QueryString == "player") @@ -500,8 +501,8 @@ namespace IW4MAdmin_Web IW4MAdmin.Player P = IW4MAdmin.Program.Servers[server].clientDB.getPlayer(IP); if (P == null) P = new IW4MAdmin.Player("Guest", "Guest", 0, 0); - if (P.getLevel() > IW4MAdmin.Player.Permission.Flagged) - Console.WriteLine(P.getName() + " is authenticated"); + // if (P.getLevel() > IW4MAdmin.Player.Permission.Flagged) + // Console.WriteLine(P.getName() + " is authenticate"); Client toSend = new Client(WebFront.Page.player, page, request.Headers, Data, P); body = Macro.findMacros(header + player + footer, toSend, server); diff --git a/Admin/version.txt b/Admin/version.txt index ef156240..410d6d08 100644 --- a/Admin/version.txt +++ b/Admin/version.txt @@ -1,4 +1,8 @@ -VERSION: 0.9 +VERSION: 0.9.1 +CHANGELOG: +fixed issue with `history` timelime + +VERSION: 0.9 CHANGELOG: -webfront now displays player info and link to repz account -webfront shows ips for authed admin ( determined by ip ) diff --git a/Admin/webfront/footer.html b/Admin/webfront/footer.html index c7a28e6b..da3249f3 100644 --- a/Admin/webfront/footer.html +++ b/Admin/webfront/footer.html @@ -9,8 +9,8 @@ $("#history_dialog").dialog({ autoOpen: false, modal: true, - width: 1000, - height: 350, + width: 1100, + height: 450, buttons: { "Dismiss": function () { $(this).dialog("close"); diff --git a/Admin/webfront/graph.html b/Admin/webfront/graph.html new file mode 100644 index 00000000..8b5751cb --- /dev/null +++ b/Admin/webfront/graph.html @@ -0,0 +1,58 @@ + +