Esempio n. 1
0
        public List <uint> Get_Enemy_HeroIDS()
        {
            List <uint>      list = new List <uint>(3);
            COMDT_PLAYERINFO current_Enemy_PlayerInfo = this.Get_Current_Enemy_PlayerInfo();

            if (current_Enemy_PlayerInfo != null)
            {
                for (int i = 0; i < current_Enemy_PlayerInfo.astChoiceHero.Length; i++)
                {
                    COMDT_CHOICEHERO cOMDT_CHOICEHERO = current_Enemy_PlayerInfo.astChoiceHero[i];
                    if (cOMDT_CHOICEHERO != null && cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.dwHeroID != 0u)
                    {
                        list.Add(cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.dwHeroID);
                    }
                }
            }
            return(list);
        }
Esempio n. 2
0
        public List <uint> Get_Enemy_HeroIDS()
        {
            List <uint>      list             = new List <uint>(3);
            COMDT_PLAYERINFO comdt_playerinfo = this.Get_Current_Enemy_PlayerInfo();

            if (comdt_playerinfo != null)
            {
                for (int i = 0; i < comdt_playerinfo.astChoiceHero.Length; i++)
                {
                    COMDT_CHOICEHERO comdt_choicehero = comdt_playerinfo.astChoiceHero[i];
                    if ((comdt_choicehero != null) && (comdt_choicehero.stBaseInfo.stCommonInfo.dwHeroID != 0))
                    {
                        list.Add(comdt_choicehero.stBaseInfo.stCommonInfo.dwHeroID);
                    }
                }
            }
            return(list);
        }
Esempio n. 3
0
        public override bool GetActorServerCommonSkillData(ref ActorMeta actorMeta, out uint skillID)
        {
            skillID = 0u;
            ListView <COMDT_CHOICEHERO> inSearchList = null;

            if (!this._serverCachedInfo.TryGetValue(actorMeta.PlayerId, ref inSearchList))
            {
                return(false);
            }
            int configId = actorMeta.ConfigId;
            COMDT_CHOICEHERO cOMDT_CHOICEHERO = this.Find(inSearchList, (COMDT_CHOICEHERO hero) => (ulong)hero.stBaseInfo.stCommonInfo.dwHeroID == (ulong)((long)configId));

            if (cOMDT_CHOICEHERO != null)
            {
                skillID = cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.stSkill.dwSelSkillID;
                return(true);
            }
            return(false);
        }
