Пример #1
0
        public static void SetRoomData(GameObject root, RoomInfo data)
        {
            SetStartBtnStatus(root, data);
            UpdateBtnStatus(root, data);
            ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId);
            int num = pvpMapCommonInfo.bMaxAcntNum / 2;

            root.transform.Find("Panel_Main/MapInfo/txtMapName").gameObject.GetComponent <Text>().text = pvpMapCommonInfo.szName;
            root.transform.Find("Panel_Main/MapInfo/txtTeam").gameObject.GetComponent <Text>().text    = Singleton <CTextManager> .instance.GetText(string.Format("Common_Team_Player_Type_{0}", num));

            GameObject item             = null;
            MemberInfo memberInfo       = null;
            MemberInfo masterMemberInfo = data.GetMasterMemberInfo();

            DebugHelper.Assert(masterMemberInfo != null);
            for (int i = 1; i <= 5; i++)
            {
                item       = root.transform.Find(string.Format("Panel_Main/Left_Player{0}", i)).gameObject;
                memberInfo = data.GetMemberInfo(COM_PLAYERCAMP.COM_PLAYERCAMP_1, i - 1);
                SetPlayerSlotData(item, memberInfo, masterMemberInfo, COM_PLAYERCAMP.COM_PLAYERCAMP_1, i - 1, num >= i);
            }
            for (int j = 1; j <= 5; j++)
            {
                item       = root.transform.Find(string.Format("Panel_Main/Right_Player{0}", j)).gameObject;
                memberInfo = data.GetMemberInfo(COM_PLAYERCAMP.COM_PLAYERCAMP_2, j - 1);
                SetPlayerSlotData(item, memberInfo, masterMemberInfo, COM_PLAYERCAMP.COM_PLAYERCAMP_2, j - 1, num >= j);
            }
            SetComEnable(CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId).stPickRuleInfo.bPickType != 3);
        }
        public static SLevelContext CreatePvpLevelContext(byte mapType, uint mapID, COM_GAME_TYPE GameType, int difficult)
        {
            SLevelContext sLevelContext = new SLevelContext();

            sLevelContext.SetGameType(GameType);
            sLevelContext.m_mapType             = (int)mapType;
            sLevelContext.m_levelDifficulty     = difficult;
            sLevelContext.m_horizonEnableMethod = Horizon.EnableMethod.EnableAll;
            ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(mapType, mapID);

            sLevelContext.InitPvpData(pvpMapCommonInfo, mapID);
            if (mapType != 1)
            {
                if (mapType != 3)
                {
                    if (mapType == 4)
                    {
                        ResEntertainmentLevelInfo dataByKey = GameDataMgr.entertainLevelDatabin.GetDataByKey(mapID);
                        sLevelContext.m_entertainmentSubMapType = (int)dataByKey.bEntertainmentSubType;
                    }
                    else if (mapType == 5)
                    {
                        ResRewardMatchLevelInfo dataByKey2 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(mapID);
                        sLevelContext.m_SecondName = dataByKey2.szMatchName;
                    }
                    else if (mapType == 2)
                    {
                    }
                }
            }
            return(sLevelContext);
        }
Пример #3
0
        public static void SetRoomData(GameObject root, RoomInfo data)
        {
            CRoomView.SetStartBtnStatus(root, data);
            CRoomView.UpdateBtnStatus(root, data);
            ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId);
            int num = (int)(pvpMapCommonInfo.bMaxAcntNum / 2);

            root.transform.Find("Panel_Main/MapInfo/txtMapName").gameObject.GetComponent <Text>().text = pvpMapCommonInfo.szName;
            root.transform.Find("Panel_Main/MapInfo/txtTeam").gameObject.GetComponent <Text>().text    = Singleton <CTextManager> .get_instance().GetText(string.Format("Common_Team_Player_Type_{0}", num));

            MemberInfo masterMemberInfo = data.GetMasterMemberInfo();

            DebugHelper.Assert(masterMemberInfo != null);
            for (int i = 1; i <= 5; i++)
            {
                GameObject gameObject = root.transform.Find(string.Format("Panel_Main/LeftPlayers/Left_Player{0}", i)).gameObject;
                MemberInfo memberInfo = data.GetMemberInfo(1, i - 1);
                CRoomView.SetPlayerSlotData(gameObject, memberInfo, masterMemberInfo, 1, i - 1, num >= i);
            }
            for (int j = 1; j <= 5; j++)
            {
                GameObject gameObject = root.transform.Find(string.Format("Panel_Main/RightPlayers/Right_Player{0}", j)).gameObject;
                MemberInfo memberInfo = data.GetMemberInfo(2, j - 1);
                CRoomView.SetPlayerSlotData(gameObject, memberInfo, masterMemberInfo, 2, j - 1, num >= j);
            }
            ResDT_LevelCommonInfo pvpMapCommonInfo2 = CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId);

            CRoomView.SetComEnable(pvpMapCommonInfo2.stPickRuleInfo.bPickType != 3);
        }
