It shouldn't be possible for someone to give themself an Eve name that already exists in the server. An example showing this is possible is the recent Eve River who was alive 2 days later than one who had a 30 day long lineage:
I suspect the issue stems from the following section of code:
|
char *getUniqueCursableName( char *inPlayerName, char *outSuffixAdded, |
|
char inIsEve ) { |
|
|
|
char dup = isNameDuplicateForCurses( inPlayerName ); |
|
|
|
if( ! dup ) { |
|
*outSuffixAdded = false; |
|
|
|
if( inIsEve ) { |
|
// make sure Eve doesn't have same last name as any living person |
|
char firstName[99]; |
|
char lastName[99]; |
|
|
|
sscanf( inPlayerName, "%s %s", firstName, lastName ); |
|
|
|
for( int i=0; i<players.size(); i++ ) { |
|
LiveObject *o = players.getElement( i ); |
|
|
|
if( ! o->error && o->familyName != NULL && |
|
strcmp( o->familyName, lastName ) == 0 ) { |
|
|
|
dup = true; |
|
break; |
|
} |
|
} |
|
} |
|
|
|
|
|
return inPlayerName; |
|
} |
If there is still a player alive with the exact first and last name (eg Eve River), then this section gets skipped, but if the family has been alive long enough, it will test if there are other people in the server with the same family name. The return statement runs no matter what the result of that check is, so even if dup is set to true, the return statement is still executed. The code doesn't get the chance continue past that point and find a new unique name.
I suggest that replacing the return statement with the following code may resolve the issue:
if( ! dup ) {
return inPlayerName;
}
Then it would check if dup is still false, after running the check, and only be executed if it hasn't been changed.
It shouldn't be possible for someone to give themself an Eve name that already exists in the server. An example showing this is possible is the recent Eve River who was alive 2 days later than one who had a 30 day long lineage:
I suspect the issue stems from the following section of code:
OneLife/server/server.cpp
Lines 11421 to 11450 in f6d196e
If there is still a player alive with the exact first and last name (eg Eve River), then this section gets skipped, but if the family has been alive long enough, it will test if there are other people in the server with the same family name. The return statement runs no matter what the result of that check is, so even if
dupis set to true, the return statement is still executed. The code doesn't get the chance continue past that point and find a new unique name.I suggest that replacing the return statement with the following code may resolve the issue:
Then it would check if dup is still false, after running the check, and only be executed if it hasn't been changed.