Esempio n. 4
0
        public void AddHeroServerInfo(uint playerId, COMDT_CHOICEHERO serverHeroInfo)
        {
            if (serverHeroInfo == null || serverHeroInfo.stBaseInfo.stCommonInfo.dwHeroID == 0u)
            {
                return;
            }
            ListView <COMDT_CHOICEHERO> listView = null;

            if (!this._serverCachedInfo.ContainsKey(playerId))
            {
                this._serverCachedInfo.Add(playerId, new ListView <COMDT_CHOICEHERO>());
            }
            if (!this._serverCachedInfo.TryGetValue(playerId, ref listView))
            {
                return;
            }
            this.ApplyExtraInfoRule(playerId, serverHeroInfo);
            listView.Add(serverHeroInfo);
        }
 internal void ConvertServerHeroInfo(ref ActorServerData serverData, COMDT_CHOICEHERO serverHeroInfo)
 {
     if (serverHeroInfo != null)
     {
         if ((serverHeroInfo.stBaseInfo != null) && (serverHeroInfo.stBaseInfo.stCommonInfo != null))
         {
             serverData.Exp   = serverHeroInfo.stBaseInfo.stCommonInfo.dwExp;
             serverData.Level = serverHeroInfo.stBaseInfo.stCommonInfo.wLevel;
             serverData.Star  = serverHeroInfo.stBaseInfo.stCommonInfo.wStar;
             if (serverHeroInfo.stBaseInfo.stCommonInfo.stQuality != null)
             {
                 serverData.TheQualityInfo.Quality    = serverHeroInfo.stBaseInfo.stCommonInfo.stQuality.wQuality;
                 serverData.TheQualityInfo.SubQuality = serverHeroInfo.stBaseInfo.stCommonInfo.stQuality.wSubQuality;
             }
             if (serverHeroInfo.stBaseInfo.stCommonInfo.stProficiency != null)
             {
                 serverData.TheProficiencyInfo.Level       = serverHeroInfo.stBaseInfo.stCommonInfo.stProficiency.bLv;
                 serverData.TheProficiencyInfo.Proficiency = serverHeroInfo.stBaseInfo.stCommonInfo.stProficiency.dwProficiency;
             }
             serverData.SkinId = serverHeroInfo.stBaseInfo.stCommonInfo.wSkinID;
         }
         if (serverHeroInfo.stBurningInfo != null)
         {
             serverData.TheBurnInfo.HeroRemainingHp = serverHeroInfo.stBurningInfo.dwBloodTTH;
             serverData.TheBurnInfo.IsDead          = serverHeroInfo.stBurningInfo.bIsDead != 0;
         }
         if (serverHeroInfo.stHeroExtral != null)
         {
             serverData.TheExtraInfo.BornPointIndex = serverHeroInfo.stHeroExtral.iHeroPos;
         }
         serverData.SymbolID = new uint[serverHeroInfo.SymbolID.Length];
         for (int i = 0; i < serverHeroInfo.SymbolID.Length; i++)
         {
             serverData.SymbolID[i] = serverHeroInfo.SymbolID[i];
         }
         serverData.m_customRecommendEquips = new ushort[serverHeroInfo.HeroEquipList.Length];
         for (int j = 0; j < serverHeroInfo.HeroEquipList.Length; j++)
         {
             serverData.m_customRecommendEquips[j] = (ushort)serverHeroInfo.HeroEquipList[j];
         }
     }
 }
Esempio n. 6
0
        internal void ApplyExtraInfoRule(uint playerId, COMDT_CHOICEHERO serverHeroInfo)
        {
            int num = serverHeroInfo.stHeroExtral.iHeroPos;

            if (num != 0)
            {
                return;
            }
            Player player = Singleton <GamePlayerCenter> .get_instance().GetPlayer(playerId);

            num = player.CampPos;
            if (num != 0)
            {
                serverHeroInfo.stHeroExtral.iHeroPos = num;
                return;
            }
            int heroTeamPosIndex = player.GetHeroTeamPosIndex(serverHeroInfo.stBaseInfo.stCommonInfo.dwHeroID);

            if (heroTeamPosIndex <= 0)
            {
                return;
            }
            ListView <COMDT_CHOICEHERO> listView = null;
            bool flag = true;

            if (this._serverCachedInfo.TryGetValue(playerId, ref listView))
            {
                for (int i = heroTeamPosIndex - 1; i >= 0; i--)
                {
                    if (listView.get_Item(i).stHeroExtral.iHeroPos != i)
                    {
                        flag = false;
                        break;
                    }
                }
            }
            if (flag)
            {
                serverHeroInfo.stHeroExtral.iHeroPos = heroTeamPosIndex;
            }
        }