Пример #4
0
        public static void UpdateBtnStatus(GameObject root, RoomInfo data)
        {
            ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId);
            int  bMaxAcntNum     = (int)pvpMapCommonInfo.bMaxAcntNum;
            bool isSelfRoomOwner = Singleton <CRoomSystem> .GetInstance().IsSelfRoomOwner;

            GameObject gameObject  = root.transform.Find("Panel_Main/bg1/LeftRobot").gameObject;
            GameObject gameObject2 = root.transform.Find("Panel_Main/bg2/RightRobot").gameObject;

            gameObject.CustomSetActive(false);
            gameObject2.CustomSetActive(false);
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

            if (isSelfRoomOwner && masterRoleInfo != null)
            {
                MemberInfo memberInfo = data.GetMemberInfo(masterRoleInfo.playerUllUID);
                if (memberInfo != null)
                {
                    COM_PLAYERCAMP cOM_PLAYERCAMP = (memberInfo.camp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) ? COM_PLAYERCAMP.COM_PLAYERCAMP_2 : COM_PLAYERCAMP.COM_PLAYERCAMP_1;
                    if (data.GetFreePos(memberInfo.camp, bMaxAcntNum) >= 0)
                    {
                        if (memberInfo.camp == COM_PLAYERCAMP.COM_PLAYERCAMP_1)
                        {
                            gameObject.CustomSetActive(true);
                        }
                        else
                        {
                            gameObject2.CustomSetActive(true);
                        }
                    }
                    if (data.GetFreePos(cOM_PLAYERCAMP, bMaxAcntNum) >= 0)
                    {
                        if (cOM_PLAYERCAMP == COM_PLAYERCAMP.COM_PLAYERCAMP_1)
                        {
                            gameObject.CustomSetActive(true);
                        }
                        else
                        {
                            gameObject2.CustomSetActive(true);
                        }
                    }
                }
            }
            CUIEventScript component = gameObject.GetComponent <CUIEventScript>();

            component.m_onClickEventID         = enUIEventID.Room_AddRobot;
            component.m_onClickEventParams.tag = 1;
            component = gameObject2.GetComponent <CUIEventScript>();
            component.m_onClickEventID         = enUIEventID.Room_AddRobot;
            component.m_onClickEventParams.tag = 2;
        }
Пример #5
0
        private static void GotoHeroSelectPage()
        {
            bInFakeConfirm       = false;
            RealPlayerConfirmNum = 0;
            FakePlayerConfirmNum = 0;
            Singleton <LobbyLogic> .GetInstance().inMultiRoom = false;

            RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo;

            if (roomInfo != null)
            {
                ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(roomInfo.roomAttrib.bMapType, roomInfo.roomAttrib.dwMapId);
                Singleton <CHeroSelectBaseSystem> .instance.OpenForm(enSelectGameType.enPVE_Computer, pvpMapCommonInfo.bHeroNum, roomInfo.roomAttrib.dwMapId, roomInfo.roomAttrib.bMapType, pvpMapCommonInfo.bIsAllowHeroDup);

                Singleton <CTimerManager> .GetInstance().RemoveTimer(new CTimer.OnTimeUpHandler(CFakePvPHelper.OnConfirmTimout));
            }
        }
Пример #6
0
        public static void SetRoomData(GameObject root, RoomInfo data)
        {
            ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId);
            int num = (int)(pvpMapCommonInfo.bMaxAcntNum / 2);

            CRoomView.SetStartBtnStatus(root, data, (int)pvpMapCommonInfo.bMaxAcntNum);
            CRoomView.UpdateBtnStatus(root, data);
            if (data.fromType == COM_ROOM_FROMTYPE.COM_ROOM_FROM_QQSPROT)
            {
                Transform transform = root.transform.Find("Btn_Back");
                if (transform)
                {
                    transform.gameObject.CustomSetActive(false);
                }
            }
            root.transform.Find("Panel_Main/MapInfo/txtMapName").gameObject.GetComponent <Text>().set_text(pvpMapCommonInfo.szName);
            root.transform.Find("Panel_Main/MapInfo/txtTeam").gameObject.GetComponent <Text>().set_text(Singleton <CTextManager> .instance.GetText(string.Format("Common_Team_Player_Type_{0}", num)));
            MemberInfo masterMemberInfo = data.GetMasterMemberInfo();

            DebugHelper.Assert(masterMemberInfo != null);
            COM_ROOM_FROMTYPE fromType = data.fromType;

            for (int i = 1; i <= 5; i++)
            {
                GameObject gameObject = root.transform.Find(string.Format("Panel_Main/LeftPlayers/Left_Player{0}", i)).gameObject;
                MemberInfo memberInfo = data.GetMemberInfo(COM_PLAYERCAMP.COM_PLAYERCAMP_1, i - 1);
                CRoomView.SetPlayerSlotData(gameObject, memberInfo, masterMemberInfo, COM_PLAYERCAMP.COM_PLAYERCAMP_1, i - 1, num >= i, fromType);
            }
            for (int j = 1; j <= 5; j++)
            {
                GameObject gameObject2 = root.transform.Find(string.Format("Panel_Main/RightPlayers/Right_Player{0}", j)).gameObject;
                MemberInfo memberInfo2 = data.GetMemberInfo(COM_PLAYERCAMP.COM_PLAYERCAMP_2, j - 1);
                CRoomView.SetPlayerSlotData(gameObject2, memberInfo2, masterMemberInfo, COM_PLAYERCAMP.COM_PLAYERCAMP_2, j - 1, num >= j, fromType);
            }
            ResDT_LevelCommonInfo pvpMapCommonInfo2 = CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId);

            CRoomView.SetComEnable(pvpMapCommonInfo2.stPickRuleInfo.bPickType != 3);
            if (fromType == COM_ROOM_FROMTYPE.COM_ROOM_FROM_QQSPROT)
            {
                CRoomView.DontShowComEnable(false);
            }
        }
