예제 #1
0
 void WD_parser(PlayerIOClient.Message m, uint c)
 {
     bl = new int[2][][];
     for (int l = 0; l < 2; l++)
     {
         bl[l] = new int[worldWidth][];
         for (int x = 0; x < worldWidth; x++)
         {
             bl[l][x] = new int[worldHeight];
         }
     }
     while (c < m.Count)
     {
         int    bid = m.GetInt(c);
         int    l   = m.GetInt(c + 1);
         byte[] pX  = m.GetByteArray(c + 2);
         byte[] pY  = m.GetByteArray(c + 3);
         for (int n = 0; n < pX.Length; n += 2)
         {
             int x = pX[n] << 8 | pX[n + 1],
                 y = pY[n] << 8 | pY[n + 1];
             bl[l][x][y] = bid;
         }
         if (bid == 43 || bid == 77 || bid == 83 || bid == 1000)
         {
             c += 5;
         }
         else if (bid == 242)
         {
             c += 7;
         }
         else
         {
             c += 4;
         }
     }
 }