Esempio n. 7
0
        public static void Record_EnemyHero_HPInfo(int heroID, uint blood)
        {
            COMDT_PLAYERINFO comdt_playerinfo = Singleton <BurnExpeditionController> .GetInstance().model.Get_Current_Enemy_PlayerInfo();

            for (int i = 0; i < comdt_playerinfo.astChoiceHero.Length; i++)
            {
                COMDT_CHOICEHERO comdt_choicehero = comdt_playerinfo.astChoiceHero[i];
                if ((comdt_choicehero.stBaseInfo.stCommonInfo.dwHeroID != 0) && (comdt_choicehero.stBaseInfo.stCommonInfo.dwHeroID == heroID))
                {
                    comdt_choicehero.stBurningInfo.dwBloodTTH = blood;
                    if (blood == 0)
                    {
                        comdt_choicehero.stBurningInfo.bIsDead = 1;
                    }
                    else
                    {
                        comdt_choicehero.stBurningInfo.bIsDead = 0;
                    }
                }
            }
        }
        public static void Record_EnemyHero_HPInfo(int heroID, uint blood)
        {
            BurnExpeditionModel model = Singleton <BurnExpeditionController> .GetInstance().model;

            COMDT_PLAYERINFO current_Enemy_PlayerInfo = model.Get_Current_Enemy_PlayerInfo();

            for (int i = 0; i < current_Enemy_PlayerInfo.astChoiceHero.Length; i++)
            {
                COMDT_CHOICEHERO cOMDT_CHOICEHERO = current_Enemy_PlayerInfo.astChoiceHero[i];
                if (cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.dwHeroID != 0u && (ulong)cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.dwHeroID == (ulong)((long)heroID))
                {
                    cOMDT_CHOICEHERO.stBurningInfo.dwBloodTTH = blood;
                    if (blood == 0u)
                    {
                        cOMDT_CHOICEHERO.stBurningInfo.bIsDead = 1;
                    }
                    else
                    {
                        cOMDT_CHOICEHERO.stBurningInfo.bIsDead = 0;
                    }
                }
            }
        }
Esempio n. 9
0
        internal void ApplyExtraInfoRule(uint playerId, COMDT_CHOICEHERO serverHeroInfo)
        {
            if (serverHeroInfo.stHeroExtral.iHeroPos == 0)
            {
                Player player = Singleton <GamePlayerCenter> .instance.GetPlayer(playerId);

                int campPos = player.CampPos;
                if (campPos != 0)
                {
                    serverHeroInfo.stHeroExtral.iHeroPos = campPos;
                }
                else
                {
                    int heroTeamPosIndex = player.GetHeroTeamPosIndex(serverHeroInfo.stBaseInfo.stCommonInfo.dwHeroID);
                    if (heroTeamPosIndex > 0)
                    {
                        ListView <COMDT_CHOICEHERO> view = null;
                        bool flag = true;
                        if (this._serverCachedInfo.TryGetValue(playerId, out view))
                        {
                            for (int i = heroTeamPosIndex - 1; i >= 0; i--)
                            {
                                if (view[i].stHeroExtral.iHeroPos != i)
                                {
                                    flag = false;
                                    break;
                                }
                            }
                        }
                        if (flag)
                        {
                            serverHeroInfo.stHeroExtral.iHeroPos = heroTeamPosIndex;
                        }
                    }
                }
            }
        }
