Set the default game name to the player name.

This commit is contained in:
Matthias Mailänder
2021-08-22 11:17:26 +02:00
committed by teinarss
parent 54c08748e0
commit 5bf4daddec
3 changed files with 7 additions and 7 deletions

View File

@@ -45,7 +45,7 @@ namespace OpenRA
public class ServerSettings
{
[Desc("Sets the server name.")]
public string Name = "OpenRA Game";
public string Name = "";
[Desc("Sets the internal port.")]
public int ListenPort = 1234;
@@ -404,11 +404,11 @@ namespace OpenRA
return clean;
}
public static string SanitizedServerName(string dirty)
public string SanitizedServerName(string dirty)
{
var clean = SanitizedName(dirty);
if (string.IsNullOrWhiteSpace(clean))
return new ServerSettings().Name;
return $"{SanitizedPlayerName(Player.Name)}'s Game";
else
return clean;
}