Set the default game name to the player name.
This commit is contained in:
committed by
teinarss
parent
54c08748e0
commit
5bf4daddec
@@ -222,7 +222,7 @@ namespace OpenRA.Server
|
||||
Type = type;
|
||||
Settings = settings;
|
||||
|
||||
Settings.Name = OpenRA.Settings.SanitizedServerName(Settings.Name);
|
||||
Settings.Name = Game.Settings.SanitizedServerName(Settings.Name);
|
||||
|
||||
ModData = modData;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user