Example #1
0
 private void InitPerformanceTest()
 {
     for (int i = 0; i < this.MessageRef.astCampInfo.Length; i++)
     {
         CSDT_CAMPINFO          csdt_campinfo = this.MessageRef.astCampInfo[i];
         COMDT_HERO_COMMON_INFO stCommonInfo  = csdt_campinfo.astCampPlayerInfo[0].stPlayerInfo.astChoiceHero[0].stBaseInfo.stCommonInfo;
         uint   dwHeroID = stCommonInfo.dwHeroID;
         ushort wSkinID  = stCommonInfo.wSkinID;
         for (int j = 0; j < csdt_campinfo.dwPlayerNum; j++)
         {
             CSDT_CAMPPLAYERINFO csdt_campplayerinfo = csdt_campinfo.astCampPlayerInfo[j];
             if (csdt_campplayerinfo != null)
             {
                 for (int k = 0; k < csdt_campplayerinfo.stPlayerInfo.astChoiceHero.Length; k++)
                 {
                     COMDT_CHOICEHERO comdt_choicehero = csdt_campplayerinfo.stPlayerInfo.astChoiceHero[k];
                     if (comdt_choicehero != null)
                     {
                         comdt_choicehero.stBaseInfo.stCommonInfo.dwHeroID = dwHeroID;
                         comdt_choicehero.stBaseInfo.stCommonInfo.wSkinID  = wSkinID;
                     }
                 }
             }
         }
     }
 }
 private void InitPerformanceTest()
 {
     for (int i = 0; i < this.MessageRef.astCampInfo.Length; i++)
     {
         CSDT_CAMPINFO          cSDT_CAMPINFO = this.MessageRef.astCampInfo[i];
         COMDT_HERO_COMMON_INFO stCommonInfo  = cSDT_CAMPINFO.astCampPlayerInfo[0].stPlayerInfo.astChoiceHero[0].stBaseInfo.stCommonInfo;
         uint   dwHeroID = stCommonInfo.dwHeroID;
         ushort wSkinID  = stCommonInfo.wSkinID;
         int    num      = 0;
         while ((long)num < (long)((ulong)cSDT_CAMPINFO.dwPlayerNum))
         {
             CSDT_CAMPPLAYERINFO cSDT_CAMPPLAYERINFO = cSDT_CAMPINFO.astCampPlayerInfo[num];
             if (cSDT_CAMPPLAYERINFO != null)
             {
                 for (int j = 0; j < cSDT_CAMPPLAYERINFO.stPlayerInfo.astChoiceHero.Length; j++)
                 {
                     COMDT_CHOICEHERO cOMDT_CHOICEHERO = cSDT_CAMPPLAYERINFO.stPlayerInfo.astChoiceHero[j];
                     if (cOMDT_CHOICEHERO != null)
                     {
                         cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.dwHeroID = dwHeroID;
                         cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.wSkinID  = wSkinID;
                     }
                 }
             }
             num++;
         }
     }
 }
        private void BeginRecord(SCPKG_MULTGAME_BEGINLOAD beginLoadPkg)
        {
            this.ClearRecord();
            if (beginLoadPkg == null)
            {
                return;
            }
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .get_instance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return;
            }
            ApolloAccountInfo accountInfo = Singleton <ApolloHelper> .GetInstance().GetAccountInfo(false);

            if (accountInfo == null)
            {
                return;
            }
            uint num = 0u;

            for (int i = 0; i < beginLoadPkg.astCampInfo.Length; i++)
            {
                CSDT_CAMPINFO cSDT_CAMPINFO = beginLoadPkg.astCampInfo[i];
                for (uint num2 = 0u; num2 < cSDT_CAMPINFO.dwPlayerNum; num2 += 1u)
                {
                    CSDT_CAMPPLAYERINFO cSDT_CAMPPLAYERINFO = cSDT_CAMPINFO.astCampPlayerInfo[(int)((UIntPtr)num2)];
                    if (Utility.UTF8Convert(cSDT_CAMPPLAYERINFO.szOpenID) == accountInfo.get_OpenId())
                    {
                        num = cSDT_CAMPPLAYERINFO.stPlayerInfo.astChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID;
                        break;
                    }
                }
                if (num > 0u)
                {
                    break;
                }
            }
            if (num > 0u)
            {
                this.recordStream = new MemoryStream(1048576);
                this.recordWriter = new BinaryWriter(this.recordStream);
                this.recordWriter.Write(CVersion.GetAppVersion());
                this.recordWriter.Write(CVersion.GetUsedResourceVersion());
                this.recordWriter.Write(CVersion.GetRevisonNumber());
                this.recordWriter.Write(num);
                this.recordWriter.Write(DateTime.get_Now().get_Ticks());
                this.recordWriter.Write(beginLoadPkg.stDeskInfo.bMapType);
                this.recordWriter.Write(beginLoadPkg.stDeskInfo.dwMapId);
                this.recordWriter.Write(masterRoleInfo.Name);
                this.recordWriter.Write(masterRoleInfo.HeadUrl);
                this.recordWriter.Write(masterRoleInfo.m_rankGrade);
                this.recordWriter.Write(masterRoleInfo.m_rankClass);
            }
        }
