fix crash on blank names

This commit is contained in:
Chris Forbes
2010-03-22 18:01:06 +13:00
parent 826908d747
commit c8cb683373

View File

@@ -299,6 +299,18 @@ namespace OpenRA.Server
{ "name",
s =>
{
if (GameStarted)
{
SendChatTo( conn, "You can't change your name after the game has started" );
return true;
}
if (s.Trim() == "")
{
SendChatTo( conn, "Blank names are not permitted." );
return true;
}
Console.WriteLine("Player@{0} is now known as {1}", conn.socket.RemoteEndPoint, s);
GetClient(conn).Name = s;
SyncLobbyInfo();