private static void BroadcastEachChunkSeparately() { foreach (KeyValuePair <Point, NetLiquidModule.ChunkChanges> changesByChunkCoord in NetLiquidModule._changesByChunkCoords) { NetManager.Instance.Broadcast(NetLiquidModule.Serialize(changesByChunkCoord.Value.DirtiedPackedTileCoords), new NetManager.BroadcastCondition(changesByChunkCoord.Value.BroadcastingCondition), -1); } }
private static void PrepareChunks(HashSet <int> dirtiedPackedTileCoords) { foreach (KeyValuePair <Point, NetLiquidModule.ChunkChanges> changesByChunkCoord in NetLiquidModule._changesByChunkCoords) { changesByChunkCoord.Value.DirtiedPackedTileCoords.Clear(); } NetLiquidModule.DistributeChangesIntoChunks(dirtiedPackedTileCoords); }
private static void PrepareAndSendToEachPlayerSeparately() { for (int index = 0; index < 256; ++index) { if (Netplay.Clients[index].IsConnected()) { NetManager.Instance.SendToClient(NetLiquidModule.SerializeForPlayer(index), index); } } }
public static void CreateAndBroadcastByChunk(HashSet <int> dirtiedPackedTileCoords) { foreach (KeyValuePair <Point, NetLiquidModule.ChunkChanges> changesByChunkCoord in NetLiquidModule._changesByChunkCoords) { changesByChunkCoord.Value.DirtiedPackedTileCoords.Clear(); } NetLiquidModule.DistributeChangesIntoChunks(dirtiedPackedTileCoords); foreach (KeyValuePair <Point, NetLiquidModule.ChunkChanges> changesByChunkCoord in NetLiquidModule._changesByChunkCoords) { NetManager.Instance.Broadcast(NetLiquidModule.Serialize(changesByChunkCoord.Value.DirtiedPackedTileCoords), new NetManager.BroadcastCondition(changesByChunkCoord.Value.BroadcastingCondition), -1); } }
public static void CreateAndBroadcastByChunk(HashSet <int> dirtiedPackedTileCoords) { NetLiquidModule.PrepareChunks(dirtiedPackedTileCoords); NetLiquidModule.PrepareAndSendToEachPlayerSeparately(); }
private static void BroadcastAllChanges(HashSet <int> dirtiedPackedTileCoords) { NetManager.Instance.Broadcast(NetLiquidModule.Serialize(dirtiedPackedTileCoords), -1); }