Exemplo n.º 1
0
    void SendLeaveCopySceneMsg()
    {
        CG_LEAVE_COPYSCENE packet = (CG_LEAVE_COPYSCENE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_LEAVE_COPYSCENE);

        packet.NoParam = -1;
        packet.SendPacket();
    }
Exemplo n.º 2
0
    void OnCliclLevel()
    {
        CG_LEAVE_COPYSCENE packet = (CG_LEAVE_COPYSCENE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_LEAVE_COPYSCENE);

        packet.NoParam = -1;
        packet.SendPacket();
    }
    public static PacketDistributed CreatePacket(MessageID packetID)
    {
        PacketDistributed packet = null;

        switch (packetID)
        {
        case MessageID.PACKET_CG_CHAT: { packet = new CG_CHAT(); } break;

        case MessageID.PACKET_CG_CONNECTED_HEARTBEAT: { packet = new CG_CONNECTED_HEARTBEAT(); } break;

        case MessageID.PACKET_CG_FIGHT: { packet = new CG_FIGHT(); } break;

        case MessageID.PACKET_CG_LEAVE_COPYSCENE: { packet = new CG_LEAVE_COPYSCENE(); } break;

        case MessageID.PACKET_CG_LOGIN: { packet = new CG_LOGIN(); } break;

        case MessageID.PACKET_CG_MOVE: { packet = new CG_MOVE(); } break;

        case MessageID.PACKET_CG_REQ_NEAR_LIST: { packet = new CG_REQ_NEAR_LIST(); } break;

        case MessageID.PACKET_GC_ATTACKFLY: { packet = new GC_ATTACKFLY(); } break;

        case MessageID.PACKET_GC_CHAT: { packet = new GC_CHAT(); } break;

        case MessageID.PACKET_GC_CONNECTED_HEARTBEAT: { packet = new GC_CONNECTED_HEARTBEAT(); } break;

        case MessageID.PACKET_GC_DELETE_OBJ: { packet = new GC_DELETE_OBJ(); } break;

        case MessageID.PACKET_GC_FORCE_SETPOS: { packet = new GC_FORCE_SETPOS(); } break;

        case MessageID.PACKET_GC_LOGIN_RET: { packet = new GC_LOGIN_RET(); } break;

        case MessageID.PACKET_GC_MOVE: { packet = new GC_MOVE(); } break;

        case MessageID.PACKET_GC_NEAR_MARCHLIST: { packet = new GC_NEAR_MARCHLIST(); } break;

        case MessageID.PACKET_GC_NOTICE: { packet = new GC_NOTICE(); } break;

        case MessageID.PACKET_GC_PLAY_EFFECT: { packet = new GC_PLAY_EFFECT(); } break;

        case MessageID.PACKET_GC_REMOVEEFFECT: { packet = new GC_REMOVEEFFECT(); } break;

        case MessageID.PACKET_GC_RET_USE_SKILL: { packet = new GC_RET_USE_SKILL(); } break;

        case MessageID.PACKET_GC_STOP: { packet = new GC_STOP(); } break;

        case MessageID.PACKET_GC_TELEMOVE: { packet = new GC_TELEMOVE(); } break;

        case MessageID.PACKET_GC_UPDATE_ANIMATION_STATE: { packet = new GC_UPDATE_ANIMATION_STATE(); } break;

        case MessageID.PACKET_GC_UPDATE_NEEDIMPACTINFO: { packet = new GC_UPDATE_NEEDIMPACTINFO(); } break;

        case MessageID.PACKET_GC_UPDATE_SCENE_INSTACTIVATION: { packet = new GC_UPDATE_SCENE_INSTACTIVATION(); } break;
        }
        if (null != packet)
        {
            packet.packetID = packetID;
        }
        return(packet);
    }
Exemplo n.º 4
0
    public void SendLeaveCopyScene()
    {
        // 副本场景直接发包返回副本前场景 不查表
        CG_LEAVE_COPYSCENE packet = (CG_LEAVE_COPYSCENE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_LEAVE_COPYSCENE);

        packet.NoParam = -1;
        packet.SendPacket();
    }
