From 47fc1527bf72f066d671e954f77f7a0441d1b0ac Mon Sep 17 00:00:00 2001 From: "Robin C. Ladiges" Date: Mon, 7 Nov 2022 21:12:23 +0100 Subject: [PATCH] fix: don't process and broadcast shine packets when shine sync is disabled The breaks make the function return true, which causes the shine packets to be broadcasted to all connected clients. Returning false will prevent the broadcast of the current shine packet. Note: If shines are enabled, the clients will receive every shine twice. Once from the `SyncShineBag();` and then a second time from the default broadcast caused by the remaining breaks. We should probably replace every `break;` with `return false;` here? --- Server/Program.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Server/Program.cs b/Server/Program.cs index 37bce16..71c0f3c 100644 --- a/Server/Program.cs +++ b/Server/Program.cs @@ -172,6 +172,7 @@ server.PacketHandler = (c, p) => { break; case ShinePacket shinePacket: { + if (!Settings.Instance.Shines.Enabled) return false; if (c.Metadata["loadedSave"] is false) break; ConcurrentBag playerBag = (ConcurrentBag)c.Metadata["shineSync"]!; shineBag.Add(shinePacket.ShineId);