NetworkSession: compare usernames case-insensitively

the current data management system uses case-insensitive names, so we can't allow different players with the same name in different cases to join, or we will have duplication exploits.

This typically only applies to offline servers, since Xbox Live doesn't permit reuse of a username, same case or otherwise.

closes #4965
This commit is contained in:
Dylan K. Taylor 2022-04-17 19:27:48 +01:00
parent 3bbf558883
commit 022db5cbe3
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -635,7 +635,7 @@ class NetworkSession{
continue;
}
$info = $existingSession->getPlayerInfo();
if($info !== null && ($info->getUsername() === $this->info->getUsername() || $info->getUuid()->equals($this->info->getUuid()))){
if($info !== null && (strcasecmp($info->getUsername(), $this->info->getUsername()) === 0 || $info->getUuid()->equals($this->info->getUuid()))){
if($kickForXUIDMismatch($info instanceof XboxLivePlayerInfo ? $info->getXuid() : "")){
return;
}