-
-
Save mstefarov/2973f11a927c00cf5f21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: Player.Networking.cs | |
=================================================================== | |
--- Player.Networking.cs (revision 1440) | |
+++ Player.Networking.cs (revision 1441) | |
@@ -472,18 +472,18 @@ | |
Logger.Log( LogType.Error, | |
"Player.LoginSequence: Wrong protocol version: {0}.", | |
clientProtocolVersion ); | |
- KickNow( "Incompatible protocol version!", LeaveReason.ProtocolViolation ); | |
+ KickNow( "Incompatible protocol version.", LeaveReason.ProtocolViolation ); | |
return false; | |
} | |
- string playerName = reader.ReadString(); | |
+ string givenName = reader.ReadString(); | |
// Check name for nonstandard characters | |
- if( !IsValidName( playerName ) ) { | |
+ if( !IsValidName( givenName ) ) { | |
Logger.Log( LogType.SuspiciousActivity, | |
"Player.LoginSequence: Unacceptable player name: {0} ({1})", | |
- playerName, IP ); | |
- KickNow( "Invalid characters in player name!", LeaveReason.ProtocolViolation ); | |
+ givenName, IP ); | |
+ KickNow( "Unacceptable player name.", LeaveReason.ProtocolViolation ); | |
return false; | |
} | |
@@ -492,10 +492,10 @@ | |
BytesReceived += 131; | |
Position = WorldManager.MainWorld.Map.Spawn; | |
- Info = PlayerDB.FindOrCreateInfoForPlayer( playerName, IP ); | |
+ Info = PlayerDB.FindOrCreateInfoForPlayer( givenName, IP ); | |
ResetAllBinds(); | |
- if( Server.VerifyName( Name, verificationCode, Heartbeat.Salt ) ) { | |
+ if( Server.VerifyName( givenName, verificationCode, Heartbeat.Salt ) ) { | |
IsVerified = true; | |
} else { | |
@@ -555,6 +555,10 @@ | |
} | |
} | |
} | |
+ // update capitalization of player's name | |
+ if( !Info.Name.Equals( givenName, StringComparison.Ordinal ) ) { | |
+ Info.Name = givenName; | |
+ } | |
// Check if player is banned |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment