public void ReciveData(DataMap data) { if (data != null) { LastRecivedMap = data; foreach (string s in data.keys) { foreach (var a in clients.Where(a => a.Key == s || a.Key == s.Split(':')[0])) { a.Value.Update(data.GetData(s), data); } } } }
public void ReciveRaw(byte[] data) { try { Packet pdata = Serilizer.Desrilize <Packet>(data); DataMap dmap = Serilizer.Desrilize <DataMap>(pdata.data); dmap.AddData("GameState:PSize", pdata.length); dmap.AddData("GameState:Packet", "PacketSize: " + data.Length); dmap.AddData("GameState:FreePacket", "PacketFree: " + (data.Length - pdata.length)); ReciveData(dmap); } catch (Exception e) { LastRecivedMap.AddData("GameState:Exception", e.Message); ReciveData(LastRecivedMap); } }
public void CreateNewMap() { currentMap = new DataMap(); }