Anti-gamerfood measures:

- clients don't send server passwords as plaintext: the server sends a nonce which the client encrypt using the password as the key
- IPs are visible in netstats
- amount of client jobpreferences limited to 3 at the servers side
- sanitizing client names
This commit is contained in:
Regalis
2016-08-19 18:18:07 +03:00
parent 5dc8a5f8b7
commit ef0098d52a
7 changed files with 430 additions and 333 deletions
+6 -1
View File
@@ -66,7 +66,10 @@ namespace Barotrauma.Networking
{
if (bannedPlayers.Any(bp => bp.IP == ip)) return;
DebugConsole.Log("Banned " + name);
bannedPlayers.Add(new BannedPlayer(name, ip));
Save();
}
public bool IsBanned(string IP)
@@ -108,10 +111,13 @@ namespace Barotrauma.Networking
BannedPlayer banned = obj as BannedPlayer;
if (banned == null) return false;
DebugConsole.Log("Removing ban from " + banned.Name);
GameServer.Log("Removing ban from " + banned.Name, null);
bannedPlayers.Remove(banned);
Save();
if (banFrame != null)
{
banFrame.Parent.RemoveChild(banFrame);
@@ -130,7 +136,6 @@ namespace Barotrauma.Networking
public void Save()
{
GameServer.Log("Saving banlist", null);
List<string> lines = new List<string>();