Пример #7
0
        public void ShowNormal(SCPKG_INVITE_JOIN_GAME_REQ info)
        {
            string          text            = CUIUtility.RemoveEmoji(StringHelper.UTF8BytesToString(ref info.stInviterInfo.szName));
            stUIEventParams stUIEventParams = default(stUIEventParams);

            stUIEventParams.tag = (int)info.bIndex;
            int num = 15;

            int.TryParse(Singleton <CTextManager> .get_instance().GetText("MessageBox_Close_Time"), ref num);
            this.form = Singleton <CUIManager> .GetInstance().OpenForm(string.Format("{0}{1}", "UGUI/Form/Common/", "Form_BeInvited.prefab"), false, false);

            GameObject gameObject = this.form.transform.Find("Panel/Panel/normal").gameObject;

            if (gameObject != null)
            {
                gameObject.CustomSetActive(true);
            }
            GameObject gameObject2 = this.form.transform.Find("Panel/Panel/refuse").gameObject;

            if (gameObject2 != null)
            {
                gameObject2.CustomSetActive(false);
            }
            this.listNode     = this.form.transform.Find("Panel/Panel/refuse/reasonPanel/DropList").gameObject;
            this.listScript   = this.listNode.transform.Find("List").GetComponent <CUIListScript>();
            this.m_inputFiled = this.form.transform.Find("Panel/Panel/refuse/reasonPanel/InputField").GetComponent <InputField>();
            this.m_sendBtn    = this.form.transform.Find("Panel/Panel/refuse/btnGroup/Button_Send").gameObject;
            this.form.transform.Find("Panel/Panel/refuse/MatchInfo").GetComponent <Text>().text = Singleton <CTextManager> .get_instance().GetText("Invite_Refuse_Title");

            if (this.form != null)
            {
                string text2 = null;
                string text3 = null;
                if (info.bInviteType == 1)
                {
                    ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(info.stInviteDetail.get_stRoomDetail().bMapType, info.stInviteDetail.get_stRoomDetail().dwMapId);
                    stUIEventParams.heroId      = (uint)info.stInviteDetail.get_stRoomDetail().bMapType;
                    stUIEventParams.weakGuideId = info.stInviteDetail.get_stRoomDetail().dwMapId;
                    if (pvpMapCommonInfo != null)
                    {
                        text2 = Singleton <CTextManager> .get_instance().GetText("Invite_Map_Desc", new string[]
                        {
                            ((int)(pvpMapCommonInfo.bMaxAcntNum / 2)).ToString(),
                            ((int)(pvpMapCommonInfo.bMaxAcntNum / 2)).ToString(),
                            Utility.UTF8Convert(pvpMapCommonInfo.szName)
                        });
                    }
                    text3 = Singleton <CTextManager> .GetInstance().GetText("Invite_Match_Type_4");
                }
                else if (info.bInviteType == 2)
                {
                    ResDT_LevelCommonInfo pvpMapCommonInfo2 = CLevelCfgLogicManager.GetPvpMapCommonInfo(info.stInviteDetail.get_stTeamDetail().bMapType, info.stInviteDetail.get_stTeamDetail().dwMapId);
                    stUIEventParams.heroId      = (uint)info.stInviteDetail.get_stTeamDetail().bMapType;
                    stUIEventParams.weakGuideId = info.stInviteDetail.get_stTeamDetail().dwMapId;
                    if (pvpMapCommonInfo2 != null)
                    {
                        text2 = Singleton <CTextManager> .get_instance().GetText("Invite_Map_Desc", new string[]
                        {
                            ((int)(pvpMapCommonInfo2.bMaxAcntNum / 2)).ToString(),
                            ((int)(pvpMapCommonInfo2.bMaxAcntNum / 2)).ToString(),
                            Utility.UTF8Convert(pvpMapCommonInfo2.szName)
                        });
                    }
                    if (info.stInviteDetail.get_stTeamDetail().bMapType == 3)
                    {
                        text3 = Singleton <CTextManager> .GetInstance().GetText("Invite_Match_Type_1");
                    }
                    else
                    {
                        text3 = Singleton <CTextManager> .GetInstance().GetText((info.stInviteDetail.get_stTeamDetail().bPkAI != 1) ? "Invite_Match_Type_3" : "Invite_Match_Type_2");
                    }
                }
                string text4 = Singleton <CTextManager> .get_instance().GetText("Be_Invited_Tips", new string[]
                {
                    text3,
                    text2
                });

                this.form.m_formWidgets[8].GetComponent <Text>().text = text4;
                uint   dwRelationMask = info.stInviterInfo.dwRelationMask;
                string text5;
                if ((dwRelationMask & 1u) > 0u)
                {
                    text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_1");

                    stUIEventParams.tag2 = 0;
                }
                else if ((dwRelationMask & 2u) > 0u)
                {
                    text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_4");

                    stUIEventParams.tag2 = 1;
                }
                else if ((dwRelationMask & 4u) > 0u)
                {
                    text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_5");

                    stUIEventParams.tag2 = 2;
                    CSDT_LBS_USER_INFO lBSUserInfo = Singleton <CFriendContoller> .get_instance().model.GetLBSUserInfo(info.stInviterInfo.ullUid, info.stInviterInfo.dwLogicWorldID, CFriendModel.LBSGenderType.Both);

                    if (lBSUserInfo != null)
                    {
                        stUIEventParams.tagUInt = lBSUserInfo.dwGameSvrEntity;
                    }
                }
                else
                {
                    text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_1");

                    stUIEventParams.tag2 = 3;
                }
                string text6 = string.Format(Singleton <CTextManager> .get_instance().GetText("Be_Invited_FromType"), text5);
                this.form.m_formWidgets[6].GetComponent <Text>().text = text6;
                stUIEventParams.tagStr             = string.Format("<color=#FFFFFF>{0}</color> {1} {2}", text, text4, text6);
                stUIEventParams.commonUInt64Param1 = info.stInviterInfo.ullUid;
                stUIEventParams.taskId             = info.stInviterInfo.dwLogicWorldID;
                stUIEventParams.tag3 = (int)info.bInviteType;
                if (num != 0)
                {
                    Transform transform = this.form.transform.Find("closeTimer");
                    if (transform != null)
                    {
                        this.timerScript = transform.GetComponent <CUITimerScript>();
                        if (this.timerScript != null)
                        {
                            this.timerScript.enabled = true;
                            this.timerScript.SetTotalTime((float)num);
                            this.timerScript.StartTimer();
                            this.timerScript.m_eventIDs[1]    = enUIEventID.Invite_TimeOut;
                            this.timerScript.m_eventParams[1] = stUIEventParams;
                        }
                    }
                }
                this.form.m_formWidgets[0].GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Invite_RefuseReason_Send, stUIEventParams);
                this.form.m_formWidgets[1].GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Invite_AcceptInvite, stUIEventParams);
                this.form.m_formWidgets[5].GetComponent <Text>().text = text;
                COM_SNSGENDER bGender   = info.stInviterInfo.bGender;
                Image         component = this.form.m_formWidgets[4].GetComponent <Image>();
                component.gameObject.CustomSetActive(bGender != 0);
                if (bGender == 1)
                {
                    CUIUtility.SetImageSprite(component, string.Format("{0}icon/Ico_boy.prefab", "UGUI/Sprite/Dynamic/"), null, true, false, false, false);
                }
                else if (bGender == 2)
                {
                    CUIUtility.SetImageSprite(component, string.Format("{0}icon/Ico_girl.prefab", "UGUI/Sprite/Dynamic/"), null, true, false, false, false);
                }
                CUIHttpImageScript component2 = this.form.m_formWidgets[3].GetComponent <CUIHttpImageScript>();
                component2.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(StringHelper.UTF8BytesToString(ref info.stInviterInfo.szHeadUrl)));
                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(this.form.m_formWidgets[2].GetComponent <Image>(), (int)info.stInviterInfo.dwHeadImgId);

                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBkEffect(this.form.m_formWidgets[2].GetComponent <Image>(), (int)info.stInviterInfo.dwHeadImgId, this.form, 1f);

                this.form.m_formWidgets[7].CustomSetActive(info.stInviterInfo.bGradeOfRank > 0);
                if (info.stInviterInfo.bGradeOfRank > 0)
                {
                    CLadderView.ShowRankDetail(this.form.m_formWidgets[7], info.stInviterInfo.bGradeOfRank, 0u, 1u, false, true, false, true, true);
                }
            }
        }