Example #4
0
        private void BeginRecord(SCPKG_MULTGAME_BEGINLOAD beginLoadPkg)
        {
            this.ClearRecord();
            if (beginLoadPkg != null)
            {
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

                if (masterRoleInfo != null)
                {
                    ApolloAccountInfo accountInfo = Singleton <ApolloHelper> .GetInstance().GetAccountInfo(false);

                    if (accountInfo != null)
                    {
                        uint dwHeroID = 0;
                        for (int i = 0; i < beginLoadPkg.astCampInfo.Length; i++)
                        {
                            CSDT_CAMPINFO csdt_campinfo = beginLoadPkg.astCampInfo[i];
                            for (uint j = 0; j < csdt_campinfo.dwPlayerNum; j++)
                            {
                                CSDT_CAMPPLAYERINFO csdt_campplayerinfo = csdt_campinfo.astCampPlayerInfo[j];
                                if (Utility.UTF8Convert(csdt_campplayerinfo.szOpenID) == accountInfo.OpenId)
                                {
                                    dwHeroID = csdt_campplayerinfo.stPlayerInfo.astChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID;
                                    break;
                                }
                            }
                            if (dwHeroID > 0)
                            {
                                break;
                            }
                        }
                        if (dwHeroID > 0)
                        {
                            this.recordStream = new MemoryStream(0x100000);
                            this.recordWriter = new BinaryWriter(this.recordStream);
                            this.recordWriter.Write(CVersion.GetAppVersion());
                            this.recordWriter.Write(CVersion.GetUsedResourceVersion());
                            this.recordWriter.Write(dwHeroID);
                            this.recordWriter.Write(DateTime.Now.Ticks);
                            this.recordWriter.Write(beginLoadPkg.stDeskInfo.bMapType);
                            this.recordWriter.Write(beginLoadPkg.stDeskInfo.dwMapId);
                            this.recordWriter.Write(masterRoleInfo.Name);
                            this.recordWriter.Write(masterRoleInfo.HeadUrl);
                            this.recordWriter.Write(masterRoleInfo.m_rankGrade);
                            this.recordWriter.Write(masterRoleInfo.m_rankClass);
                        }
                    }
                }
            }
        }
