diff --git a/Barotrauma/BarotraumaClient/Source/Characters/CharacterNetworking.cs b/Barotrauma/BarotraumaClient/Source/Characters/CharacterNetworking.cs index 51d728219..4c6641fbe 100644 --- a/Barotrauma/BarotraumaClient/Source/Characters/CharacterNetworking.cs +++ b/Barotrauma/BarotraumaClient/Source/Characters/CharacterNetworking.cs @@ -145,6 +145,10 @@ namespace Barotrauma float rotation = msg.ReadFloat(); + ReadStatus(msg); + + msg.ReadPadBits(); + int index = 0; if (GameMain.NetworkMember.Character == this) { @@ -193,9 +197,6 @@ namespace Barotrauma IsRemotePlayer = ownerID > 0; } break; - case 2: - ReadStatus(msg); - break; } break; diff --git a/Barotrauma/BarotraumaServer/BarotraumaServer.csproj b/Barotrauma/BarotraumaServer/BarotraumaServer.csproj index 2cb7b45a8..02a4df579 100644 --- a/Barotrauma/BarotraumaServer/BarotraumaServer.csproj +++ b/Barotrauma/BarotraumaServer/BarotraumaServer.csproj @@ -36,7 +36,7 @@ true pdbonly true - bin\x86\ReleaseLinux + ..\bin\ReleaseLinux TRACE;SERVER 4 x86 @@ -45,7 +45,7 @@ true full false - bin\x86\DebugLinux + ..\bin\DebugLinux TRACE;SERVER;DEBUG 4 x86 @@ -54,7 +54,7 @@ true pdbonly true - bin\x86\ReleaseWindows + ..\bin\ReleaseWindows TRACE;SERVER 4 x86 @@ -63,7 +63,7 @@ true full false - bin\x86\DebugWindows + ..\bin\DebugWindows TRACE;SERVER;DEBUG 4 x86 diff --git a/Barotrauma/BarotraumaShared/Content/Items/Door/doors.xml b/Barotrauma/BarotraumaShared/Content/Items/Door/doors.xml index 476f8a787..1844bb699 100644 --- a/Barotrauma/BarotraumaShared/Content/Items/Door/doors.xml +++ b/Barotrauma/BarotraumaShared/Content/Items/Door/doors.xml @@ -12,7 +12,7 @@ - + @@ -159,4 +159,4 @@ - \ No newline at end of file + diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Character.cs b/Barotrauma/BarotraumaShared/Source/Characters/Character.cs index ad03fcce7..4424e713a 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/Character.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/Character.cs @@ -344,18 +344,18 @@ namespace Barotrauma if (GameMain.Client != null) return; float newHealth = MathHelper.Clamp(value, minHealth, maxHealth); - if (newHealth == health) return; + //if (newHealth == health) return; health = newHealth; - if (GameMain.Server != null) + /*if (GameMain.Server != null) { if (Math.Abs(health - lastSentHealth) > (maxHealth - minHealth) / 255.0f || Math.Sign(health) != Math.Sign(lastSentHealth)) { GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status }); lastSentHealth = health; } - } + }*/ } } @@ -373,12 +373,12 @@ namespace Barotrauma if (GameMain.Client != null) return; float newBleeding = MathHelper.Clamp(value, 0.0f, 5.0f); - if (newBleeding == bleeding) return; + //if (newBleeding == bleeding) return; bleeding = newBleeding; - if (GameMain.Server != null) - GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status }); + /*if (GameMain.Server != null) + GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status });*/ } } @@ -1534,11 +1534,11 @@ namespace Barotrauma if (stunTimer > 0.0f) { stunTimer -= deltaTime; - if (stunTimer < 0.0f && GameMain.Server != null) + /*if (stunTimer < 0.0f && GameMain.Server != null) { //stun ended -> notify clients GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status }); - } + } */ } //Skip health effects as critical health handles it differently @@ -1568,8 +1568,8 @@ namespace Barotrauma if (IsRagdolled) { if (AnimController is HumanoidAnimController) ((HumanoidAnimController)AnimController).Crouching = false; - if(GameMain.Server != null) - GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status }); + /*if(GameMain.Server != null) + GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status });*/ AnimController.ResetPullJoints(); selectedConstruction = null; return; @@ -1815,11 +1815,11 @@ namespace Barotrauma if ((newStun <= stunTimer && !allowStunDecrease) || !MathUtils.IsValid(newStun)) return; - if (GameMain.Server != null && + /*if (GameMain.Server != null && (Math.Sign(newStun) != Math.Sign(stunTimer) || Math.Abs(newStun - stunTimer) > 0.1f)) { GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status }); - } + }*/ if (Math.Sign(newStun) != Math.Sign(stunTimer)) AnimController.ResetPullJoints(); @@ -1878,11 +1878,11 @@ namespace Barotrauma return; } - if (GameMain.NetworkMember != null) + /*if (GameMain.NetworkMember != null) { if (GameMain.Server != null) GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status }); - } + }*/ AnimController.Frozen = false; diff --git a/Barotrauma/BarotraumaShared/Source/Characters/CharacterNetworking.cs b/Barotrauma/BarotraumaShared/Source/Characters/CharacterNetworking.cs index 0420bbab4..82bcb0cb9 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/CharacterNetworking.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/CharacterNetworking.cs @@ -332,6 +332,7 @@ namespace Barotrauma inventory.ServerRead(type, msg, c); break; case 1: + bool doingCPR = msg.ReadBoolean(); if (c.Character != this) { #if DEBUG @@ -340,7 +341,6 @@ namespace Barotrauma return; } - bool doingCPR = msg.ReadBoolean(); AnimController.Anim = doingCPR ? AnimController.Animation.CPR : AnimController.Animation.None; break; case 2: @@ -358,7 +358,15 @@ namespace Barotrauma } break; case 3: - AnimController.GrabLimb = (LimbType)msg.ReadUInt16(); + LimbType grabLimb = (LimbType)msg.ReadUInt16(); + if (c.Character != this) + { +#if DEBUG + DebugConsole.Log("Received a character update message from a client who's not controlling the character"); +#endif + return; + } + AnimController.GrabLimb = grabLimb; break; } break; @@ -384,10 +392,6 @@ namespace Barotrauma Client owner = ((Client)extraData[1]); msg.Write(owner == null ? (byte)0 : owner.ID); break; - case NetEntityEvent.Type.Status: - msg.WriteRangedInteger(0, 2, 2); - WriteStatus(msg); - break; } msg.WritePadBits(); } @@ -474,6 +478,8 @@ namespace Barotrauma tempBuffer.Write(SimPosition.Y); tempBuffer.Write(AnimController.Collider.Rotation); + WriteStatus(tempBuffer); + tempBuffer.WritePadBits(); msg.Write((byte)tempBuffer.LengthBytes); diff --git a/Barotrauma/BarotraumaShared/Source/Networking/Client.cs b/Barotrauma/BarotraumaShared/Source/Networking/Client.cs index f380611f0..fff97a991 100644 --- a/Barotrauma/BarotraumaShared/Source/Networking/Client.cs +++ b/Barotrauma/BarotraumaShared/Source/Networking/Client.cs @@ -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 != ';' && diff --git a/Barotrauma/BarotraumaShared/Source/Networking/GameServerLogin.cs b/Barotrauma/BarotraumaShared/Source/Networking/GameServerLogin.cs index f0b4d65e4..a34727cd1 100644 --- a/Barotrauma/BarotraumaShared/Source/Networking/GameServerLogin.cs +++ b/Barotrauma/BarotraumaShared/Source/Networking/GameServerLogin.cs @@ -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); diff --git a/Barotrauma/Launcher/Launcher.csproj b/Barotrauma/Launcher/Launcher.csproj index 936400c5e..ce8513eb4 100644 --- a/Barotrauma/Launcher/Launcher.csproj +++ b/Barotrauma/Launcher/Launcher.csproj @@ -22,26 +22,38 @@ Icon.ico - false - bin\x86\ReleaseLinux + true + pdbonly + true + ..\bin\ReleaseLinux + TRACE;LINUX;CLIENT 4 x86 + true + full false - bin\x86\DebugLinux + ..\bin\DebugLinux + TRACE;LINUX;CLIENT;DEBUG 4 x86 - false - bin\x86\ReleaseWindows + true + pdbonly + true + ..\bin\ReleaseWindows + TRACE;WINDOWS;CLIENT 4 x86 + true + full false - bin\x86\DebugWindows + ..\bin\DebugWindows + TRACE;WINDOWS;CLIENT;DEBUG 4 x86