Пример #8
0
        private static void ReqStartSingleWarmBattle()
        {
            CFakePvPHelper.bInFakeSelect = false;
            Singleton <CTimerManager> .GetInstance().RemoveTimer(new CTimer.OnTimeUpHandler(CFakePvPHelper.OnSelectHeroTimeout));

            CFakePvPHelper.RemoveAllFakeTimer();
            CSPkg    cSPkg    = NetworkModule.CreateDefaultCSPKG(1050u);
            RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo;

            if (roomInfo == null)
            {
                DebugHelper.Assert(roomInfo != null, "RoomInfo Should not be NULL!!!");
                return;
            }
            if (roomInfo != null)
            {
                cSPkg.stPkgData.get_stStartSingleGameReq().stBattleParam.bGameType = 1;
                cSPkg.stPkgData.get_stStartSingleGameReq().stBattleParam.stGameDetail.set_stGameOfCombat(Singleton <CHeroSelectBaseSystem> .get_instance().m_stGameOfCombat);
                cSPkg.stPkgData.get_stStartSingleGameReq().stBattleList.stBattleList.wHeroCnt = 1;
                if (cSPkg.stPkgData.get_stStartSingleGameReq().stBattleParam.stGameDetail.get_stGameOfCombat() == null)
                {
                    return;
                }
                MemberInfo masterMemberInfo = roomInfo.GetMasterMemberInfo();
                if (masterMemberInfo == null)
                {
                    DebugHelper.Assert(roomInfo != null, "selfInfo Should not be NULL!!!");
                    return;
                }
                cSPkg.stPkgData.get_stStartSingleGameReq().stBattleList.stBattleList.BattleHeroList[0] = masterMemberInfo.ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID;
                ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(roomInfo.roomAttrib.bMapType, roomInfo.roomAttrib.dwMapId);
                if (pvpMapCommonInfo != null)
                {
                    COM_PLAYERCAMP cOM_PLAYERCAMP = 1;
                    int            dwHeroID       = 0;
                    for (COM_PLAYERCAMP cOM_PLAYERCAMP2 = 1; cOM_PLAYERCAMP2 < 3; cOM_PLAYERCAMP2++)
                    {
                        ListView <MemberInfo> listView = roomInfo[cOM_PLAYERCAMP2];
                        for (int i = 0; i < listView.get_Count(); i++)
                        {
                            if (listView.get_Item(i).ullUid == roomInfo.selfInfo.ullUid)
                            {
                                cOM_PLAYERCAMP = listView.get_Item(i).camp;
                                dwHeroID       = (int)listView.get_Item(i).ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID;
                                break;
                            }
                        }
                    }
                    CSDT_BATTLE_PLAYER_BRIEF stBattlePlayer = cSPkg.stPkgData.get_stStartSingleGameReq().stBattlePlayer;
                    int num = 0;
                    for (COM_PLAYERCAMP cOM_PLAYERCAMP3 = 1; cOM_PLAYERCAMP3 < 3; cOM_PLAYERCAMP3++)
                    {
                        ListView <MemberInfo> listView2 = roomInfo[cOM_PLAYERCAMP3];
                        for (int j = 0; j < listView2.get_Count(); j++)
                        {
                            MemberInfo memberInfo = listView2.get_Item(j);
                            if (memberInfo != null)
                            {
                                if (memberInfo.RoomMemberType == 2u)
                                {
                                    stBattlePlayer.astFighter[num].bObjType   = 2;
                                    stBattlePlayer.astFighter[num].bPosOfCamp = (byte)j;
                                    stBattlePlayer.astFighter[num].bObjCamp   = cOM_PLAYERCAMP3;
                                    stBattlePlayer.astFighter[num].dwLevel    = memberInfo.dwMemberPvpLevel;
                                    CFakePvPHelper.FakeHeroSelect fakeHeroSelect = CFakePvPHelper.GetFakeHeroSelect(memberInfo.ullUid);
                                    if (fakeHeroSelect != null)
                                    {
                                        stBattlePlayer.astFighter[num].astChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID             = fakeHeroSelect.selectedHero;
                                        stBattlePlayer.astFighter[num].astChoiceHero[0].stBaseInfo.stCommonInfo.stSkill.dwSelSkillID = fakeHeroSelect.selectedPlayerSkill;
                                        stBattlePlayer.astFighter[num].astChoiceHero[0].stBaseInfo.stCommonInfo.wSkinID = (ushort)fakeHeroSelect.selectedSkin;
                                        stBattlePlayer.astFighter[num].szName = fakeHeroSelect.FakePlayer.szUserName;
                                        stBattlePlayer.astFighter[num].stDetail.set_stPlayerOfNpc(new COMDT_PLAYERINFO_OF_NPC());
                                        stBattlePlayer.astFighter[num].stDetail.get_stPlayerOfNpc().ullFakeUid         = fakeHeroSelect.FakePlayer.ullUid;
                                        stBattlePlayer.astFighter[num].stDetail.get_stPlayerOfNpc().dwFakePvpLevel     = fakeHeroSelect.FakePlayer.dwAcntPvpLevel;
                                        stBattlePlayer.astFighter[num].stDetail.get_stPlayerOfNpc().dwFakeLogicWorldID = fakeHeroSelect.FakePlayer.dwLogicWorldId;
                                    }
                                    else
                                    {
                                        CFakePvPHelper.SelectHeroForEnemyPlayer(ref stBattlePlayer.astFighter[num].astChoiceHero[0].stBaseInfo, stBattlePlayer.astFighter[num].dwLevel);
                                        stBattlePlayer.astFighter[num].szName = memberInfo.WarmNpc.szUserName;
                                        stBattlePlayer.astFighter[num].stDetail.set_stPlayerOfNpc(new COMDT_PLAYERINFO_OF_NPC());
                                        stBattlePlayer.astFighter[num].stDetail.get_stPlayerOfNpc().ullFakeUid         = memberInfo.WarmNpc.ullUid;
                                        stBattlePlayer.astFighter[num].stDetail.get_stPlayerOfNpc().dwFakePvpLevel     = memberInfo.WarmNpc.dwAcntPvpLevel;
                                        stBattlePlayer.astFighter[num].stDetail.get_stPlayerOfNpc().dwFakeLogicWorldID = memberInfo.WarmNpc.dwLogicWorldId;
                                    }
                                }
                                else if (memberInfo.RoomMemberType == 1u)
                                {
                                    stBattlePlayer.astFighter[num].bObjType   = 1;
                                    stBattlePlayer.astFighter[num].bPosOfCamp = (byte)j;
                                    stBattlePlayer.astFighter[num].bObjCamp   = cOM_PLAYERCAMP;
                                    for (int k = 0; k < (int)pvpMapCommonInfo.bHeroNum; k++)
                                    {
                                        stBattlePlayer.astFighter[num].astChoiceHero[k].stBaseInfo.stCommonInfo.dwHeroID = (uint)dwHeroID;
                                    }
                                }
                                num++;
                            }
                        }
                    }
                    stBattlePlayer.bNum             = (byte)num;
                    roomInfo.roomAttrib.bWarmBattle = false;
                    roomInfo.roomAttrib.npcAILevel  = 2;
                    Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref cSPkg, true);

                    Singleton <WatchController> .GetInstance().Stop();
                }
            }
        }
