also sanitize server names
This commit is contained in:
@@ -130,6 +130,9 @@ namespace OpenRA.Server
|
||||
Port = localEndpoint.Port;
|
||||
|
||||
Settings = settings;
|
||||
|
||||
Settings.Name = OpenRA.Settings.SanitizedServerName(Settings.Name);
|
||||
|
||||
ModData = modData;
|
||||
|
||||
randomSeed = (int)DateTime.Now.ToBinary();
|
||||
|
||||
@@ -321,6 +321,15 @@ namespace OpenRA
|
||||
return clean;
|
||||
}
|
||||
|
||||
public static string SanitizedServerName(string dirty)
|
||||
{
|
||||
var clean = SanitizedName(dirty);
|
||||
if (string.IsNullOrWhiteSpace(clean))
|
||||
return new ServerSettings().Name;
|
||||
else
|
||||
return clean;
|
||||
}
|
||||
|
||||
public static string SanitizedPlayerName(string dirty)
|
||||
{
|
||||
var forbiddenNames = new string[] { "Open", "Closed" };
|
||||
|
||||
Reference in New Issue
Block a user