protected override void ConsumePacket(Connection connection, PlayerPositionPacket packet)
        {
            var player = _entitySet.Get(packet.SteamId);

            if (player == null)
            {
                return;
            }

            player.X = packet.X;
            player.Y = packet.Y;
        }
示例#2
0
        protected override void ConsumePacket(Connection connection, PlayerMovePacket packet)
        {
            var player = _entitySet.Get(packet.SteamId);

            if (player == null)
            {
                return;
            }

            player.XDirection      = packet.XDirection;
            player.FacingDirection = packet.XDirection != 0 ? packet.XDirection : player.FacingDirection;
        }
示例#3
0
        protected override void ConsumePacket(Connection connection, JumpPacket packet)
        {
            var player = _entitySet.Get(packet.SteamId);

            if (player == null)
            {
                return;
            }

            var jumpComponent = player.GetComponent <JumpComponent>();

            if (packet.IsStopping)
            {
                jumpComponent.EndJump();
            }
            else
            {
                jumpComponent.BeginJump();
            }
        }
示例#4
0
 public TEntityDto Get(EntityId id)
 {
     return(_converter.Invoke(_source.Get(id)));
 }