Example #5
0
        protected virtual void PreparePlayer()
        {
            MultiGameContext multiGameContext = this.GameContext as MultiGameContext;

            DebugHelper.Assert(multiGameContext != null);
            if (multiGameContext == null)
            {
                return;
            }
            if (Singleton <GamePlayerCenter> .get_instance().GetAllPlayers().get_Count() > 0)
            {
            }
            Singleton <GamePlayerCenter> .get_instance().ClearAllPlayers();

            uint num = 0u;

            for (int i = 0; i < 2; i++)
            {
                int num2 = 0;
                while ((long)num2 < (long)((ulong)multiGameContext.MessageRef.astCampInfo[i].dwPlayerNum))
                {
                    uint   dwObjId = multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.dwObjId;
                    Player player  = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(dwObjId);

                    DebugHelper.Assert(player == null, "你tm肯定在逗我");
                    if (num == 0u && i + 1 == 1)
                    {
                        num = dwObjId;
                    }
                    bool flag = multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.bObjType == 2;
                    if (player != null)
                    {
                        goto IL_727;
                    }
                    string openId     = string.Empty;
                    uint   vipLv      = 0u;
                    int    honorId    = 0;
                    int    honorLevel = 0;
                    ulong  uid;
                    uint   logicWrold;
                    uint   level;
                    if (flag)
                    {
                        if (Convert.ToBoolean(multiGameContext.MessageRef.stDeskInfo.bIsWarmBattle))
                        {
                            uid        = multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.stDetail.get_stPlayerOfNpc().ullFakeUid;
                            logicWrold = multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.stDetail.get_stPlayerOfNpc().dwFakeLogicWorldID;
                            level      = multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.stDetail.get_stPlayerOfNpc().dwFakePvpLevel;
                            openId     = string.Empty;
                        }
                        else
                        {
                            uid        = 0uL;
                            logicWrold = 0u;
                            level      = multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.dwLevel;
                            openId     = string.Empty;
                        }
                    }
                    else
                    {
                        uid        = multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.stDetail.get_stPlayerOfAcnt().ullUid;
                        logicWrold = (uint)multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.stDetail.get_stPlayerOfAcnt().iLogicWorldID;
                        level      = multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.dwLevel;
                        openId     = Utility.UTF8Convert(multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].szOpenID);
                        vipLv      = multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.stDetail.get_stPlayerOfAcnt().stGameVip.dwCurLevel;
                        honorId    = multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.stDetail.get_stPlayerOfAcnt().iHonorID;
                        honorLevel = multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.stDetail.get_stPlayerOfAcnt().iHonorLevel;
                    }
                    GameIntimacyData intimacyData = null;
                    if (!flag)
                    {
                        CSDT_CAMPPLAYERINFO cSDT_CAMPPLAYERINFO = multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2];
                        if (cSDT_CAMPPLAYERINFO == null)
                        {
                            goto IL_81D;
                        }
                        ulong ullUid                 = cSDT_CAMPPLAYERINFO.stPlayerInfo.stDetail.get_stPlayerOfAcnt().ullUid;
                        int   iLogicWorldID          = cSDT_CAMPPLAYERINFO.stPlayerInfo.stDetail.get_stPlayerOfAcnt().iLogicWorldID;
                        byte  bIntimacyRelationPrior = cSDT_CAMPPLAYERINFO.stIntimacyRelation.bIntimacyRelationPrior;
                        COMDT_INTIMACY_RELATION_DATA stIntimacyRelationData = cSDT_CAMPPLAYERINFO.stIntimacyRelation.stIntimacyRelationData;
                        ulong  num4;
                        ulong  num3 = num4 = 0uL;
                        uint   num6;
                        uint   num5  = num6 = 0u;
                        string text  = string.Empty;
                        string text2 = string.Empty;
                        for (int j = 0; j < (int)stIntimacyRelationData.wIntimacyRelationNum; j++)
                        {
                            COMDT_INTIMACY_RELATION cOMDT_INTIMACY_RELATION = stIntimacyRelationData.astIntimacyRelationList[j];
                            if (cOMDT_INTIMACY_RELATION != null)
                            {
                                for (int k = 0; k < 2; k++)
                                {
                                    int num7 = 0;
                                    while ((long)num7 < (long)((ulong)multiGameContext.MessageRef.astCampInfo[k].dwPlayerNum))
                                    {
                                        CSDT_CAMPPLAYERINFO cSDT_CAMPPLAYERINFO2 = multiGameContext.MessageRef.astCampInfo[k].astCampPlayerInfo[num7];
                                        if (multiGameContext.MessageRef.astCampInfo[k].astCampPlayerInfo[num7].stPlayerInfo.bObjType != 2)
                                        {
                                            ulong ullUid2        = cSDT_CAMPPLAYERINFO2.stPlayerInfo.stDetail.get_stPlayerOfAcnt().ullUid;
                                            int   iLogicWorldID2 = cSDT_CAMPPLAYERINFO2.stPlayerInfo.stDetail.get_stPlayerOfAcnt().iLogicWorldID;
                                            if (cSDT_CAMPPLAYERINFO2 != null && (ullUid2 != ullUid || iLogicWorldID2 != iLogicWorldID))
                                            {
                                                if (cOMDT_INTIMACY_RELATION.ullUid == ullUid2 && (ulong)cOMDT_INTIMACY_RELATION.dwLogicWorldId == (ulong)((long)iLogicWorldID2))
                                                {
                                                    string text3 = StringHelper.UTF8BytesToString(ref cSDT_CAMPPLAYERINFO2.stPlayerInfo.szName);
                                                    if (cOMDT_INTIMACY_RELATION.bIntimacyState == bIntimacyRelationPrior)
                                                    {
                                                        num4 = ullUid2;
                                                        num6 = (uint)iLogicWorldID2;
                                                        text = text3;
                                                    }
                                                    else
                                                    {
                                                        num3  = ullUid2;
                                                        num5  = (uint)iLogicWorldID2;
                                                        text2 = text3;
                                                    }
                                                }
                                            }
                                        }
                                        num7++;
                                    }
                                }
                            }
                        }
                        string text4 = StringHelper.UTF8BytesToString(ref cSDT_CAMPPLAYERINFO.stPlayerInfo.szName);
                        if (num4 != 0uL && num6 != 0u)
                        {
                            string title = string.Empty;
                            if (bIntimacyRelationPrior == 1)
                            {
                                title = Singleton <CTextManager> .get_instance().GetText("IntimacyShowLoadGay", new string[]
                                {
                                    text
                                });
                            }
                            if (bIntimacyRelationPrior == 2)
                            {
                                title = Singleton <CTextManager> .get_instance().GetText("IntimacyShowLoadLover", new string[]
                                {
                                    text
                                });
                            }
                            intimacyData = new GameIntimacyData(bIntimacyRelationPrior, num4, num6, title);
                            string text5 = string.Format("----FR, 局内亲密度, 玩家:{0}, 优先选择的关系:{1} --- finded 关系:{2}, 对方名字:{3}", new object[]
                            {
                                text4,
                                bIntimacyRelationPrior,
                                bIntimacyRelationPrior,
                                text
                            });
                        }
                        else if (num3 != 0uL && num5 != 0u)
                        {
                            byte b = 0;
                            if (bIntimacyRelationPrior == 1)
                            {
                                b = 2;
                            }
                            if (bIntimacyRelationPrior == 2)
                            {
                                b = 1;
                            }
                            string title2 = string.Empty;
                            if (b == 1)
                            {
                                title2 = Singleton <CTextManager> .get_instance().GetText("IntimacyShowLoadGay", new string[]
                                {
                                    text2
                                });
                            }
                            if (b == 2)
                            {
                                title2 = Singleton <CTextManager> .get_instance().GetText("IntimacyShowLoadLover", new string[]
                                {
                                    text2
                                });
                            }
                            intimacyData = new GameIntimacyData(b, num3, num5, title2);
                            string text6 = string.Format("----FR, 局内亲密度, 玩家:{0}, 优先选择的关系:{1} --- finded 关系:{2}, 对方名字:{3}", new object[]
                            {
                                text4,
                                bIntimacyRelationPrior,
                                b,
                                text2
                            });
                        }
                    }
                    player = Singleton <GamePlayerCenter> .GetInstance().AddPlayer(dwObjId, i + 1, (int)multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.bPosOfCamp, level, flag, Utility.UTF8Convert(multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.szName), 0, (int)logicWrold, uid, vipLv, openId, multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].dwGradeOfRank, multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].dwClassOfRank, honorId, honorLevel, intimacyData);

                    DebugHelper.Assert(player != null, "创建player失败");
                    if (player != null)
                    {
                        player.isGM = (multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].bIsGM > 0);
                        goto IL_727;
                    }
                    goto IL_727;
