truncate name if longer than 10 chars

This commit is contained in:
alzeih
2010-06-18 14:46:16 +12:00
parent 331706d75e
commit d6c83eddbd

View File

@@ -270,6 +270,11 @@ namespace OpenRA.Server
SendChatTo( conn, "Blank names are not permitted." ); SendChatTo( conn, "Blank names are not permitted." );
return true; return true;
} }
if (s.Length > 10)
{
s = s.Substring(0,10);
}
Console.WriteLine("Player@{0} is now known as {1}", conn.socket.RemoteEndPoint, s); Console.WriteLine("Player@{0} is now known as {1}", conn.socket.RemoteEndPoint, s);
GetClient(conn).Name = s; GetClient(conn).Name = s;