Esempio n. 1
0
        public void ChooseSingleGame(string battleId, string hintText = "排队中")
        {
            SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(battleId);

            if (dataById == null)
            {
                Singleton <TipView> .Instance.ShowViewSetText("battleId[" + battleId + "] don't has config. error", 1f);

                return;
            }
            this.TeamCountMax = dataById.hero1_number_cap;
            this.ClearState();
            PvpLevelStorage.JoinAsSingle();
            this.SetBattleInfo(int.Parse(battleId), PvpJoinType.Single);
            if (GlobalSettings.Instance.PvpSetting.DirectLinkLobby)
            {
                NetWorkHelper.Instance.ConnectToLobbyServer();
            }
            else
            {
                SendMsgManager.Instance.SendGateLobbyMessage(LobbyCode.C2L_JoinQueue, new SendMsgManager.SendMsgParam(true, hintText, true, 15f), new object[]
                {
                    this.BattleInfo.BattleId,
                    "10.10.10.87-23000-23001"
                });
            }
        }
        public static void DispatchChooseGameMsg()
        {
            LevelStorage?levelStorage = PvpLevelStorage.FetchLast();

            if (levelStorage.HasValue)
            {
                string battleId = levelStorage.Value.battleId;
                int    num;
                if (int.TryParse(battleId, out num))
                {
                    MobaMessageManager.DispatchMsg((ClientMsg)26002, new object[]
                    {
                        num,
                        levelStorage.Value.matchType
                    }, 0f);
                }
                else
                {
                    ClientLogger.Error("cannot parse BattleId " + battleId);
                }
            }
        }