mirror of
https://github.com/Sanae6/SmoOnlineServer.git
synced 2024-11-22 03:05:16 +00:00
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
a0642e6a30
commit
47fc1527bf
1 changed files with 1 additions and 0 deletions
|
@ -172,6 +172,7 @@ server.PacketHandler = (c, p) => {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ShinePacket shinePacket: {
|
case ShinePacket shinePacket: {
|
||||||
|
if (!Settings.Instance.Shines.Enabled) return false;
|
||||||
if (c.Metadata["loadedSave"] is false) break;
|
if (c.Metadata["loadedSave"] is false) break;
|
||||||
ConcurrentBag<int> playerBag = (ConcurrentBag<int>)c.Metadata["shineSync"]!;
|
ConcurrentBag<int> playerBag = (ConcurrentBag<int>)c.Metadata["shineSync"]!;
|
||||||
shineBag.Add(shinePacket.ShineId);
|
shineBag.Add(shinePacket.ShineId);
|
||||||
|
|
Loading…
Reference in a new issue