Minor networking fixes

- Don't spam the shit out of status updates (TODO: send update
immediately on drastic changes)
- Fixed some potential message misreading
- Readded homoglyph name comparison
This commit is contained in:
juanjp600
2017-12-21 16:00:04 -03:00
parent 40a46f96e2
commit c593fdb7c6
8 changed files with 56 additions and 37 deletions
@@ -126,7 +126,7 @@ namespace Barotrauma.Networking
public static bool IsValidName(string name)
{
if (name.Contains("\n") || name.Contains("\r\n")) return false;
if (name.Contains("\n") || name.Contains("\r")) return false;
return (name.All(c =>
c != ';' &&
@@ -172,7 +172,7 @@ namespace Barotrauma.Networking
DebugConsole.NewMessage(clName + " (" + inc.SenderConnection.RemoteEndPoint.Address.ToString() + ") couldn't join the server (invalid name)", Color.Red);
return;
}
if (clName.ToLower() == Name.ToLower())
if (Homoglyphs.Compare(clName.ToLower(),Name.ToLower()))
{
DisconnectUnauthClient(inc, unauthClient, "That name is taken.");
Log(clName + " (" + inc.SenderConnection.RemoteEndPoint.Address.ToString() + ") couldn't join the server (name taken by the server)", ServerLog.MessageType.Error);