Beispiel #1
0
        public void BuildRoomInfo(COMDT_MATCH_SUCC_DETAIL roomData)
        {
            this.roomInfo                        = new Assets.Scripts.GameSystem.RoomInfo();
            this.roomInfo.iRoomEntity            = roomData.iRoomEntity;
            this.roomInfo.dwRoomID               = roomData.dwRoomID;
            this.roomInfo.dwRoomSeq              = roomData.dwRoomSeq;
            this.roomInfo.roomAttrib.bGameMode   = roomData.stRoomInfo.bGameMode;
            this.roomInfo.roomAttrib.bPkAI       = roomData.stRoomInfo.bPkAI;
            this.roomInfo.roomAttrib.bMapType    = roomData.stRoomInfo.bMapType;
            this.roomInfo.roomAttrib.dwMapId     = roomData.stRoomInfo.dwMapId;
            this.roomInfo.roomAttrib.bWarmBattle = Convert.ToBoolean(roomData.stRoomInfo.bIsWarmBattle);
            this.roomInfo.roomAttrib.npcAILevel  = roomData.stRoomInfo.bAILevel;
            this.roomInfo.selfInfo.ullUid        = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().playerUllUID;

            for (int i = 0; i < 2; i++)
            {
                COM_PLAYERCAMP camp = (COM_PLAYERCAMP)(i + 1);
                this.roomInfo.CampMemberList[i].Clear();
                for (int j = 0; j < roomData.stMemInfo.astCampMem[i].dwMemNum; j++)
                {
                    COMDT_ROOMMEMBER_DT memberDT = roomData.stMemInfo.astCampMem[i].astMemInfo[j];
                    MemberInfo          item     = this.CreateMemInfo(ref memberDT, camp, this.roomInfo.roomAttrib.bWarmBattle);
                    this.roomInfo.CampMemberList[i].Add(item);
                }
                this.SortCampMemList(ref this.roomInfo.CampMemberList[i]);
            }
        }
Beispiel #2
0
        private MemberInfo CreateMemInfo(ref COMDT_ROOMMEMBER_DT memberDT, COM_PLAYERCAMP camp, bool bWarmBattle)
        {
            MemberInfo info = new MemberInfo {
                RoomMemberType = memberDT.dwRoomMemberType,
                dwPosOfCamp    = memberDT.dwPosOfCamp,
                camp           = camp
            };

            if (memberDT.dwRoomMemberType == 1)
            {
                info.ullUid           = memberDT.stMemberDetail.stMemberOfAcnt.ullUid;
                info.iFromGameEntity  = memberDT.stMemberDetail.stMemberOfAcnt.iFromGameEntity;
                info.iLogicWorldID    = memberDT.stMemberDetail.stMemberOfAcnt.iLogicWorldID;
                info.MemberName       = StringHelper.UTF8BytesToString(ref memberDT.stMemberDetail.stMemberOfAcnt.szMemberName);
                info.dwMemberLevel    = memberDT.stMemberDetail.stMemberOfAcnt.dwMemberLevel;
                info.dwMemberPvpLevel = memberDT.stMemberDetail.stMemberOfAcnt.dwMemberPvpLevel;
                info.dwMemberHeadId   = memberDT.stMemberDetail.stMemberOfAcnt.dwMemberHeadId;
                info.MemberHeadUrl    = StringHelper.UTF8BytesToString(ref memberDT.stMemberDetail.stMemberOfAcnt.szMemberHeadUrl);
                info.ChoiceHero       = new COMDT_CHOICEHERO[] { new COMDT_CHOICEHERO() };
                info.isPrepare        = false;
                info.dwObjId          = 0;
                return(info);
            }
            if (memberDT.dwRoomMemberType == 2)
            {
                NpcUlId             += (ulong)1L;
                info.ullUid          = NpcUlId;
                info.iFromGameEntity = 0;
                info.MemberName      = Singleton <CTextManager> .GetInstance().GetText("PVP_NPC");

                info.dwMemberLevel  = memberDT.stMemberDetail.stMemberOfNpc.bLevel;
                info.dwMemberHeadId = 1;
                info.ChoiceHero     = new COMDT_CHOICEHERO[] { new COMDT_CHOICEHERO() };
                info.isPrepare      = true;
                info.dwObjId        = 0;
                info.WarmNpc        = memberDT.stMemberDetail.stMemberOfNpc.stDetail;
                if (bWarmBattle)
                {
                    info.ullUid           = info.WarmNpc.ullUid;
                    info.dwMemberPvpLevel = info.WarmNpc.dwAcntPvpLevel;
                    info.MemberName       = StringHelper.UTF8BytesToString(ref info.WarmNpc.szUserName);
                    info.MemberHeadUrl    = StringHelper.UTF8BytesToString(ref info.WarmNpc.szUserHeadUrl);
                    info.isPrepare        = false;
                }
            }
            return(info);
        }
Beispiel #3
0
        public void BuildRoomInfo(COMDT_JOINMULTGAMERSP_SUCC roomData)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                this.roomInfo                        = new Assets.Scripts.GameSystem.RoomInfo();
                this.roomInfo.iRoomEntity            = roomData.iRoomEntity;
                this.roomInfo.dwRoomID               = roomData.dwRoomID;
                this.roomInfo.dwRoomSeq              = roomData.dwRoomSeq;
                this.roomInfo.roomAttrib.bGameMode   = roomData.stRoomInfo.bGameMode;
                this.roomInfo.roomAttrib.bPkAI       = 0;
                this.roomInfo.roomAttrib.bMapType    = roomData.stRoomInfo.bMapType;
                this.roomInfo.roomAttrib.dwMapId     = roomData.stRoomInfo.dwMapId;
                this.roomInfo.roomAttrib.bWarmBattle = false;
                this.roomInfo.roomAttrib.npcAILevel  = 2;
                this.roomInfo.selfInfo.ullUid        = roomData.ullSelfUid;
                this.roomInfo.selfInfo.iGameEntity   = roomData.iSelfGameEntity;
                this.roomInfo.roomOwner.ullUid       = roomData.stRoomMaster.ullMasterUid;
                this.roomInfo.roomOwner.iGameEntity  = roomData.stRoomMaster.iMasterGameEntity;
                for (int i = 0; i < 2; i++)
                {
                    COM_PLAYERCAMP camp = (COM_PLAYERCAMP)(i + 1);
                    this.roomInfo.CampMemberList[i].Clear();
                    for (int j = 0; j < roomData.stMemInfo.astCampMem[i].dwMemNum; j++)
                    {
                        COMDT_ROOMMEMBER_DT memberDT = roomData.stMemInfo.astCampMem[i].astMemInfo[j];
                        MemberInfo          item     = this.CreateMemInfo(ref memberDT, camp, this.roomInfo.roomAttrib.bWarmBattle);
                        if (item.ullUid == masterRoleInfo.playerUllUID)
                        {
                            this.roomInfo.selfObjID = item.dwObjId;
                        }
                        this.roomInfo.CampMemberList[i].Add(item);
                    }
                    this.SortCampMemList(ref this.roomInfo.CampMemberList[i]);
                }
            }
        }