Esempio n. 10
0
        public void BuildMultiGamePlayers(SCPKG_MULTGAME_BEGINLOAD svrGameInfo)
        {
            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)svrGameInfo.astCampInfo[i].dwPlayerNum))
                {
                    uint   dwObjId = svrGameInfo.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 = svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.bObjType == 2;
                    if (player == null)
                    {
                        string openId     = string.Empty;
                        uint   vipLv      = 0u;
                        int    honorId    = 0;
                        int    honorLevel = 0;
                        ulong  uid;
                        uint   logicWrold;
                        uint   level;
                        if (flag)
                        {
                            if (Convert.ToBoolean(svrGameInfo.stDeskInfo.bIsWarmBattle))
                            {
                                uid        = svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.stDetail.get_stPlayerOfNpc().ullFakeUid;
                                logicWrold = svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.stDetail.get_stPlayerOfNpc().dwFakeLogicWorldID;
                                level      = svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.stDetail.get_stPlayerOfNpc().dwFakePvpLevel;
                                openId     = string.Empty;
                            }
                            else
                            {
                                uid        = 0uL;
                                logicWrold = 0u;
                                level      = svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.dwLevel;
                                openId     = string.Empty;
                            }
                        }
                        else
                        {
                            uid        = svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.stDetail.get_stPlayerOfAcnt().ullUid;
                            logicWrold = (uint)svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.stDetail.get_stPlayerOfAcnt().iLogicWorldID;
                            level      = svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.dwLevel;
                            openId     = Utility.UTF8Convert(svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].szOpenID);
                            vipLv      = svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.stDetail.get_stPlayerOfAcnt().stGameVip.dwCurLevel;
                            honorId    = svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.stDetail.get_stPlayerOfAcnt().iHonorID;
                            honorLevel = svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.stDetail.get_stPlayerOfAcnt().iHonorLevel;
                        }
                        player = Singleton <GamePlayerCenter> .GetInstance().AddPlayer(dwObjId, i + 1, (int)svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.bPosOfCamp, level, flag, Utility.UTF8Convert(svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.szName), 0, (int)logicWrold, uid, vipLv, openId, svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].dwGradeOfRank, svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].dwClassOfRank, honorId, honorLevel, null);

                        if (player != null)
                        {
                            player.isGM = (svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].bIsGM > 0);
                        }
                    }
                    for (int j = 0; j < svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.astChoiceHero.Length; j++)
                    {
                        COMDT_CHOICEHERO cOMDT_CHOICEHERO = svrGameInfo.astCampInfo[i].astCampPlayerInfo[num2].stPlayerInfo.astChoiceHero[j];
                        int dwHeroID = (int)cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.dwHeroID;
                        if (dwHeroID != 0)
                        {
                            bool arg_38B_0 = (cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.dwMaskBits & 4u) > 0u && (cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.dwMaskBits & 1u) == 0u;
                            if (player != null)
                            {
                                player.AddHero((uint)dwHeroID);
                            }
                        }
                    }
                    num2++;
                }
            }
            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);
            }
            Singleton <ActorDataCenter> .get_instance().ClearHeroServerData();

            for (int k = 0; k < svrGameInfo.astCampInfo.Length; k++)
            {
                CSDT_CAMPINFO cSDT_CAMPINFO = svrGameInfo.astCampInfo[k];
                int           num3          = Mathf.Min(cSDT_CAMPINFO.astCampPlayerInfo.Length, (int)cSDT_CAMPINFO.dwPlayerNum);
                for (int l = 0; l < num3; l++)
                {
                    COMDT_PLAYERINFO stPlayerInfo = cSDT_CAMPINFO.astCampPlayerInfo[l].stPlayerInfo;
                    Singleton <ActorDataCenter> .get_instance().AddHeroesServerData(stPlayerInfo.dwObjId, stPlayerInfo.astChoiceHero);
                }
            }
        }
Esempio n. 11
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();
        }
Esempio n. 12
0
 internal void ConvertServerHeroInfo(ref ActorServerData serverData, COMDT_CHOICEHERO serverHeroInfo)
 {
     serverData.SymbolID = new uint[30];
     serverData.m_customRecommendEquips = new ushort[6];
     if (serverHeroInfo == null)
     {
         Debug.Log(string.Format("COMDT_CHOICEHERO is null when try to use hero Id {0}, playerId is {1}", serverData.TheActorMeta.ConfigId, serverData.TheActorMeta.PlayerId));
         DictionaryView <uint, ListView <COMDT_CHOICEHERO> > .Enumerator enumerator = this._serverCachedInfo.GetEnumerator();
         while (enumerator.MoveNext())
         {
             KeyValuePair <uint, ListView <COMDT_CHOICEHERO> > current = enumerator.Current;
             uint key = current.Key;
             KeyValuePair <uint, ListView <COMDT_CHOICEHERO> > pair2 = enumerator.Current;
             ListView <COMDT_CHOICEHERO> view = pair2.Value;
             if (view.Count > 0)
             {
                 Debug.Log(string.Format("_serverCachedInfo key {0} value {1}", key, view[0].stBaseInfo.stCommonInfo.dwHeroID));
             }
             else
             {
                 Debug.Log(string.Format("_serverCachedInfo key {0} value empty", key));
             }
         }
     }
     else
     {
         if ((serverHeroInfo.stBaseInfo != null) && (serverHeroInfo.stBaseInfo.stCommonInfo != null))
         {
             serverData.Exp   = serverHeroInfo.stBaseInfo.stCommonInfo.dwExp;
             serverData.Level = serverHeroInfo.stBaseInfo.stCommonInfo.wLevel;
             serverData.Star  = serverHeroInfo.stBaseInfo.stCommonInfo.wStar;
             if (serverHeroInfo.stBaseInfo.stCommonInfo.stQuality != null)
             {
                 serverData.TheQualityInfo.Quality    = serverHeroInfo.stBaseInfo.stCommonInfo.stQuality.wQuality;
                 serverData.TheQualityInfo.SubQuality = serverHeroInfo.stBaseInfo.stCommonInfo.stQuality.wSubQuality;
             }
             if (serverHeroInfo.stBaseInfo.stCommonInfo.stProficiency != null)
             {
                 serverData.TheProficiencyInfo.Level       = serverHeroInfo.stBaseInfo.stCommonInfo.stProficiency.bLv;
                 serverData.TheProficiencyInfo.Proficiency = serverHeroInfo.stBaseInfo.stCommonInfo.stProficiency.dwProficiency;
             }
             serverData.SkinId = serverHeroInfo.stBaseInfo.stCommonInfo.wSkinID;
         }
         if (serverHeroInfo.stBurningInfo != null)
         {
             serverData.TheBurnInfo.HeroRemainingHp = serverHeroInfo.stBurningInfo.dwBloodTTH;
             serverData.TheBurnInfo.IsDead          = serverHeroInfo.stBurningInfo.bIsDead != 0;
         }
         if (serverHeroInfo.stHeroExtral != null)
         {
             serverData.TheExtraInfo.BornPointIndex = serverHeroInfo.stHeroExtral.iHeroPos;
         }
         for (int i = 0; i < serverHeroInfo.SymbolID.Length; i++)
         {
             serverData.SymbolID[i] = serverHeroInfo.SymbolID[i];
         }
         for (int j = 0; j < serverHeroInfo.HeroEquipList.Length; j++)
         {
             serverData.m_customRecommendEquips[j] = (ushort)serverHeroInfo.HeroEquipList[j];
         }
     }
 }
        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();
        }
