diff --git a/Fika.Core/Networking/FikaClient.cs b/Fika.Core/Networking/FikaClient.cs index dd21643c..17d71159 100644 --- a/Fika.Core/Networking/FikaClient.cs +++ b/Fika.Core/Networking/FikaClient.cs @@ -575,14 +575,6 @@ private void OnInformationPacketReceived(InformationPacket packet) ConnectedClients = packet.NumberOfPlayers; ReadyClients = packet.ReadyPlayers; } - if (packet.ForceStart) - { - CoopGame coopGame = (CoopGame)Singleton.Instance; - if (coopGame != null) - { - coopGame.forceStart = true; - } - } } private void OnAllCharacterRequestPacketReceived(AllCharacterRequestPacket packet) diff --git a/Fika.Core/Networking/FikaServer.cs b/Fika.Core/Networking/FikaServer.cs index 2d410a11..4e49f296 100644 --- a/Fika.Core/Networking/FikaServer.cs +++ b/Fika.Core/Networking/FikaServer.cs @@ -431,13 +431,10 @@ private void OnInformationPacketReceived(InformationPacket packet, NetPeer peer) { ReadyClients += packet.ReadyPlayers; - CoopGame coopGame = (CoopGame)Singleton.Instance; - InformationPacket respondPackage = new(false) { NumberOfPlayers = _netServer.ConnectedPeersCount, ReadyPlayers = ReadyClients, - ForceStart = coopGame.forceStart }; _dataWriter.Reset(); diff --git a/Fika.Core/Networking/Open.Nat/Utils/Extensions.cs b/Fika.Core/Networking/Open.Nat/Utils/Extensions.cs index a5c2a795..b16acbbe 100644 --- a/Fika.Core/Networking/Open.Nat/Utils/Extensions.cs +++ b/Fika.Core/Networking/Open.Nat/Utils/Extensions.cs @@ -151,7 +151,9 @@ public static async Task TimeoutAfter(this Task task, #if DEBUG return await task; #endif +#pragma warning disable CS0162 // Unreachable code detected var timeoutCancellationTokenSource = new CancellationTokenSource(); +#pragma warning restore CS0162 // Unreachable code detected Task completedTask = await Task.WhenAny(task, Task.Delay(timeout, timeoutCancellationTokenSource.Token)); if (completedTask == task) diff --git a/Fika.Core/Networking/Packets/Backend/InformationPacket.cs b/Fika.Core/Networking/Packets/Backend/InformationPacket.cs index f60fafae..3868c8a7 100644 --- a/Fika.Core/Networking/Packets/Backend/InformationPacket.cs +++ b/Fika.Core/Networking/Packets/Backend/InformationPacket.cs @@ -9,7 +9,6 @@ public struct InformationPacket(bool isRequest) : INetSerializable public bool IsRequest = isRequest; public int NumberOfPlayers = 0; public int ReadyPlayers = 0; - public bool ForceStart = false; public void Deserialize(NetDataReader reader) @@ -17,7 +16,6 @@ public void Deserialize(NetDataReader reader) IsRequest = reader.GetBool(); NumberOfPlayers = reader.GetInt(); ReadyPlayers = reader.GetInt(); - ForceStart = reader.GetBool(); } public void Serialize(NetDataWriter writer) @@ -25,7 +23,6 @@ public void Serialize(NetDataWriter writer) writer.Put(IsRequest); writer.Put(NumberOfPlayers); writer.Put(ReadyPlayers); - writer.Put(ForceStart); } } }