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; }
private void SendMapTo(NetConnection connection) { var id = _characterMap[connection].ID; var packet = new SendMapPacket(GameMap, id); ClientNetworkManager.Instance.SendPacket(packet, connection); }
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(); }