Exemplo n.º 1
0
        public bool ReadAllTitleInvestitive(GC_UPDATE_ALL_TITLEINVESTITIVE rData)
        {
            // 读取服务器的同步数据 其中TitleID索引是0~40 UserDefFullTitleName是自定义称号特有 索引为0~7
            bool bRet = false;

            if (rData.TitleIDCount == rData.TitleIndexCount)
            {
                for (int i = 0, j = 0; i < rData.TitleIDCount; i++)
                {
                    if (rData.TitleIndexList[i] >= 0 && rData.TitleIndexList[i] < (int)TITLE_SIZE.USERDEF_START)
                    {
                        m_SystemTitle[rData.TitleIndexList[i]].TitleID  = rData.TitleIDList[i];
                        m_SystemTitle[rData.TitleIndexList[i]].GainTime = rData.GainTimeList[i];
                    }
                    else if (rData.TitleIndexList[i] >= (int)TITLE_SIZE.USERDEF_START && rData.TitleIndexList[i] < (int)TITLE_SIZE.TITLE_TOTAL)
                    {
                        if (j >= rData.UserDefFullTitleNameCount)
                        {
                            break;
                        }

                        m_UserDefTitle[rData.TitleIndexList[i] - (int)TITLE_SIZE.USERDEF_START].TitleID  = rData.TitleIDList[i];
                        m_UserDefTitle[rData.TitleIndexList[i] - (int)TITLE_SIZE.USERDEF_START].GainTime = rData.GainTimeList[i];
                        // 自定义内容特殊索引
                        m_UserDefTitle[rData.TitleIndexList[i] - (int)TITLE_SIZE.USERDEF_START].StrFullTitleName = rData.UserDefFullTitleNameList[j];

                        j++;
                    }
                }
                m_ActiveTitle = rData.ActiveTitle;
                bRet          = true;
            }
            return(bRet);
        }
Exemplo n.º 2
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_UPDATE_ALL_TITLEINVESTITIVE packet = (GC_UPDATE_ALL_TITLEINVESTITIVE )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            GameManager.gameManager.PlayerDataPool.TitleInvestitive.ReadAllTitleInvestitive(packet);
            GameManager.gameManager.PlayerDataPool.IsLockPriorTitle = packet.IsLockTitle == 1 ? true : false;
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }