Ejemplo n.º 1
0
 public void UpdateRoomInfoReconnectPick(COMDT_DESKINFO inDeskInfo, CSDT_RECONN_CAMPPICKINFO[] inCampInfo)
 {
     this.roomInfo = new Assets.Scripts.GameSystem.RoomInfo();
     this.roomInfo.roomAttrib.bGameMode   = inDeskInfo.bGameMode;
     this.roomInfo.roomAttrib.bPkAI       = 0;
     this.roomInfo.roomAttrib.bMapType    = inDeskInfo.bMapType;
     this.roomInfo.roomAttrib.dwMapId     = inDeskInfo.dwMapId;
     this.roomInfo.roomAttrib.bWarmBattle = Convert.ToBoolean(inDeskInfo.bIsWarmBattle);
     this.roomInfo.roomAttrib.npcAILevel  = inDeskInfo.bAILevel;
     for (int i = 0; i < inCampInfo.Length; i++)
     {
         COM_PLAYERCAMP           com_playercamp           = (COM_PLAYERCAMP)(i + 1);
         CSDT_RECONN_CAMPPICKINFO csdt_reconn_camppickinfo = inCampInfo[i];
         this.roomInfo.CampMemberList[i].Clear();
         for (int j = 0; j < csdt_reconn_camppickinfo.dwPlayerNum; j++)
         {
             MemberInfo       item         = new MemberInfo();
             COMDT_PLAYERINFO stPlayerInfo = csdt_reconn_camppickinfo.astPlayerInfo[j].stPickHeroInfo.stPlayerInfo;
             item.isPrepare      = csdt_reconn_camppickinfo.astPlayerInfo[j].bIsPickOK > 0;
             item.RoomMemberType = stPlayerInfo.bObjType;
             item.dwPosOfCamp    = stPlayerInfo.bPosOfCamp;
             item.camp           = com_playercamp;
             item.dwMemberLevel  = stPlayerInfo.dwLevel;
             if (item.RoomMemberType == 1)
             {
                 item.ullUid           = stPlayerInfo.stDetail.stPlayerOfAcnt.ullUid;
                 item.dwMemberPvpLevel = stPlayerInfo.stDetail.stPlayerOfAcnt.dwPvpLevel;
             }
             item.dwObjId    = stPlayerInfo.dwObjId;
             item.MemberName = StringHelper.UTF8BytesToString(ref stPlayerInfo.szName);
             item.ChoiceHero = stPlayerInfo.astChoiceHero;
             item.isGM       = csdt_reconn_camppickinfo.astPlayerInfo[j].stPickHeroInfo.bIsGM > 0;
             if (stPlayerInfo.bObjType == 1)
             {
                 item.dwMemberHeadId = stPlayerInfo.stDetail.stPlayerOfAcnt.dwHeadId;
                 if (stPlayerInfo.stDetail.stPlayerOfAcnt.ullUid == Singleton <CRoleInfoManager> .instance.masterUUID)
                 {
                     this.roomInfo.selfObjID = stPlayerInfo.dwObjId;
                     Singleton <CHeroSelectSystem> .instance.ResetRandHeroLeftCount((int)csdt_reconn_camppickinfo.astPlayerInfo[j].stPickHeroInfo.dwRandomHeroCnt);
                 }
             }
             else if (stPlayerInfo.bObjType == 2)
             {
                 item.dwMemberHeadId = 1;
             }
             this.roomInfo.CampMemberList[i].Add(item);
         }
         this.SortCampMemList(ref this.roomInfo.CampMemberList[i]);
     }
 }
