fix crash on blank names
This commit is contained in:
@@ -299,6 +299,18 @@ namespace OpenRA.Server
|
|||||||
{ "name",
|
{ "name",
|
||||||
s =>
|
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);
|
Console.WriteLine("Player@{0} is now known as {1}", conn.socket.RemoteEndPoint, s);
|
||||||
GetClient(conn).Name = s;
|
GetClient(conn).Name = s;
|
||||||
SyncLobbyInfo();
|
SyncLobbyInfo();
|
||||||
|
|||||||
Reference in New Issue
Block a user