Пример #9
0
        private void UpdateElement(GameObject element, string name, string headUrl, byte bGrade, uint subGrade, uint heroId, enOBTab curTab, int onlineNum, enStatus status = 0, long localTicks = 0, byte mapType = 0, uint mapId = 0)
        {
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(OB_FORM_PATH);

            if (form != null)
            {
                CUIHttpImageScript componetInChild = Utility.GetComponetInChild <CUIHttpImageScript>(element, "HeadImg");
                Image      image  = Utility.GetComponetInChild <Image>(element, "HeroImg");
                Image      image2 = Utility.GetComponetInChild <Image>(element, "RankImg");
                Image      image3 = Utility.GetComponetInChild <Image>(element, "RankImg/SubRankImg");
                Text       text   = Utility.GetComponetInChild <Text>(element, "PlayerName");
                Text       text2  = Utility.GetComponetInChild <Text>(element, "HeroName");
                GameObject obj2   = Utility.FindChild(element, "WatchImg");
                Text       text3  = Utility.GetComponetInChild <Text>(element, "LocalTime");
                Text       text4  = Utility.GetComponetInChild <Text>(element, "LocalMap");
                Text       text5  = Utility.GetComponetInChild <Text>(element, "WatchImg/OnlineCount");
                GameObject obj3   = Utility.FindChild(element, "DeleteBtn");
                componetInChild.SetImageUrl(headUrl);
                if (bGrade > 0)
                {
                    image2.gameObject.CustomSetActive(true);
                    image2.SetSprite(CLadderView.GetRankSmallIconPath(bGrade, subGrade), form, true, false, false);
                    image3.SetSprite(CLadderView.GetSubRankSmallIconPath(bGrade, subGrade), form, true, false, false);
                }
                else
                {
                    image2.gameObject.CustomSetActive(false);
                }
                text.text = name;
                ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroId);
                if (dataByKey != null)
                {
                    string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, CSkinInfo.GetHeroSkinPic(heroId, 0));
                    image.SetSprite(prefabPath, form, false, true, true);
                    text2.text = dataByKey.szName;
                }
                else
                {
                    text2.text = string.Empty;
                    DebugHelper.Assert(false, string.Format("COBSystem UpdateElement hero cfg[{0}] can not be found!", heroId));
                }
                if (curTab != enOBTab.Local)
                {
                    obj2.CustomSetActive(true);
                    string[] args = new string[] { onlineNum.ToString() };
                    text5.text = Singleton <CTextManager> .instance.GetText("OB_Desc_3", args);

                    text3.gameObject.SetActive(false);
                    obj3.CustomSetActive(false);
                    text4.gameObject.CustomSetActive(false);
                }
                else
                {
                    obj2.CustomSetActive(false);
                    text3.gameObject.SetActive(true);
                    DateTime time       = new DateTime(localTicks);
                    string[] textArray2 = new string[] { time.Month.ToString(), time.Day.ToString(), time.Hour.ToString("D2"), time.Minute.ToString("D2") };
                    text3.text = Singleton <CTextManager> .instance.GetText("OB_Desc_12", textArray2);

                    obj3.CustomSetActive(status == enStatus.Editor);
                    text4.gameObject.CustomSetActive(true);
                    ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(mapType, mapId);
                    if (pvpMapCommonInfo != null)
                    {
                        text4.text = pvpMapCommonInfo.szName;
                    }
                    else
                    {
                        text4.text = string.Empty;
                    }
                }
            }
        }
