1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 07:13:58 -05:00

fixed GetHashCode

fixed TopStats
restrict search to minimum 3 characters
This commit is contained in:
RaidMax
2018-04-10 01:38:18 -05:00
parent 3f7cb69fcd
commit 145efeb91c
12 changed files with 114 additions and 38 deletions

View File

@ -25,7 +25,21 @@ namespace IW4MAdmin
public override int GetHashCode()
{
return Math.Abs($"{IP}:{Port.ToString()}".GetHashCode());
// todo: make this better with collisions
int id = Math.Abs($"{IP}:{Port.ToString()}".Select(a => (int)a).Sum());
// this is a nasty fix for get hashcode being changed
switch(id)
{
case 765:
return 886229536;
case 760:
return 1645744423;
case 761:
return 1645809959;
}
return id;
}
override public async Task<bool> AddPlayer(Player polledPlayer)