Skip to content

Instantly share code, notes, and snippets.

@mstefarov
Created May 2, 2012 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mstefarov/2973f11a927c00cf5f21 to your computer and use it in GitHub Desktop.
Save mstefarov/2973f11a927c00cf5f21 to your computer and use it in GitHub Desktop.
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