Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 KB | None | 0 0
  1.                 case ClientMessageType.sensors_data:
  2.                     {
  3.                         int c = msg.ReadInt32();
  4.                         List<Ping> data = new List<Ping>(c);
  5.                         for (int i = 0; i < c; i++)
  6.                         {
  7.                             ulong id = msg.ReadUInt64();
  8.                             Point p = new Point(msg.ReadInt32(), msg.ReadInt32());
  9.                             Vector2 v = new Vector2(msg.ReadSingle(), msg.ReadSingle());
  10.                             Ping ping = new Ping();
  11.                             ping.id = id;
  12.                             ping.grid = p;
  13.                             ping.spot = v;
  14.                             if(factionMap.ContainsKey(id))
  15.                             {
  16.                                 ping.faction = factionMap[id];
  17.                             }
  18.                             if (occupancyMap.ContainsKey(id))
  19.                             {
  20.                                 ping.chatIDs = occupancyMap[id];
  21.                             }
  22.                             data.Add(ping);
  23.                         }
  24.                     }
  25.                     break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement