Esempio n. 1
0
        private void OnReceivedTcpMessage(object sender, TcpPacketEventArgs e)
        {
            switch (e.ByteBuffer.Code)
            {
            case 0:
                Id = e.ByteBuffer.ReadGuid();
                Game.Instance.TargetUpdateFrequency = e.ByteBuffer.ReadInt32();

                var boxes = new List <AxisAlignedBB>();

                var count = e.ByteBuffer.ReadInt32();

                for (int i = 0; i < count; i++)
                {
                    var min = e.ByteBuffer.ReadVec2();
                    var max = e.ByteBuffer.ReadVec2();

                    boxes.Add(new AxisAlignedBB(min, max));
                }

                Game.Instance.Map.LoadBBs(boxes);

                break;

            case 1:
                //teleport to position
                var pos = e.ByteBuffer.ReadVec2();

                Game.Instance.Player.TeleportTo(pos);
                break;
            }
        }
Esempio n. 2
0
 private void OnReceivedTcpMessage(object s, TcpPacketEventArgs e)
 {
     //todo might use
 }