Esempio n. 14
0
        private void _Show_PlayerInfo(COMDT_PLAYERINFO info, uint force, int levelIndex, string headurl = "", COMDT_GAME_VIP_CLIENT nobeVip = null)
        {
            if (info == null || info.szName == null)
            {
                return;
            }
            this.nameText.text  = UT.Bytes2String(info.szName);
            this.levelText.text = info.dwLevel.ToString();
            if (string.IsNullOrEmpty(headurl))
            {
                this.HttpImage.GetComponent <Image>().SetSprite(CUIUtility.s_Sprite_Dynamic_Icon_Dir + Singleton <BurnExpeditionController> .get_instance().model.GetRandomRobotIcon(levelIndex), this.map_fromScript, true, false, false, false);
            }
            else
            {
                UT.SetHttpImage(this.HttpImage, headurl);
            }
            Image component  = this.enemyNode.transform.FindChild("PlayerIcon/NobeIcon").GetComponent <Image>();
            Image component2 = this.enemyNode.transform.FindChild("PlayerIcon/pnlSnsHead/NobeImag").GetComponent <Image>();

            if (nobeVip != null)
            {
                if (component)
                {
                    MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component, (int)nobeVip.dwCurLevel, false);
                }
                if (component2)
                {
                    MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(component2, (int)nobeVip.dwHeadIconId);
                }
            }
            this.enemy_node_0.CustomSetActive(false);
            this.enemy_node_1.CustomSetActive(false);
            this.enemy_node_2.CustomSetActive(false);
            for (int i = 0; i < info.astChoiceHero.Length; i++)
            {
                COMDT_CHOICEHERO cOMDT_CHOICEHERO = info.astChoiceHero[i];
                if (cOMDT_CHOICEHERO != null && cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.dwHeroID != 0u)
                {
                    this._Show_Enemy_Heros(i, cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.dwHeroID, string.Empty, (int)cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.wLevel, (int)cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.wStar, cOMDT_CHOICEHERO.stBurningInfo.dwBloodTTH, cOMDT_CHOICEHERO.stBaseInfo.stCommonInfo.dwHeroID);
                }
            }
            this.SymbolLevel.CustomSetActive(false);
            for (int j = 0; j < info.astChoiceHero.Length; j++)
            {
                COMDT_CHOICEHERO cOMDT_CHOICEHERO2 = info.astChoiceHero[j];
                if (cOMDT_CHOICEHERO2 != null && cOMDT_CHOICEHERO2.stBaseInfo.stCommonInfo.dwHeroID != 0u)
                {
                    int symbolLvWithArray = CSymbolInfo.GetSymbolLvWithArray(cOMDT_CHOICEHERO2.SymbolID);
                    if (symbolLvWithArray > 0)
                    {
                        this.SymbolLevel.CustomSetActive(true);
                        Utility.GetComponetInChild <Text>(this.SymbolLevel, "Text").text = symbolLvWithArray.ToString();
                    }
                    break;
                }
            }
            BurnExpeditionModel model = Singleton <BurnExpeditionController> .get_instance().model;

            uint[] array = model.Get_Buffs(levelIndex);
            this._Show_Buff(this._GetBuffNode(0), (int)array[0], false);
            this._Show_Buff(this._GetBuffNode(1), (int)array[1], false);
            this._Show_Buff(this._GetBuffNode(2), (int)array[2], false);
            this._Show_Buff_Selected_Index(model.curSelect_BuffIndex);
        }
