Beispiel #1
0
        public void Handle(MovePacket packet, PacketSession peerSession)
        {
            var targetObject = _context.GetGameObjecct(packet.ObjectId);

            if (targetObject == null)
            {
                return;
            }

            targetObject.Position  = packet.CurrentPoint;
            targetObject.MoveState = packet.State;
            targetObject.Direction = packet.Direction;

            // 다른 유저들에게 해당 유저가 움직인다는 사실을 알려준다.
            _context.BroadcastPacket(targetObject.ToMovePacket(), peerSession);
        }