Пример #10
0
        private void UpdateElement(GameObject element, string name, string headUrl, byte bGrade, uint subGrade, uint heroId, COBSystem.enOBTab curTab, int onlineNum, COBSystem.enStatus status = COBSystem.enStatus.Normal, long localTicks = 0L, byte mapType = 0, uint mapId = 0u, string localName = "")
        {
            CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(COBSystem.OB_FORM_PATH);

            if (form == null)
            {
                return;
            }
            CUIHttpImageScript componetInChild = Utility.GetComponetInChild <CUIHttpImageScript>(element, "HeadImg");
            Image      componetInChild2        = Utility.GetComponetInChild <Image>(element, "HeroImg");
            Image      componetInChild3        = Utility.GetComponetInChild <Image>(element, "RankImg");
            Image      componetInChild4        = Utility.GetComponetInChild <Image>(element, "RankImg/SubRankImg");
            Text       componetInChild5        = Utility.GetComponetInChild <Text>(element, "PlayerName");
            Text       componetInChild6        = Utility.GetComponetInChild <Text>(element, "HeroName");
            GameObject obj = Utility.FindChild(element, "WatchImg");
            Text       componetInChild7 = Utility.GetComponetInChild <Text>(element, "LocalTime");
            Text       componetInChild8 = Utility.GetComponetInChild <Text>(element, "LocalMap");
            Text       componetInChild9 = Utility.GetComponetInChild <Text>(element, "WatchImg/OnlineCount");
            GameObject obj2             = Utility.FindChild(element, "DeleteBtn");

            componetInChild.SetImageUrl(headUrl);
            if (bGrade > 0)
            {
                componetInChild3.gameObject.CustomSetActive(true);
                componetInChild3.SetSprite(CLadderView.GetRankSmallIconPath(bGrade, subGrade), form, true, false, false, false);
                componetInChild4.SetSprite(CLadderView.GetSubRankSmallIconPath(bGrade, subGrade), form, true, false, false, false);
            }
            else
            {
                componetInChild3.gameObject.CustomSetActive(false);
            }
            componetInChild5.text = name;
            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroId);

            if (dataByKey != null)
            {
                string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, CSkinInfo.GetHeroSkinPic(heroId, 0u));
                componetInChild2.SetSprite(prefabPath, form, false, true, true, false);
                componetInChild6.text = dataByKey.szName;
            }
            else
            {
                componetInChild6.text = string.Empty;
                DebugHelper.Assert(false, string.Format("COBSystem UpdateElement hero cfg[{0}] can not be found!", heroId));
            }
            if (curTab != COBSystem.enOBTab.Local)
            {
                obj.CustomSetActive(true);
                componetInChild9.text = Singleton <CTextManager> .get_instance().GetText("OB_Desc_3", new string[]
                {
                    onlineNum.ToString()
                });

                componetInChild7.gameObject.SetActive(false);
                obj2.CustomSetActive(false);
                componetInChild8.gameObject.CustomSetActive(false);
            }
            else
            {
                obj.CustomSetActive(false);
                componetInChild7.gameObject.SetActive(true);
                DateTime dateTime = new DateTime(localTicks);
                componetInChild7.text = Singleton <CTextManager> .get_instance().GetText("OB_Desc_12", new string[]
                {
                    dateTime.get_Month().ToString(),
                    dateTime.get_Day().ToString(),
                    dateTime.get_Hour().ToString("D2"),
                    dateTime.get_Minute().ToString("D2")
                });

                obj2.CustomSetActive(status == COBSystem.enStatus.Editor);
                componetInChild8.gameObject.CustomSetActive(true);
                ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(mapType, mapId);
                if (pvpMapCommonInfo != null)
                {
                    componetInChild8.text = pvpMapCommonInfo.szName;
                }
                else
                {
                    componetInChild8.text = string.Empty;
                }
                componetInChild6.text = string.Empty;
            }
        }
