Beispiel #1
0
    internal static void OnMoveStart(object msg, NetConnection conn, NetworkSystem networkSystem)
    {
        Msg_CRC_MoveStart move_msg = msg as Msg_CRC_MoveStart;

        if (null == move_msg)
        {
            return;
        }
    }
Beispiel #2
0
    internal static void OnMoveStart(object msg, RoomPeer peer)
    {
        Msg_CRC_MoveStart move_msg = msg as Msg_CRC_MoveStart;

        if (null == move_msg)
        {
            return;
        }
        move_msg.role_id = peer.RoleId;
        peer.BroadCastMsgToCareList(move_msg);
    }
Beispiel #3
0
        internal static void OnMoveStart(object msg, User user)
        {
            Msg_CRC_MoveStart move_msg = msg as Msg_CRC_MoveStart;

            if (null == move_msg)
            {
                return;
            }

            var msi = user.Info.GetMovementStateInfo();

            msi.SetMoveDir(move_msg.dir);
            Scene scene = user.OwnRoom.GetActiveScene();

            if (null != scene)
            {
                //scene.ControlSystemOperation.AdjustCharacterMoveDir(user.RoleId, move_msg.dir);
            }
            msi.StartMove();

            if (!msi.IsSkillMoving)
            {
                float x        = move_msg.position.x;
                float z        = move_msg.position.z;
                float velocity = (float)user.Info.GetActualProperty().MoveSpeed;
                if (!user.VerifyPosition(x, z, velocity, move_msg.send_time, 4.0f))
                {
                    //todo:记录违规次数
                }
                msi.SetPosition2D(x, z);

                user.SampleMoveData(x, z, velocity, msi.MoveDirCosAngle, msi.MoveDirSinAngle, move_msg.send_time);
            }

            user.LastIsMoving = true;
            //LogSys.Log(LOG_TYPE.DEBUG, "MoveStart User:{0} dir:{1} isskillmoving:{2} ismovemeetobstacle:{3} time:{4} client time:{5}", user.RoleId, move_msg.dir, msi.IsSkillMoving, msi.IsMoveMeetObstacle, TimeUtility.GetServerMilliseconds(), move_msg.send_time);
        }