Refactor and fix #56
This commit is contained in:
@@ -43,7 +43,7 @@ namespace Barotrauma
|
||||
var owner = GameMain.Server.ConnectedClients.Find(c => c.Character == this);
|
||||
if (owner != null)
|
||||
{
|
||||
if (!GameMain.LuaCs.game.overrideTraitors)
|
||||
if (!GameMain.LuaCs.Game.overrideTraitors)
|
||||
{
|
||||
GameMain.Server.SendDirectChatMessage(TextManager.FormatServerMessage("KilledByTraitorNotification"), owner, ChatMessageType.ServerMessageBoxInGame);
|
||||
}
|
||||
|
||||
@@ -700,7 +700,7 @@ namespace Barotrauma
|
||||
|
||||
var tempBuffer = new ReadWriteMessage();
|
||||
WriteStatus(tempBuffer);
|
||||
if (msgLengthBeforeStatus + tempBuffer.LengthBytes >= 255 && restrictMessageSize && GameMain.LuaCs.networking.restrictMessageSize)
|
||||
if (msgLengthBeforeStatus + tempBuffer.LengthBytes >= 255 && restrictMessageSize && GameMain.LuaCs.Networking.restrictMessageSize)
|
||||
{
|
||||
msg.Write(false);
|
||||
if (msgLengthBeforeStatus < 255)
|
||||
|
||||
@@ -1273,11 +1273,21 @@ namespace Barotrauma
|
||||
"Mono.Cecil.Rocks.dll", "MonoMod.Common.dll",
|
||||
"MoonSharp.Interpreter.dll",
|
||||
"mscordaccore_amd64_amd64_4.700.22.11601.dll",
|
||||
|
||||
"Microsoft.CodeAnalysis.dll", "Microsoft.CodeAnalysis.CSharp.dll",
|
||||
"Microsoft.CodeAnalysis.CSharp.Scripting.dll", "Microsoft.CodeAnalysis.Scripting.dll",
|
||||
|
||||
"System.Reflection.Metadata.dll", "System.Collections.Immutable.dll",
|
||||
"System.Runtime.CompilerServices.Unsafe.dll"
|
||||
};
|
||||
|
||||
File.Move("Barotrauma.dll", "Barotrauma.dll.old", true);
|
||||
File.Move("Barotrauma.deps.json", "Barotrauma.deps.json.old", true);
|
||||
|
||||
File.Move("System.Reflection.Metadata.dll", "System.Reflection.Metadata.dll.old", true);
|
||||
File.Move("System.Collections.Immutable.dll", "System.Collections.Immutable.dll.old", true);
|
||||
File.Move("System.Runtime.CompilerServices.Unsafe.dll", "System.Runtime.CompilerServices.Unsafe.dll.old", true);
|
||||
|
||||
foreach (string file in filesToCopy)
|
||||
{
|
||||
File.Copy(Path.Combine(path, "Binary", file), file, true);
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
bool isOwner = GameMain.Server.OwnerConnection != null && c.Connection == GameMain.Server.OwnerConnection;
|
||||
|
||||
if (similarity + c.ChatSpamSpeed > 5.0f && !isOwner && !GameMain.LuaCs.game.disableSpamFilter)
|
||||
if (similarity + c.ChatSpamSpeed > 5.0f && !isOwner && !GameMain.LuaCs.Game.disableSpamFilter)
|
||||
{
|
||||
GameMain.Server.KarmaManager.OnSpamFilterTriggered(c);
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
c.ChatSpamSpeed += similarity + 0.5f;
|
||||
|
||||
if (c.ChatSpamTimer > 0.0f && !isOwner && !GameMain.LuaCs.game.disableSpamFilter)
|
||||
if (c.ChatSpamTimer > 0.0f && !isOwner && !GameMain.LuaCs.Game.disableSpamFilter)
|
||||
{
|
||||
ChatMessage denyMsg = Create("", TextManager.Get("SpamFilterBlocked").Value, ChatMessageType.Server, null);
|
||||
c.ChatSpamTimer = 10.0f;
|
||||
|
||||
@@ -378,7 +378,7 @@ namespace Barotrauma.Networking
|
||||
Character character = Character.CharacterList[i];
|
||||
if (character.IsDead || !character.ClientDisconnected) { continue; }
|
||||
|
||||
if (!GameMain.LuaCs.game.disableDisconnectCharacter)
|
||||
if (!GameMain.LuaCs.Game.disableDisconnectCharacter)
|
||||
{
|
||||
character.KillDisconnectedTimer += deltaTime;
|
||||
character.SetStun(1.0f);
|
||||
@@ -700,7 +700,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
ClientPacketHeader header = (ClientPacketHeader)inc.ReadByte();
|
||||
|
||||
GameMain.LuaCs.networking.NetMessageReceived(inc, header, connectedClient);
|
||||
GameMain.LuaCs.Networking.NetMessageReceived(inc, header, connectedClient);
|
||||
|
||||
switch (header)
|
||||
{
|
||||
@@ -2429,7 +2429,7 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
if (!(GameMain.GameSession?.GameMode is CampaignMode))
|
||||
{
|
||||
if (!GameMain.LuaCs.game.overrideTraitors)
|
||||
if (!GameMain.LuaCs.Game.overrideTraitors)
|
||||
{
|
||||
TraitorManager = new TraitorManager();
|
||||
TraitorManager.Start(this);
|
||||
@@ -3133,7 +3133,7 @@ namespace Barotrauma.Networking
|
||||
senderName = null;
|
||||
senderCharacter = null;
|
||||
}
|
||||
else if (type == ChatMessageType.Radio && !GameMain.LuaCs.game.overrideSignalRadio)
|
||||
else if (type == ChatMessageType.Radio && !GameMain.LuaCs.Game.overrideSignalRadio)
|
||||
{
|
||||
//send to chat-linked wifi components
|
||||
Signal s = new Signal(message, sender: senderCharacter, source: senderRadio.Item);
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Barotrauma.Networking
|
||||
MultiPlayerCampaign campaign = GameMain.GameSession.GameMode as MultiPlayerCampaign;
|
||||
foreach (Client c in networkMember.ConnectedClients)
|
||||
{
|
||||
if (GameMain.LuaCs.game.overrideRespawnSub)
|
||||
if (GameMain.LuaCs.Game.overrideRespawnSub)
|
||||
continue;
|
||||
|
||||
if (!c.InGame) { continue; }
|
||||
@@ -125,7 +125,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
private bool ShouldStartRespawnCountdown(int characterToRespawnCount)
|
||||
{
|
||||
if (GameMain.LuaCs.game.overrideRespawnSub)
|
||||
if (GameMain.LuaCs.Game.overrideRespawnSub)
|
||||
{
|
||||
characterToRespawnCount = 0;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
if (RespawnShuttle != null)
|
||||
{
|
||||
if (!GameMain.LuaCs.game.overrideRespawnSub)
|
||||
if (!GameMain.LuaCs.Game.overrideRespawnSub)
|
||||
{
|
||||
RespawnShuttle.Velocity = Vector2.Zero;
|
||||
}
|
||||
@@ -185,7 +185,7 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
if (RespawnShuttle != null)
|
||||
{
|
||||
if (GameMain.LuaCs.game.overrideRespawnSub)
|
||||
if (GameMain.LuaCs.Game.overrideRespawnSub)
|
||||
{
|
||||
CurrentState = State.Waiting;
|
||||
}
|
||||
@@ -206,7 +206,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
Vector2 spawnPos = FindSpawnPos();
|
||||
|
||||
if (!GameMain.LuaCs.game.overrideRespawnSub)
|
||||
if (!GameMain.LuaCs.Game.overrideRespawnSub)
|
||||
{
|
||||
RespawnCharacters(spawnPos);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user