IL_81D:
                    num2++;
                    continue;
IL_727:
                    for (int l = 0; l < multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.astChoiceHero.Length; l++)
                    {
                        COMDT_CHOICEHERO cOMDT_CHOICEHERO = multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.astChoiceHero[l];
                        int dwHeroID = (int)cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.dwHeroID;
                        if (dwHeroID != 0)
                        {
                            bool flag2 = (cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.dwMaskBits & 4u) > 0u && (cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.dwMaskBits & 1u) == 0u;
                            if (multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.bObjType == 1)
                            {
                                if (flag2)
                                {
                                }
                            }
                            if (player != null)
                            {
                                player.AddHero((uint)dwHeroID);
                            }
                        }
                    }
                    goto IL_81D;
                }
            }
            if (Singleton <WatchController> .GetInstance().IsWatching)
            {
                Singleton <GamePlayerCenter> .GetInstance().SetHostPlayer(num);
            }
            else if (Singleton <GameReplayModule> .HasInstance() && Singleton <GameReplayModule> .get_instance().isReplay)
            {
                Singleton <GamePlayerCenter> .GetInstance().SetHostPlayer(num);
            }
            else
            {
                Player playerByUid = Singleton <GamePlayerCenter> .GetInstance().GetPlayerByUid(Singleton <CRoleInfoManager> .get_instance().masterUUID);

                DebugHelper.Assert(playerByUid != null, "load multi game but hostPlayer is null");
                Singleton <GamePlayerCenter> .GetInstance().SetHostPlayer(playerByUid.PlayerId);
            }
            multiGameContext.levelContext.m_isWarmBattle = Convert.ToBoolean(multiGameContext.MessageRef.stDeskInfo.bIsWarmBattle);
            multiGameContext.SaveServerData();
        }
        protected virtual void PreparePlayer()
        {
            MultiGameContext multiGameContext = this.GameContext as MultiGameContext;

            DebugHelper.Assert(multiGameContext != null);
            if (multiGameContext == null)
            {
                return;
            }
            Singleton <GamePlayerCenter> .instance.ClearAllPlayers();

            uint   num  = 0u;
            string text = string.Empty;

            for (int i = 0; i < 2; i++)
            {
                text = text + "camp" + i.ToString() + "|";
                uint num2 = 0u;
                while (num2 < multiGameContext.MessageRef.astCampInfo[i].dwPlayerNum)
                {
                    CSDT_CAMPPLAYERINFO cSDT_CAMPPLAYERINFO = multiGameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[(int)((UIntPtr)num2)];
                    if (cSDT_CAMPPLAYERINFO == null)
                    {
                        num2 += 1u;
                    }
                    else
                    {
                        uint   dwObjId = cSDT_CAMPPLAYERINFO.stPlayerInfo.dwObjId;
                        Player player  = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(dwObjId);

                        DebugHelper.Assert(player == null, "你tm肯定在逗我");
                        if (num == 0u && i == 0)
                        {
                            num = dwObjId;
                        }
                        bool flag = cSDT_CAMPPLAYERINFO.stPlayerInfo.bObjType == 2;
                        if (player == null)
                        {
                            string openId     = string.Empty;
                            uint   vipLv      = 0u;
                            int    honorId    = 0;
                            int    honorLevel = 0;
                            uint   wangZheCnt = 0u;
                            ulong  num3       = 0uL;
                            uint   num4       = 0u;
                            uint   level      = cSDT_CAMPPLAYERINFO.stPlayerInfo.dwLevel;
                            if (flag)
                            {
                                if (Convert.ToBoolean(multiGameContext.MessageRef.stDeskInfo.bIsWarmBattle))
                                {
                                    num3  = cSDT_CAMPPLAYERINFO.stPlayerInfo.stDetail.stPlayerOfNpc.ullFakeUid;
                                    num4  = cSDT_CAMPPLAYERINFO.stPlayerInfo.stDetail.stPlayerOfNpc.dwFakeLogicWorldID;
                                    level = cSDT_CAMPPLAYERINFO.stPlayerInfo.stDetail.stPlayerOfNpc.dwFakePvpLevel;
                                }
                            }
                            else
                            {
                                num3       = cSDT_CAMPPLAYERINFO.stPlayerInfo.stDetail.stPlayerOfAcnt.ullUid;
                                num4       = (uint)cSDT_CAMPPLAYERINFO.stPlayerInfo.stDetail.stPlayerOfAcnt.iLogicWorldID;
                                openId     = Utility.UTF8Convert(cSDT_CAMPPLAYERINFO.szOpenID);
                                vipLv      = cSDT_CAMPPLAYERINFO.stPlayerInfo.stDetail.stPlayerOfAcnt.stGameVip.dwCurLevel;
                                honorId    = cSDT_CAMPPLAYERINFO.stPlayerInfo.stDetail.stPlayerOfAcnt.iHonorID;
                                honorLevel = cSDT_CAMPPLAYERINFO.stPlayerInfo.stDetail.stPlayerOfAcnt.iHonorLevel;
                                wangZheCnt = cSDT_CAMPPLAYERINFO.stPlayerInfo.stDetail.stPlayerOfAcnt.dwWangZheCnt;
                            }
                            GameIntimacyData intimacyData = null;
                            if (!flag)
                            {
                                string text2 = StringHelper.UTF8BytesToString(ref cSDT_CAMPPLAYERINFO.stPlayerInfo.szName);
                                byte   bIntimacyRelationPrior = cSDT_CAMPPLAYERINFO.stIntimacyRelation.bIntimacyRelationPrior;
                                COMDT_INTIMACY_CARD_INFO stIntimacyRelationData = cSDT_CAMPPLAYERINFO.stIntimacyRelation.stIntimacyRelationData;
                                LoadEnt loadEnt = new LoadEnt();
                                for (int j = 0; j < (int)stIntimacyRelationData.bIntimacyNum; j++)
                                {
                                    COMDT_INTIMACY_CARD_DATA cOMDT_INTIMACY_CARD_DATA = stIntimacyRelationData.astIntimacyData[j];
                                    if (cOMDT_INTIMACY_CARD_DATA != null)
                                    {
                                        for (int k = 0; k < 2; k++)
                                        {
                                            int num5 = 0;
                                            while ((long)num5 < (long)((ulong)multiGameContext.MessageRef.astCampInfo[k].dwPlayerNum))
                                            {
                                                CSDT_CAMPPLAYERINFO cSDT_CAMPPLAYERINFO2 = multiGameContext.MessageRef.astCampInfo[k].astCampPlayerInfo[num5];
                                                if (multiGameContext.MessageRef.astCampInfo[k].astCampPlayerInfo[num5].stPlayerInfo.bObjType == 2)
                                                {
                                                    num5++;
                                                }
                                                else
                                                {
                                                    ulong ullUid        = cSDT_CAMPPLAYERINFO2.stPlayerInfo.stDetail.stPlayerOfAcnt.ullUid;
                                                    int   iLogicWorldID = cSDT_CAMPPLAYERINFO2.stPlayerInfo.stDetail.stPlayerOfAcnt.iLogicWorldID;
                                                    if (cSDT_CAMPPLAYERINFO2 != null && (ullUid != num3 || (long)iLogicWorldID != (long)((ulong)num4)) && (int)cOMDT_INTIMACY_CARD_DATA.wIntimacyValue >= IntimacyRelationViewUT.Getlevel2_maxValue() && cOMDT_INTIMACY_CARD_DATA.stUin.ullUid == ullUid && (ulong)cOMDT_INTIMACY_CARD_DATA.stUin.dwLogicWorldId == (ulong)((long)iLogicWorldID) && IntimacyRelationViewUT.IsRelationPriorityHigher(cOMDT_INTIMACY_CARD_DATA.bIntimacyState, loadEnt.state, bIntimacyRelationPrior))
                                                    {
                                                        string text3 = StringHelper.UTF8BytesToString(ref cSDT_CAMPPLAYERINFO2.stPlayerInfo.szName);
                                                        string text4 = string.Format("----FRData Loading s1: 玩家:{0} ----对方名字:{1}, 新关系:{2}替换之前关系:{3}", new object[]
                                                        {
                                                            text2,
                                                            text3,
                                                            (COM_INTIMACY_STATE)cOMDT_INTIMACY_CARD_DATA.bIntimacyState,
                                                            loadEnt.state
                                                        });
                                                        loadEnt.intimacyValue    = (int)cOMDT_INTIMACY_CARD_DATA.wIntimacyValue;
                                                        loadEnt.otherSideName    = text3;
                                                        loadEnt.state            = (COM_INTIMACY_STATE)cOMDT_INTIMACY_CARD_DATA.bIntimacyState;
                                                        loadEnt.otherSideUlluid  = ullUid;
                                                        loadEnt.otherSideWorldId = iLogicWorldID;
                                                    }
                                                    num5++;
                                                }
                                            }
                                        }
                                    }
                                }
                                if (loadEnt.state != COM_INTIMACY_STATE.COM_INTIMACY_STATE_NULL)
                                {
                                    string relationInLoadingMenu = IntimacyRelationViewUT.GetRelationInLoadingMenu((byte)loadEnt.state, loadEnt.otherSideName);
                                    intimacyData = new GameIntimacyData(loadEnt.intimacyValue, loadEnt.state, loadEnt.otherSideUlluid, loadEnt.otherSideWorldId, relationInLoadingMenu);
                                }
                            }
                            player = Singleton <GamePlayerCenter> .GetInstance().AddPlayer(dwObjId, i + COM_PLAYERCAMP.COM_PLAYERCAMP_1, (int)cSDT_CAMPPLAYERINFO.stPlayerInfo.bPosOfCamp, level, flag, Utility.UTF8Convert(cSDT_CAMPPLAYERINFO.stPlayerInfo.szName), 0, (int)num4, num3, vipLv, openId, cSDT_CAMPPLAYERINFO.dwShowGradeOfRank, cSDT_CAMPPLAYERINFO.dwClassOfRank, wangZheCnt, honorId, honorLevel, intimacyData, cSDT_CAMPPLAYERINFO.ullUserPrivacyBits);

                            DebugHelper.Assert(player != null, "创建player失败");
                            if (player != null)
                            {
                                player.isGM = (cSDT_CAMPPLAYERINFO.bIsGM > 0);
                            }
                        }
                        for (int l = 0; l < cSDT_CAMPPLAYERINFO.stPlayerInfo.astChoiceHero.Length; l++)
                        {
                            COMDT_CHOICEHERO cOMDT_CHOICEHERO = cSDT_CAMPPLAYERINFO.stPlayerInfo.astChoiceHero[l];
                            int dwHeroID = (int)cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.dwHeroID;
                            player.AddHero((uint)dwHeroID);
                        }
                        if (player != null)
                        {
                            string text5 = string.Format("{0}:{1}|", player.OpenId, player.LogicWrold);
                            text += text5;
                        }
                        num2 += 1u;
                    }
                }
            }
            MonoSingleton <TGPSDKSys> .GetInstance().GameStart(text);

            if (Singleton <WatchController> .GetInstance().IsWatching)
            {
                Player playerByUid = Singleton <GamePlayerCenter> .GetInstance().GetPlayerByUid(Singleton <WatchController> .GetInstance().TargetUID);

                if (playerByUid != null)
                {
                    Singleton <GamePlayerCenter> .GetInstance().SetHostPlayer(playerByUid.PlayerId);
                }
                else
                {
                    Singleton <GamePlayerCenter> .GetInstance().SetHostPlayer(num);
                }
            }
            else
            {
                Player playerByUid2 = Singleton <GamePlayerCenter> .GetInstance().GetPlayerByUid(Singleton <CRoleInfoManager> .instance.masterUUID);

                DebugHelper.Assert(playerByUid2 != null, "load multi game but hostPlayer is null");
                Singleton <GamePlayerCenter> .GetInstance().SetHostPlayer(playerByUid2.PlayerId);
            }
            multiGameContext.levelContext.m_isWarmBattle = Convert.ToBoolean(multiGameContext.MessageRef.stDeskInfo.bIsWarmBattle);
            multiGameContext.SaveServerData();
        }
        private void BeginRecord(SCPKG_MULTGAME_BEGINLOAD beginLoadPkg, WatchEntryData watchEntry = null)
        {
            this.ClearRecord();
            if (beginLoadPkg == null)
            {
                return;
            }
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return;
            }
            ApolloAccountInfo accountInfo = Singleton <ApolloHelper> .GetInstance().GetAccountInfo(false);

            if (accountInfo == null)
            {
                return;
            }
            uint   num     = 0u;
            string text    = masterRoleInfo.Name;
            string headUrl = masterRoleInfo.HeadUrl;
            byte   b       = masterRoleInfo.m_rankGrade;
            uint   num2    = masterRoleInfo.m_rankClass;

            if (watchEntry == null)
            {
                if (Singleton <WatchController> .GetInstance().IsWatching)
                {
                    CSDT_CAMPPLAYERINFO cSDT_CAMPPLAYERINFO = beginLoadPkg.astCampInfo[0].astCampPlayerInfo[0];
                    text = StringHelper.UTF8BytesToString(ref cSDT_CAMPPLAYERINFO.stPlayerInfo.szName);
                    b    = (byte)cSDT_CAMPPLAYERINFO.dwShowGradeOfRank;
                    num2 = cSDT_CAMPPLAYERINFO.dwClassOfRank;
                    num  = cSDT_CAMPPLAYERINFO.stPlayerInfo.astChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID;
                }
                else
                {
                    for (int i = 0; i < beginLoadPkg.astCampInfo.Length; i++)
                    {
                        CSDT_CAMPINFO cSDT_CAMPINFO = beginLoadPkg.astCampInfo[i];
                        for (uint num3 = 0u; num3 < cSDT_CAMPINFO.dwPlayerNum; num3 += 1u)
                        {
                            CSDT_CAMPPLAYERINFO cSDT_CAMPPLAYERINFO2 = cSDT_CAMPINFO.astCampPlayerInfo[(int)((uint)((UIntPtr)num3))];
                            if (Utility.UTF8Convert(cSDT_CAMPPLAYERINFO2.szOpenID) == accountInfo.OpenId)
                            {
                                num = cSDT_CAMPPLAYERINFO2.stPlayerInfo.astChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID;
                                break;
                            }
                        }
                        if (num > 0u)
                        {
                            break;
                        }
                    }
                }
            }
            else
            {
                num     = watchEntry.usedHeroId;
                text    = watchEntry.name;
                headUrl = watchEntry.headUrl;
                b       = watchEntry.rankGrade;
                num2    = watchEntry.rankClass;
            }
            if (num > 0u)
            {
                this.recordStream = new MemoryStream(1048576);
                this.recordWriter = new BinaryWriter(this.recordStream);
                this.recordWriter.Write(CVersion.GetAppVersion());
                this.recordWriter.Write(CVersion.GetUsedResourceVersion());
                this.recordWriter.Write(CVersion.GetRevisonNumber());
                this.recordWriter.Write(num);
                this.recordWriter.Write(DateTime.get_Now().get_Ticks());
                this.recordWriter.Write(beginLoadPkg.stDeskInfo.bMapType);
                this.recordWriter.Write(beginLoadPkg.stDeskInfo.dwMapId);
                this.recordWriter.Write(text);
                this.recordWriter.Write(headUrl);
                this.recordWriter.Write(b);
                this.recordWriter.Write(num2);
            }
        }