Exemplo n.º 1
0
 public static new Packet FromNetBuffer(NetIncomingMessage incomingMessage)
 {
     var result =
         (GameMap) SerializationHelper.ByteArrayToObject(incomingMessage.ReadBytes(incomingMessage.ReadInt32()));
     var id = incomingMessage.ReadUInt64();
     var packet = new SendMapPacket(result, id);
     return packet;
 }
Exemplo n.º 2
0
 private void SendMapTo(NetConnection connection)
 {
     var id = _characterMap[connection].ID;
     var packet = new SendMapPacket(GameMap, id);
     ClientNetworkManager.Instance.SendPacket(packet, connection);
 }
Exemplo n.º 3
0
 private void RecievedMap(SendMapPacket obj)
 {
     // Setup
     Camera2D.SetWorldSize(obj.Map.Layers[0].Width, obj.Map.Layers[0].Height);
     _tileMapRenderer = new TileMapRenderer(this, obj.Map);
     GameGlobals.EntityID = obj.PlayerId;
     networkInput.Initialize();
 }