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?
This commit is contained in:
parent
b936276fa2
commit
2da0c24875
|
@ -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<int> playerBag = (ConcurrentBag<int>)c.Metadata["shineSync"]!;
|
||||
shineBag.Add(shinePacket.ShineId);
|
||||
|
|
Loading…
Reference in New Issue