Fix for amb108 - statsx keeping port when saving stats by ip - this should still allow for old stats files to work, but there is a small chance for idiosyncrasies if there are multiple users with the same ip (but different port) saved.
This commit is contained in:
@ -77,6 +77,7 @@ void CPlayer::PutInServer(){
|
||||
|
||||
const char* unique;
|
||||
const char* name = STRING(pEdict->v.netname);
|
||||
bool isip = false;
|
||||
switch((int)dodstats_rank->value) {
|
||||
case 1:
|
||||
if ( (unique = GETPLAYERAUTHID(pEdict)) == 0 )
|
||||
@ -84,17 +85,27 @@ void CPlayer::PutInServer(){
|
||||
break;
|
||||
case 2:
|
||||
unique = ip;
|
||||
isip = true;
|
||||
break;
|
||||
default:
|
||||
unique = name;
|
||||
}
|
||||
if ( ( rank = g_rank.findEntryInRank( unique , name ) ) == 0 )
|
||||
if ( ( rank = g_rank.findEntryInRank( unique , name , isip) ) == 0 )
|
||||
ingame = false;
|
||||
}
|
||||
|
||||
void CPlayer::Connect(const char* nn,const char* ippp ){
|
||||
bot = IsBot();
|
||||
strcpy(ip,ippp);
|
||||
// Strip the port from the ip
|
||||
for (size_t i = 0; i < sizeof(ip); i++)
|
||||
{
|
||||
if (ip[i] == ':')
|
||||
{
|
||||
ip[i] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CPlayer::restartStats(bool all)
|
||||
|
Reference in New Issue
Block a user