コード例 #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;
 }
コード例 #2
0
ファイル: MapSimulator.cs プロジェクト: hilts-vaughan/inspire
 private void SendMapTo(NetConnection connection)
 {
     var id = _characterMap[connection].ID;
     var packet = new SendMapPacket(GameMap, id);
     ClientNetworkManager.Instance.SendPacket(packet, connection);
 }
コード例 #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();
 }