Browse Source

fixed possible statistics hack

pull/123/head
notgiven688 3 years ago
parent
commit
15b325f1a9
2 changed files with 6 additions and 6 deletions
  1. +3
    -3
      server/Server.userprefs
  2. +3
    -3
      server/Server/Program.cs

+ 3
- 3
server/Server.userprefs View File

@ -1,8 +1,8 @@
<Properties StartupConfiguration="{DC564972-9DEF-4897-A8F5-C4C21CEBDE2F}|Default" StartupItem="Server/Server.csproj">
<MonoDevelop.Ide.Workbench ActiveDocument="Server/PoolConnection.cs">
<MonoDevelop.Ide.Workbench ActiveDocument="Server/Program.cs">
<Files>
<File FileName="Server/Program.cs" Line="1" Column="1" />
<File FileName="Server/PoolConnection.cs" Line="410" Column="4" />
<File FileName="Server/Program.cs" Line="9" Column="15" />
<File FileName="Server/PoolConnection.cs" Line="1" Column="1" />
<File FileName="Server/JSONParser.cs" Line="1" Column="1" />
<File FileName="Server/Extensions.cs" Line="1" Column="1" />
<File FileName="Server/EmptyWebsocket.cs" Line="1" Column="1" />

+ 3
- 3
server/Server/Program.cs View File

@ -532,9 +532,9 @@ namespace Server
{
string[] _data = line.Split(new string[] { SEP }, StringSplitOptions.None);
string _id = _data[0];
string _id = _data[1];
long _num = 0;
long.TryParse(_data[1], out _num);
long.TryParse(_data[0], out _num);
statistics.TryAdd(_id, _num);
}
@ -1133,7 +1133,7 @@ namespace Server
foreach (var stat in statistics)
{
sb.AppendLine(stat.Key + SEP + stat.Value.ToString());
sb.AppendLine(stat.Value.ToString() + SEP + stat.Key);
}
File.WriteAllText("statistics.dat", sb.ToString().TrimEnd('\r', '\n'));

Loading…
Cancel
Save