Skip to content

Commit 7df318a

Browse files
committed
Only send VR motion packets to players in the same ServerChunk
1 parent 917ef4b commit 7df318a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

TABGVR.Server/Patches/NetworkEventPatch.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ public static bool Prefix(ServerClient __instance, ServerPackage networkEvent)
4444

4545
byte[] message = [player.PlayerIndex, ..networkEvent.Buffer];
4646

47-
__instance.SendMessageToClients(networkEvent.Code, message, byte.MaxValue, true);
47+
var recipients = from watcher in ServerChunks.Instance.GetWatchers(player.ChunkData) select watcher.PlayerIndex;
48+
49+
__instance.SendMessageToClients(networkEvent.Code, message, recipients.ToArray(), true);
4850

4951
return false;
5052
default:

0 commit comments

Comments
 (0)