also sanitize server names

This commit is contained in:
Matthias Mailänder
2015-05-10 21:07:22 +02:00
parent 736b169319
commit edca755540
3 changed files with 23 additions and 2 deletions

View File

@@ -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" };