コード例 #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
ファイル: NetLiquidModule.cs プロジェクト: egshels/Sources
 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);
 }