Esempio n. 15
0
 internal bool ConvertServerHeroRuneInfo(ref ActorServerRuneData serverData, ActorRunelSlot runeSlot, COMDT_CHOICEHERO serverHeroInfo)
 {
     if (runeSlot >= ActorRunelSlot.SlotMaxCount)
     {
         return(false);
     }
     serverData.RuneSlot = runeSlot;
     if (serverHeroInfo != null)
     {
         serverData.RuneId = serverHeroInfo.SymbolID[(int)((UIntPtr)runeSlot)];
     }
     return(true);
 }
Esempio n. 16
0
 internal bool ConvertServerHeroEquipInfo(ref ActorServerEquipData serverData, ActorEquiplSlot equipSlot, COMDT_CHOICEHERO serverHeroInfo)
 {
     if (equipSlot >= ActorEquiplSlot.SlotMaxCount)
     {
         return(false);
     }
     serverData.EquipSlot = equipSlot;
     return(true);
 }
Esempio n. 17
0
 internal bool ConvertServerHeroSkillInfo(ref ActorServerSkillData serverData, ActorSkillSlot skillSlot, COMDT_CHOICEHERO serverHeroInfo)
 {
     if (skillSlot >= ActorSkillSlot.SlotMaxCount)
     {
         return(false);
     }
     serverData.SkillSlot  = skillSlot;
     serverData.IsUnlocked = (serverHeroInfo.stBaseInfo.stCommonInfo.stSkill.astSkillInfo[(int)((UIntPtr)skillSlot)].bUnlocked != 0);
     serverData.SkillLevel = (uint)serverHeroInfo.stBaseInfo.stCommonInfo.stSkill.astSkillInfo[(int)((UIntPtr)skillSlot)].wLevel;
     return(true);
 }