Пример #11
0
        private static void ReqStartSingleWarmBattle()
        {
            bInFakeSelect = false;
            Singleton <CTimerManager> .GetInstance().RemoveTimer(new CTimer.OnTimeUpHandler(CFakePvPHelper.OnSelectHeroTimeout));

            RemoveAllFakeTimer();
            CSPkg    msg      = NetworkModule.CreateDefaultCSPKG(0x41a);
            RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo;

            if (roomInfo == null)
            {
                DebugHelper.Assert(roomInfo != null, "RoomInfo Should not be NULL!!!");
            }
            else if (roomInfo != null)
            {
                msg.stPkgData.stStartSingleGameReq.stBattleParam.bGameType = 1;
                msg.stPkgData.stStartSingleGameReq.stBattleParam.stGameDetail.stGameOfCombat = Singleton <CHeroSelectBaseSystem> .instance.m_stGameOfCombat;
                msg.stPkgData.stStartSingleGameReq.stBattleList.stBattleList.wHeroCnt        = 1;
                if (msg.stPkgData.stStartSingleGameReq.stBattleParam.stGameDetail.stGameOfCombat != null)
                {
                    MemberInfo masterMemberInfo = roomInfo.GetMasterMemberInfo();
                    if (masterMemberInfo != null)
                    {
                        msg.stPkgData.stStartSingleGameReq.stBattleList.stBattleList.BattleHeroList[0] = masterMemberInfo.ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID;
                        ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(roomInfo.roomAttrib.bMapType, roomInfo.roomAttrib.dwMapId);
                        if (pvpMapCommonInfo != null)
                        {
                            COM_PLAYERCAMP camp     = COM_PLAYERCAMP.COM_PLAYERCAMP_1;
                            int            dwHeroID = 0;
                            for (COM_PLAYERCAMP com_playercamp2 = COM_PLAYERCAMP.COM_PLAYERCAMP_1; com_playercamp2 < COM_PLAYERCAMP.COM_PLAYERCAMP_COUNT; com_playercamp2 += 1)
                            {
                                ListView <MemberInfo> view = roomInfo[com_playercamp2];
                                for (int i = 0; i < view.Count; i++)
                                {
                                    if (view[i].ullUid == roomInfo.selfInfo.ullUid)
                                    {
                                        camp     = view[i].camp;
                                        dwHeroID = (int)view[i].ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID;
                                        break;
                                    }
                                }
                            }
                            CSDT_BATTLE_PLAYER_BRIEF stBattlePlayer = msg.stPkgData.stStartSingleGameReq.stBattlePlayer;
                            int index = 0;
                            for (COM_PLAYERCAMP com_playercamp3 = COM_PLAYERCAMP.COM_PLAYERCAMP_1; com_playercamp3 < COM_PLAYERCAMP.COM_PLAYERCAMP_COUNT; com_playercamp3 += 1)
                            {
                                ListView <MemberInfo> view2 = roomInfo[com_playercamp3];
                                for (int j = 0; j < view2.Count; j++)
                                {
                                    MemberInfo info4 = view2[j];
                                    if (info4 != null)
                                    {
                                        if (info4.RoomMemberType == 2)
                                        {
                                            stBattlePlayer.astFighter[index].bObjType   = 2;
                                            stBattlePlayer.astFighter[index].bPosOfCamp = (byte)j;
                                            stBattlePlayer.astFighter[index].bObjCamp   = (byte)com_playercamp3;
                                            stBattlePlayer.astFighter[index].dwLevel    = info4.dwMemberPvpLevel;
                                            FakeHeroSelect fakeHeroSelect = GetFakeHeroSelect(info4.ullUid);
                                            if (fakeHeroSelect != null)
                                            {
                                                stBattlePlayer.astFighter[index].astChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID             = fakeHeroSelect.selectedHero;
                                                stBattlePlayer.astFighter[index].astChoiceHero[0].stBaseInfo.stCommonInfo.stSkill.dwSelSkillID = fakeHeroSelect.selectedPlayerSkill;
                                                stBattlePlayer.astFighter[index].astChoiceHero[0].stBaseInfo.stCommonInfo.wSkinID = (ushort)fakeHeroSelect.selectedSkin;
                                                stBattlePlayer.astFighter[index].szName = fakeHeroSelect.FakePlayer.szUserName;
                                                stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc                    = new COMDT_PLAYERINFO_OF_NPC();
                                                stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.ullFakeUid         = fakeHeroSelect.FakePlayer.ullUid;
                                                stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.dwFakePvpLevel     = fakeHeroSelect.FakePlayer.dwAcntPvpLevel;
                                                stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.dwFakeLogicWorldID = fakeHeroSelect.FakePlayer.dwLogicWorldId;
                                            }
                                            else
                                            {
                                                SelectHeroForEnemyPlayer(ref stBattlePlayer.astFighter[index].astChoiceHero[0].stBaseInfo, stBattlePlayer.astFighter[index].dwLevel);
                                                stBattlePlayer.astFighter[index].szName = info4.WarmNpc.szUserName;
                                                stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc                    = new COMDT_PLAYERINFO_OF_NPC();
                                                stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.ullFakeUid         = info4.WarmNpc.ullUid;
                                                stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.dwFakePvpLevel     = info4.WarmNpc.dwAcntPvpLevel;
                                                stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.dwFakeLogicWorldID = info4.WarmNpc.dwLogicWorldId;
                                            }
                                        }
                                        else if (info4.RoomMemberType == 1)
                                        {
                                            stBattlePlayer.astFighter[index].bObjType   = 1;
                                            stBattlePlayer.astFighter[index].bPosOfCamp = (byte)j;
                                            stBattlePlayer.astFighter[index].bObjCamp   = (byte)camp;
                                            for (int k = 0; k < pvpMapCommonInfo.bHeroNum; k++)
                                            {
                                                stBattlePlayer.astFighter[index].astChoiceHero[k].stBaseInfo.stCommonInfo.dwHeroID = (uint)dwHeroID;
                                            }
                                        }
                                        index++;
                                    }
                                }
                            }
                            stBattlePlayer.bNum             = (byte)index;
                            roomInfo.roomAttrib.bWarmBattle = false;
                            roomInfo.roomAttrib.npcAILevel  = 2;
                            Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, true);
                        }
                    }
                    else
                    {
                        DebugHelper.Assert(roomInfo != null, "selfInfo Should not be NULL!!!");
                    }
                }
            }
        }