Exemple #1
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_SYNC_STORYCOPYSCENEAWARDINFO packet = (GC_SYNC_STORYCOPYSCENEAWARDINFO )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            GameManager.gameManager.PlayerDataPool.JuQingCopySceneData.HandlePacket(packet);
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
        public void HandlePacket(GC_SYNC_STORYCOPYSCENEAWARDINFO packet)
        {
            for (int i = 0; i < packet.nStoryCopySceneChapterIDCount; i++)
            {
                StoryCopySceneChapterInfo info;
                info.m_nID = packet.GetNStoryCopySceneChapterID(i);
                if (info.m_nID <= 0)
                {
                    continue;
                }

                info.m_bAwardGot = new List <bool>();
                for (int j = i * ChapterLevelNum; j < (i + 1) * ChapterLevelNum && j < packet.nAwardGotCount; j++)
                {
                    info.m_bAwardGot.Add(packet.nAwardGotList[j] == 1);
                }

                info.m_bLevelAwardGot = new List <bool>();
                for (int j = i * (ChapterLevelNum - 1); j < (i + 1) * (ChapterLevelNum - 1) && j < packet.LevelAwardGotCount; j++)
                {
                    info.m_bLevelAwardGot.Add(packet.LevelAwardGotList[j] == 1);
                }

                info._ContaindLevelList = new List <int>();
                var storyCopySceneDic = TableManager.GetStoryCopyScene();
                foreach (var pair in storyCopySceneDic)
                {
                    if (pair.Value != null && pair.Value.Count != 0 && pair.Value[0].BelongToChapterID == info.m_nID)
                    {
                        info._ContaindLevelList.Add(pair.Value[0].Id);
                    }
                }
                m_ChapterInfoDic[info.m_nID] = info;
            }
            // 通知界面
            Messenger.Broadcast(MessengerConst.OnUpdateJuQingCopySceneChapterInfo);
        }