Ejemplo n.º 2
0
        public void UpdateRoomInfo(COMDT_DESKINFO inDeskInfo, CSDT_CAMPINFO[] inCampInfo)
        {
            uint dwObjId = 0;

            if (this.roomInfo == null)
            {
                this.roomInfo = new Assets.Scripts.GameSystem.RoomInfo();
                this.roomInfo.roomAttrib.bGameMode   = inDeskInfo.bGameMode;
                this.roomInfo.roomAttrib.bPkAI       = 0;
                this.roomInfo.roomAttrib.bMapType    = inDeskInfo.bMapType;
                this.roomInfo.roomAttrib.dwMapId     = inDeskInfo.dwMapId;
                this.roomInfo.roomAttrib.bWarmBattle = Convert.ToBoolean(inDeskInfo.bIsWarmBattle);
                this.roomInfo.roomAttrib.npcAILevel  = inDeskInfo.bAILevel;
                for (int i = 0; i < inCampInfo.Length; i++)
                {
                    COM_PLAYERCAMP com_playercamp = (COM_PLAYERCAMP)(i + 1);
                    CSDT_CAMPINFO  csdt_campinfo  = inCampInfo[i];
                    this.roomInfo.CampMemberList[i].Clear();
                    for (int j = 0; j < csdt_campinfo.dwPlayerNum; j++)
                    {
                        MemberInfo       item         = new MemberInfo();
                        COMDT_PLAYERINFO stPlayerInfo = csdt_campinfo.astCampPlayerInfo[j].stPlayerInfo;
                        item.RoomMemberType = stPlayerInfo.bObjType;
                        item.dwPosOfCamp    = stPlayerInfo.bPosOfCamp;
                        item.camp           = com_playercamp;
                        item.dwMemberLevel  = stPlayerInfo.dwLevel;
                        if (item.RoomMemberType == 1)
                        {
                            item.dwMemberPvpLevel = stPlayerInfo.stDetail.stPlayerOfAcnt.dwPvpLevel;
                        }
                        item.dwObjId    = stPlayerInfo.dwObjId;
                        item.MemberName = StringHelper.UTF8BytesToString(ref stPlayerInfo.szName);
                        item.ChoiceHero = stPlayerInfo.astChoiceHero;
                        if (stPlayerInfo.bObjType == 1)
                        {
                            item.dwMemberHeadId = stPlayerInfo.stDetail.stPlayerOfAcnt.dwHeadId;
                            if (stPlayerInfo.stDetail.stPlayerOfAcnt.ullUid == Singleton <CRoleInfoManager> .instance.masterUUID)
                            {
                                dwObjId = stPlayerInfo.dwObjId;
                                Singleton <CHeroSelectSystem> .instance.ResetRandHeroLeftCount((int)csdt_campinfo.astCampPlayerInfo[j].dwRandomHeroCnt);
                            }
                        }
                        else if (stPlayerInfo.bObjType == 2)
                        {
                            item.dwMemberHeadId = 1;
                        }
                        this.roomInfo.CampMemberList[i].Add(item);
                    }
                    this.SortCampMemList(ref this.roomInfo.CampMemberList[i]);
                }
            }
            else
            {
                this.roomInfo.roomAttrib.bGameMode = inDeskInfo.bGameMode;
                this.roomInfo.roomAttrib.bPkAI     = 0;
                this.roomInfo.roomAttrib.bMapType  = inDeskInfo.bMapType;
                this.roomInfo.roomAttrib.dwMapId   = inDeskInfo.dwMapId;
                for (int k = 0; k < inCampInfo.Length; k++)
                {
                    COM_PLAYERCAMP camp           = (COM_PLAYERCAMP)(k + 1);
                    CSDT_CAMPINFO  csdt_campinfo2 = inCampInfo[k];
                    for (int m = 0; m < csdt_campinfo2.dwPlayerNum; m++)
                    {
                        COMDT_PLAYERINFO comdt_playerinfo2 = csdt_campinfo2.astCampPlayerInfo[m].stPlayerInfo;
                        MemberInfo       memberInfo        = this.roomInfo.GetMemberInfo(camp, comdt_playerinfo2.bPosOfCamp);
                        if (memberInfo != null)
                        {
                            memberInfo.dwObjId    = comdt_playerinfo2.dwObjId;
                            memberInfo.camp       = camp;
                            memberInfo.ChoiceHero = comdt_playerinfo2.astChoiceHero;
                            if ((comdt_playerinfo2.bObjType == 1) && (comdt_playerinfo2.stDetail.stPlayerOfAcnt.ullUid == Singleton <CRoleInfoManager> .instance.masterUUID))
                            {
                                dwObjId = comdt_playerinfo2.dwObjId;
                                Singleton <CHeroSelectSystem> .instance.ResetRandHeroLeftCount((int)csdt_campinfo2.astCampPlayerInfo[m].dwRandomHeroCnt);
                            }
                        }
                    }
                }
            }
            this.roomInfo.selfObjID = dwObjId;
        }