예제 #1
0
    public void SendUnitTargetSkillUseOperate(short skillId, int unitId)
    {
        RqBattleInstruction rqInstruction = new RqBattleInstruction();

        rqInstruction.instruction = new BattleUnitTargetSkill(unitId, skillId);
        GameMain.Instance.SocketMgr.SendMessage(RqId.BattleInstruction, rqInstruction);
    }
예제 #2
0
    public void SendAreaUseSkillOperate(short skillId, short angle, int param1)
    {
        RqBattleInstruction rqInstruction = new RqBattleInstruction();

        rqInstruction.instruction = new BattleAreaTargetSkill(skillId, angle, param1);
        GameMain.Instance.SocketMgr.SendMessage(RqId.BattleInstruction, rqInstruction);
    }
예제 #3
0
    public void StopMoveOperate()
    {
        Logger.LogInfo("发送停止移动");
        RqBattleInstruction rqInstruction = new RqBattleInstruction();

        rqInstruction.instruction = new BattleStopMove();
        GameMain.Instance.SocketMgr.SendMessage(RqId.BattleInstruction, rqInstruction);
    }
예제 #4
0
    public void SendMoveOperate(short angle)
    {
        Logger.LogInfo("发送移动角度 " + angle);
        RqBattleInstruction rqInstruction = new RqBattleInstruction();

        rqInstruction.instruction = new BattleMove(angle);
        GameMain.Instance.SocketMgr.SendMessage(RqId.BattleInstruction, rqInstruction);
    }
예제 #5
0
        public static void OnOperateRequest(MyPeer peer, OperationRequest operationRequest)
        {
            LBPlayer curPlayer = LBPlayerManager.Instance.GetPlayerByConnectionId(peer.ConnectionId);

            if (curPlayer == null)
            {
                //LBLogger.Error("RqBattleInstructionHandler", "玩家没有登录");
                return;
            }
            byte[] byteArray = RqBattleInstruction.Deserialization(operationRequest.Parameters);
            int    index     = 0;
            BattleInstructionBase battleInstruction = BattleInstructionBase.Deserializetion(byteArray, ref index);

            if (null == battleInstruction)
            {
                LBLogger.Error("RqBattleInstructionHandler", "消息解析失败");
                return;
            }
            LBSceneManager.Instance.PlayerBattleInstruction(curPlayer.PlayerId, battleInstruction);
        }