From b3f0f71d43a66ccff6d25a73cc31dbef3af931e3 Mon Sep 17 00:00:00 2001 From: juanjp600 Date: Mon, 29 Aug 2016 17:42:37 -0300 Subject: [PATCH] Fixed password storage when it isn't set Disabled hashing on an empty string --- Subsurface/Source/Networking/GameServer.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Subsurface/Source/Networking/GameServer.cs b/Subsurface/Source/Networking/GameServer.cs index 3c8e819b5..6f9a44e05 100644 --- a/Subsurface/Source/Networking/GameServer.cs +++ b/Subsurface/Source/Networking/GameServer.cs @@ -55,8 +55,12 @@ namespace Barotrauma.Networking name = name.Replace(":", ""); name = name.Replace(";", ""); - this.name = name; - this.password = Encoding.UTF8.GetString(NetUtility.ComputeSHAHash(Encoding.UTF8.GetBytes(password))); + this.name = name; + this.password = ""; + if (password.Length>0) + { + this.password = Encoding.UTF8.GetString(NetUtility.ComputeSHAHash(Encoding.UTF8.GetBytes(password))); + } config = new NetPeerConfiguration("barotrauma");