Esempio n. 18
0
        protected virtual void PreparePlayer()
        {
            MultiGameContext gameContext = base.GameContext as MultiGameContext;

            DebugHelper.Assert(gameContext != null);
            if (gameContext != null)
            {
                if (Singleton <GamePlayerCenter> .instance.GetAllPlayers().Count > 0)
                {
                }
                Singleton <GamePlayerCenter> .instance.ClearAllPlayers();

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

                        DebugHelper.Assert(player == null, "你tm肯定在逗我");
                        bool isComputer = gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].stPlayerInfo.bObjType == 2;
                        if (player == null)
                        {
                            ulong  uid = 0L;
                            uint   dwFakeLogicWorldID = 0;
                            uint   dwFakePvpLevel     = 1;
                            string openId             = string.Empty;
                            uint   vipLv = 0;
                            if (isComputer)
                            {
                                if (Convert.ToBoolean(gameContext.MessageRef.stDeskInfo.bIsWarmBattle))
                                {
                                    uid = gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].stPlayerInfo.stDetail.stPlayerOfNpc.ullFakeUid;
                                    dwFakeLogicWorldID = gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].stPlayerInfo.stDetail.stPlayerOfNpc.dwFakeLogicWorldID;
                                    dwFakePvpLevel     = gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].stPlayerInfo.stDetail.stPlayerOfNpc.dwFakePvpLevel;
                                    openId             = string.Empty;
                                }
                                else
                                {
                                    uid = 0L;
                                    dwFakeLogicWorldID = 0;
                                    dwFakePvpLevel     = gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].stPlayerInfo.dwLevel;
                                    openId             = string.Empty;
                                }
                            }
                            else
                            {
                                uid = gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].stPlayerInfo.stDetail.stPlayerOfAcnt.ullUid;
                                dwFakeLogicWorldID = (uint)gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].stPlayerInfo.stDetail.stPlayerOfAcnt.iLogicWorldID;
                                dwFakePvpLevel     = gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].stPlayerInfo.dwLevel;
                                openId             = Utility.UTF8Convert(gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].szOpenID);
                                vipLv = gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].stPlayerInfo.stDetail.stPlayerOfAcnt.stGameVip.dwCurLevel;
                            }
                            player = Singleton <GamePlayerCenter> .GetInstance().AddPlayer(dwObjId, (COM_PLAYERCAMP)(i + 1), gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].stPlayerInfo.bPosOfCamp, gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].stPlayerInfo.dwLevel, isComputer, Utility.UTF8Convert(gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].stPlayerInfo.szName), 0, (int)dwFakeLogicWorldID, uid, vipLv, openId, gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].dwGradeOfRank);

                            DebugHelper.Assert(player != null, "创建player失败");
                            if (player != null)
                            {
                                player.isGM = gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].bIsGM > 0;
                            }
                        }
                        for (int k = 0; k < gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].stPlayerInfo.astChoiceHero.Length; k++)
                        {
                            COMDT_CHOICEHERO comdt_choicehero = gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].stPlayerInfo.astChoiceHero[k];
                            int dwHeroID = (int)comdt_choicehero.stBaseInfo.stCommonInfo.dwHeroID;
                            if (dwHeroID != 0)
                            {
                                bool flag2 = ((comdt_choicehero.stBaseInfo.stCommonInfo.dwMaskBits & 4) > 0) && ((comdt_choicehero.stBaseInfo.stCommonInfo.dwMaskBits & 1) == 0);
                                if ((gameContext.MessageRef.astCampInfo[i].astCampPlayerInfo[j].stPlayerInfo.bObjType != 1) || !flag2)
                                {
                                }
                                if (player != null)
                                {
                                    player.AddHero((uint)dwHeroID);
                                }
                            }
                        }
                    }
                }
                if (Singleton <GameReplayModule> .HasInstance() && Singleton <GameReplayModule> .instance.isReplay)
                {
                    List <Player> allPlayers = Singleton <GamePlayerCenter> .GetInstance().GetAllPlayers();

                    int num10 = (Singleton <GameReplayModule> .instance.playerIdx >= allPlayers.Count) ? (allPlayers.Count - 1) : Singleton <GameReplayModule> .instance.playerIdx;
                    Singleton <GamePlayerCenter> .GetInstance().SetHostPlayer(allPlayers[num10].PlayerId);
                }
                else
                {
                    Player playerByUid = Singleton <GamePlayerCenter> .GetInstance().GetPlayerByUid(Singleton <CRoleInfoManager> .instance.masterUUID);

                    DebugHelper.Assert(playerByUid != null, "load multi game but hostPlayer is null");
                    Singleton <GamePlayerCenter> .GetInstance().SetHostPlayer(playerByUid.PlayerId);
                }
                gameContext.levelContext.isWarmBattle = Convert.ToBoolean(gameContext.MessageRef.stDeskInfo.bIsWarmBattle);
                gameContext.SaveServerData();
            }
        }
Esempio n. 19
0
 public void AddHeroServerInfo(uint playerId, COMDT_CHOICEHERO serverHeroInfo)
 {
     this._serverDataProvider.AddHeroServerInfo(playerId, serverHeroInfo);
 }