Exemplo n.º 5
0
        public uint Execute(PacketDistributed ipacket)
        {
            CG_LEAVE_COPYSCENE packet = (CG_LEAVE_COPYSCENE )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Exemplo n.º 6
0
    public void OnLeaveCopySceneOK()
    {
        if (GameManager.gameManager.PlayerDataPool.CopySceneChange)         //正在传送中
        {
            return;
        }
        GameManager.gameManager.PlayerDataPool.CopySceneChange = true;
        CG_LEAVE_COPYSCENE packet = (CG_LEAVE_COPYSCENE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_LEAVE_COPYSCENE);

        packet.NoParam = 1;
        packet.SendPacket();
    }
    void CloseWindow()
    {
        if (m_bIsNeedSendLevelCopySceneMsg)
        {
            CG_LEAVE_COPYSCENE packet = (CG_LEAVE_COPYSCENE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_LEAVE_COPYSCENE);
            packet.NoParam = -1;
            packet.SendPacket();
        }
        else
        {
            Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

            if (_mainPlayer != null && _mainPlayer.IsDie())
            {
                SendPlayerReliveMsg();
            }
        }
        UIManager.CloseUI(UIInfo.StoryCopySceneResultRoot);
    }
Exemplo n.º 8
0
    void ChallengeOkCallBack()
    {
        switch (ChallengeRewardLogic.RewardType)
        {
        case 0:
            HandleClickChallengeOk();
            SendLeaveCopySceneMsg();
//                 if (GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_WUDAOZHIDIAN)
//                 {// 副本场景直接发包返回副本前场景 不查表
//                     CG_LEAVE_COPYSCENE packet = (CG_LEAVE_COPYSCENE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_LEAVE_COPYSCENE);
//                     packet.NoParam = -1;
//                     packet.SendPacket();
//                 }
            break;

        case 1:
            if (GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_HUASHANLUNJIAN)
            {    // 副本场景直接发包返回副本前场景 不查表
                CG_LEAVE_COPYSCENE packet = (CG_LEAVE_COPYSCENE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_LEAVE_COPYSCENE);
                packet.NoParam = -1;
                packet.SendPacket();
            }
            break;

        case 2:
            if (GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_RICHANGJUEDOU)
            {    // 副本场景直接发包返回副本前场景 不查表
                CG_LEAVE_COPYSCENE packet = (CG_LEAVE_COPYSCENE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_LEAVE_COPYSCENE);
                packet.NoParam = -1;
                packet.SendPacket();
            }
            break;

        default:
            break;
        }
        ;

        UIManager.CloseUI(UIInfo.ChallengeRewardRoot);
    }
Exemplo n.º 9
0
 public void OnQuitCopyScene()
 {
     CG_LEAVE_COPYSCENE packet = (CG_LEAVE_COPYSCENE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_LEAVE_COPYSCENE);
     packet.NoParam = 1;
     packet.SendPacket();
 }
Exemplo n.º 10
0
        public void UpdateAuto()
        {
            float ftimeSec  = Time.realtimeSinceStartup;
            int   nTimeData = (int)(ftimeSec - m_fAutoTimeSecond);

            if (nTimeData > 0)
            {
                m_fAutoTimeSecond = ftimeSec;
                if (ExitTime > 0)
                {
                    ExitTime = ExitTime - nTimeData;

                    if (ExitTime <= 0)
                    {
                        if (GameManager.gameManager.PlayerDataPool.CopySceneChange) //正在传送中
                        {
                            return;
                        }
                        GameManager.gameManager.PlayerDataPool.CopySceneChange = true;
                        CG_LEAVE_COPYSCENE packet = (CG_LEAVE_COPYSCENE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_LEAVE_COPYSCENE);
                        packet.NoParam = 1;
                        packet.SendPacket();
                    }
                    else
                    {
                        SendNoticMsg(false, "#{2227}", ExitTime);
                    }
                }
                if (GameManager.gameManager.PlayerDataPool.CJGSweepCDTime > 0)
                {
                    GameManager.gameManager.PlayerDataPool.CJGSweepCDTime = GameManager.gameManager.PlayerDataPool.CJGSweepCDTime - nTimeData;
                    if (GameManager.gameManager.PlayerDataPool.CJGSweepCDTime < 0)
                    {
                        GameManager.gameManager.PlayerDataPool.CJGSweepCDTime = 0;
                    }
                }
                if (GameManager.gameManager.PlayerDataPool.CopyeSceneSweepCDTime > 0)
                {
                    GameManager.gameManager.PlayerDataPool.CopyeSceneSweepCDTime = GameManager.gameManager.PlayerDataPool.CopyeSceneSweepCDTime - nTimeData;
                    if (GameManager.gameManager.PlayerDataPool.CopyeSceneSweepCDTime < 0)
                    {
                        GameManager.gameManager.PlayerDataPool.CopyeSceneSweepCDTime = 0;
                    }
                }
                if (GameManager.gameManager.PlayerDataPool.HpItemCDTime > 0)
                {
                    GameManager.gameManager.PlayerDataPool.HpItemCDTime = GameManager.gameManager.PlayerDataPool.HpItemCDTime - nTimeData * 1000.0f;
                    if (GameManager.gameManager.PlayerDataPool.HpItemCDTime < 0)
                    {
                        GameManager.gameManager.PlayerDataPool.HpItemCDTime = 0;
                    }
                }
                if (GameManager.gameManager.PlayerDataPool.MpItemCDTime > 0)
                {
                    GameManager.gameManager.PlayerDataPool.MpItemCDTime = GameManager.gameManager.PlayerDataPool.MpItemCDTime - nTimeData * 1000.0f;
                    if (GameManager.gameManager.PlayerDataPool.MpItemCDTime < 0)
                    {
                        GameManager.gameManager.PlayerDataPool.MpItemCDTime = 0;
                    }
                }
            }
            //自动吃药
            if (IsDie() == false)
            {
                AutoUseHPMPDrug();
                //   OptMPChange();
            }

            //藏经阁扫荡CD时间
        }
Exemplo n.º 11
0
    public static PacketDistributed CreatePacket(MessageID packetID)
    {
        PacketDistributed packet = null;

        switch (packetID)
        {
        case MessageID.PACKET_CG_ASSIGN_HERO: { packet = new CG_ASSIGN_HERO(); } break;

        case MessageID.PACKET_CG_BATTLEINFOR: { packet = new CG_BATTLEINFOR(); } break;

        case MessageID.PACKET_CG_BATTLEPREPARE: { packet = new CG_BATTLEPREPARE(); } break;

        case MessageID.PACKET_CG_BUILDING_LEVELUP: { packet = new CG_Building_LevelUp(); } break;

        case MessageID.PACKET_CG_CHAT: { packet = new CG_CHAT(); } break;

        case MessageID.PACKET_CG_CONNECTED_HEARTBEAT: { packet = new CG_CONNECTED_HEARTBEAT(); } break;

        case MessageID.PACKET_CG_CREATEROLE: { packet = new CG_CREATEROLE(); } break;

        case MessageID.PACKET_CG_FIGHT: { packet = new CG_FIGHT(); } break;

        case MessageID.PACKET_CG_LEAVE_COPYSCENE: { packet = new CG_LEAVE_COPYSCENE(); } break;

        case MessageID.PACKET_CG_LOGIN: { packet = new CG_LOGIN(); } break;

        case MessageID.PACKET_CG_MARCH_MOVE: { packet = new CG_MARCH_MOVE(); } break;

        case MessageID.PACKET_CG_MOVE: { packet = new CG_MOVE(); } break;

        case MessageID.PACKET_CG_OBJPOSLIST: { packet = new CG_OBJPOSLIST(); } break;

        case MessageID.PACKET_CG_REQ_NEAR_LIST: { packet = new CG_REQ_NEAR_LIST(); } break;

        case MessageID.PACKET_CG_ROBOT_OPEN: { packet = new CG_ROBOT_OPEN(); } break;

        case MessageID.PACKET_CG_SEND_MARCH: { packet = new CG_SEND_MARCH(); } break;

        case MessageID.PACKET_CG_SKILL_USE: { packet = new CG_SKILL_USE(); } break;

        case MessageID.PACKET_CG_TROOP_TRAIN: { packet = new CG_Troop_Train(); } break;

        case MessageID.PACKET_GC_ASSIGN_HERO: { packet = new GC_ASSIGN_HERO(); } break;

        case MessageID.PACKET_GC_ATTACKFLY: { packet = new GC_ATTACKFLY(); } break;

        case MessageID.PACKET_GC_BATTLEEND: { packet = new GC_BATTLEEND(); } break;

        case MessageID.PACKET_GC_BATTLEINFOR: { packet = new GC_BATTLEINFOR(); } break;

        case MessageID.PACKET_GC_BATTLEPREPARE: { packet = new GC_BATTLEPREPARE(); } break;

        case MessageID.PACKET_GC_BATTLESTART: { packet = new GC_BattleStart(); } break;

        case MessageID.PACKET_GC_BUILDING_LEVELUP: { packet = new GC_Building_LevelUp(); } break;

        case MessageID.PACKET_GC_CHAT: { packet = new GC_CHAT(); } break;

        case MessageID.PACKET_GC_CONNECTED_HEARTBEAT: { packet = new GC_CONNECTED_HEARTBEAT(); } break;

        case MessageID.PACKET_GC_CREATEROLE_RET: { packet = new GC_CREATEROLE_RET(); } break;

        case MessageID.PACKET_GC_DELETE_OBJ: { packet = new GC_DELETE_OBJ(); } break;

        case MessageID.PACKET_GC_FIGHT: { packet = new GC_FIGHT(); } break;

        case MessageID.PACKET_GC_FORCE_SETPOS: { packet = new GC_FORCE_SETPOS(); } break;

        case MessageID.PACKET_GC_LOGIN_QUEUE_STATUS: { packet = new GC_LOGIN_QUEUE_STATUS(); } break;

        case MessageID.PACKET_GC_LOGIN_RET: { packet = new GC_LOGIN_RET(); } break;

        case MessageID.PACKET_GC_MARCH_MOVE: { packet = new GC_MARCH_MOVE(); } break;

        case MessageID.PACKET_GC_MOVE: { packet = new GC_MOVE(); } break;

        case MessageID.PACKET_GC_NEAR_MARCHLIST: { packet = new GC_NEAR_MARCHLIST(); } break;

        case MessageID.PACKET_GC_NOTICE: { packet = new GC_NOTICE(); } break;

        case MessageID.PACKET_GC_OBJCOMMANDPURSUE: { packet = new GC_OBJCOMMANDPURSUE(); } break;

        case MessageID.PACKET_GC_OBJGETHURT: { packet = new GC_OBJGETHURT(); } break;

        case MessageID.PACKET_GC_OBJPOSLIST: { packet = new GC_OBJPOSLIST(); } break;

        case MessageID.PACKET_GC_OBJPREPAREFORATTACK: { packet = new GC_OBJPREPAREFORATTACK(); } break;

        case MessageID.PACKET_GC_PLAY_EFFECT: { packet = new GC_PLAY_EFFECT(); } break;

        case MessageID.PACKET_GC_REMOVEEFFECT: { packet = new GC_REMOVEEFFECT(); } break;

        case MessageID.PACKET_GC_RET_USE_SKILL: { packet = new GC_RET_USE_SKILL(); } break;

        case MessageID.PACKET_GC_ROBOT_OPEN: { packet = new GC_ROBOT_OPEN(); } break;

        case MessageID.PACKET_GC_SEND_MARCH: { packet = new GC_SEND_MARCH(); } break;

        case MessageID.PACKET_GC_STOP: { packet = new GC_STOP(); } break;

        case MessageID.PACKET_GC_TELEMOVE: { packet = new GC_TELEMOVE(); } break;

        case MessageID.PACKET_GC_TROOPTRAIN_OVER: { packet = new GC_TroopTrain_Over(); } break;

        case MessageID.PACKET_GC_TROOP_TRAIN: { packet = new GC_Troop_Train(); } break;

        case MessageID.PACKET_GC_UPDATE_ANIMATION_STATE: { packet = new GC_UPDATE_ANIMATION_STATE(); } break;

        case MessageID.PACKET_GC_UPDATE_MARCH: { packet = new GC_Update_March(); } break;

        case MessageID.PACKET_GC_UPDATE_NEEDIMPACTINFO: { packet = new GC_UPDATE_NEEDIMPACTINFO(); } break;

        case MessageID.PACKET_GC_UPDATE_SCENE_INSTACTIVATION: { packet = new GC_UPDATE_SCENE_INSTACTIVATION(); } break;
        }
        if (null != packet)
        {
            packet.packetID = packetID;
        }
        return(packet);
    }