Ejemplo n.º 1
0
 private static void WaitForBlockVacancy(long index, int x, int y)
 {
     while (map[x, y] > -1)
     {
         Console.WriteLine("waiting for free block at: " + map[x, y]);
         Thread.Sleep(500);
     }
     //send unblock to tile x,y
     SwayTCP.Clients[index]._player._blockages.Remove(new KeyValuePair <int, int>(x, y));
     SwayTCP.SendUnblock(index, x, y);
 }
        private static void Packet_CUnblock(long index, byte[] data)
        {
            ByteBuffer buffer = new ByteBuffer();

            buffer.WriteBytes(data);
            buffer.ReadLong();
            long opponentIndex = buffer.ReadLong();

            SwayStation.station.gameLogic.RemoveBlockHash(index, opponentIndex);
            int x = buffer.ReadInteger();
            int y = buffer.ReadInteger();

            SwayTCP.SendUnblock(opponentIndex, x, y);
        }