示例#1
0
 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);
     }
 }
示例#2
0
 private static void PrepareChunks(HashSet <int> dirtiedPackedTileCoords)
 {
     foreach (KeyValuePair <Point, NetLiquidModule.ChunkChanges> changesByChunkCoord in NetLiquidModule._changesByChunkCoords)
     {
         changesByChunkCoord.Value.DirtiedPackedTileCoords.Clear();
     }
     NetLiquidModule.DistributeChangesIntoChunks(dirtiedPackedTileCoords);
 }
示例#3
0
 private static void PrepareAndSendToEachPlayerSeparately()
 {
     for (int index = 0; index < 256; ++index)
     {
         if (Netplay.Clients[index].IsConnected())
         {
             NetManager.Instance.SendToClient(NetLiquidModule.SerializeForPlayer(index), index);
         }
     }
 }
示例#4
0
 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);
     }
 }
示例#5
0
 public static void CreateAndBroadcastByChunk(HashSet <int> dirtiedPackedTileCoords)
 {
     NetLiquidModule.PrepareChunks(dirtiedPackedTileCoords);
     NetLiquidModule.PrepareAndSendToEachPlayerSeparately();
 }
示例#6
0
 private static void BroadcastAllChanges(HashSet <int> dirtiedPackedTileCoords)
 {
     NetManager.Instance.Broadcast(NetLiquidModule.Serialize(dirtiedPackedTileCoords), -1);
 }