// Token: 0x060024A4 RID: 9380 RVA: 0x000AB89D File Offset: 0x000A9A9D
 private void OnLobbyLeave(ulong lobbyId)
 {
     if (!SteamworksLobbyManager.isInLobby && !SteamworksLobbyManager.awaitingJoin)
     {
         SteamworksLobbyManager.CreateLobby();
     }
 }
Пример #2
0
 // Token: 0x06002016 RID: 8214 RVA: 0x00096C74 File Offset: 0x00094E74
 public override void OnLobbiesUpdated()
 {
     base.OnLobbiesUpdated();
     if (SteamLobbyFinder.steamClient.IsValid)
     {
         List <LobbyList.Lobby> lobbies = SteamLobbyFinder.steamClient.LobbyList.Lobbies;
         List <LobbyList.Lobby> list    = new List <LobbyList.Lobby>();
         ulong currentLobby             = SteamLobbyFinder.steamClient.Lobby.CurrentLobby;
         bool  isValid          = SteamLobbyFinder.steamClient.Lobby.IsValid;
         int   currentLobbySize = isValid ? SteamLobbyFinder.GetCurrentLobbyRealPlayerCount() : LocalUserManager.readOnlyLocalUsersList.Count;
         if (SteamworksLobbyManager.ownsLobby || !isValid)
         {
             for (int i = 0; i < lobbies.Count; i++)
             {
                 if ((!isValid || lobbies[i].LobbyID < currentLobby) && SteamLobbyFinder.CanJoinLobby(currentLobbySize, lobbies[i]))
                 {
                     list.Add(lobbies[i]);
                 }
             }
             if (list.Count > 0)
             {
                 SteamworksLobbyManager.JoinLobby(new CSteamID(list[0].LobbyID));
             }
         }
         Debug.LogFormat("Found {0} lobbies, {1} joinable.", new object[]
         {
             lobbies.Count,
             list.Count
         });
     }
 }
Пример #3
0
            // Token: 0x0600201C RID: 8220 RVA: 0x00096E60 File Offset: 0x00095060
            public override void OnEnter()
            {
                base.OnEnter();
                SteamLobbyFinder.steamClient.Lobby.LobbyType = SteamworksLobbyManager.preferredLobbyType;
                SteamworksLobbyManager.SetStartingIfOwner(true);
                string arg = "ClassicRun";

                Console.instance.SubmitCmd(null, string.Format("transition_command \"gamemode {0}; host 1;\"", arg), false);
            }
 // Token: 0x060024A3 RID: 9379 RVA: 0x000AB869 File Offset: 0x000A9A69
 public void OnDisable()
 {
     SteamworksLobbyManager.onLobbyLeave -= this.OnLobbyLeave;
     if (!GameNetworkManager.singleton.isNetworkActive)
     {
         SteamworksLobbyManager.LeaveLobby();
     }
     MultiplayerMenuController.instance = SingletonHelper.Unassign <MultiplayerMenuController>(MultiplayerMenuController.instance, this);
 }
 // Token: 0x060024A7 RID: 9383 RVA: 0x000AB8E7 File Offset: 0x000A9AE7
 public void Host()
 {
     if (this.state == MultiplayerMenuController.State.Idle)
     {
         Console.instance.SubmitCmd(null, "transition_command \"gamemode ClassicRun; host 1;\"", false);
         SteamworksLobbyManager.SetStartingIfOwner(true);
         this.state          = MultiplayerMenuController.State.Hosting;
         this.titleStopwatch = 0f;
         this.LerpAllUI(LerpUIRect.LerpState.Leaving);
     }
 }
 // Token: 0x060024A2 RID: 9378 RVA: 0x000AB82C File Offset: 0x000A9A2C
 public void OnEnable()
 {
     this.LerpAllUI(LerpUIRect.LerpState.Entering);
     this.state = MultiplayerMenuController.State.Idle;
     MultiplayerMenuController.instance = SingletonHelper.Assign <MultiplayerMenuController>(MultiplayerMenuController.instance, this);
     if (!SteamworksLobbyManager.isInLobby)
     {
         SteamworksLobbyManager.CreateLobby();
     }
     SteamworksLobbyManager.onLobbyLeave += this.OnLobbyLeave;
 }
Пример #7
0
        // Token: 0x060023E8 RID: 9192 RVA: 0x000A8940 File Offset: 0x000A6B40
        private void Rebuild()
        {
            Client instance = Client.Instance;

            if (instance == null)
            {
                return;
            }
            bool  validLobbyExists = this.ValidLobbyExists;
            ulong currentLobby     = instance.Lobby.CurrentLobby;

            ulong[] memberIDs = instance.Lobby.GetMemberIDs();
            int     num       = validLobbyExists ? RoR2Application.maxPlayers : 0;

            this.copyLobbyIDToClipboardButton.SetActive(validLobbyExists);
            while (this.elements.Count > num)
            {
                int index = this.elements.Count - 1;
                UnityEngine.Object.Destroy(this.elements[index].gameObject);
                this.elements.RemoveAt(index);
            }
            while (this.elements.Count < num)
            {
                GameObject         gameObject           = UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/UI/SteamLobbyUserListElement"), base.transform);
                SocialUserIcon     componentInChildren  = gameObject.GetComponentInChildren <SocialUserIcon>();
                SteamUsernameLabel componentInChildren2 = gameObject.GetComponentInChildren <SteamUsernameLabel>();
                ChildLocator       component            = gameObject.GetComponent <ChildLocator>();
                this.elements.Add(new SteamworksLobbyUserList.Element
                {
                    gameObject          = gameObject,
                    userIcon            = componentInChildren,
                    usernameLabel       = componentInChildren2,
                    elementChildLocator = component
                });
            }
            int i = 0;

            for (int j = 0; j < memberIDs.Length; j++)
            {
                int lobbyMemberPlayerCountByIndex = SteamworksLobbyManager.GetLobbyMemberPlayerCountByIndex(j);
                for (int k = 0; k < lobbyMemberPlayerCountByIndex; k++)
                {
                    this.elements[i++].SetUser(memberIDs[j], k);
                }
            }
            while (i < num)
            {
                this.elements[i].SetUser(0UL, 0);
                i++;
            }
        }
Пример #8
0
        public override void OnInspectorGUI()
        {
            pManager = target as SteamworksLobbyManager;

            if (pManager.LobbySettings == null)
            {
                EditorGUILayout.HelpBox("You should provide a Lobby Settings object here for easier use with other components.", MessageType.Warning);
                EditorGUILayout.PropertyField(LobbySettings);
                serializedObject.ApplyModifiedProperties();
                return;
            }

            var settingsObject = BuildReferences();

            Rect hRect = EditorGUILayout.BeginHorizontal();

            EditorGUILayout.LabelField("");



            Rect bRect = new Rect(hRect);

            bRect.width = hRect.width / 4f;
            tabPage     = GUI.Toggle(bRect, tabPage == 0, "Settings", EditorStyles.toolbarButton) ? 0 : tabPage;
            bRect.x    += bRect.width;
            tabPage     = GUI.Toggle(bRect, tabPage == 1, "Common Events", EditorStyles.toolbarButton) ? 1 : tabPage;
            bRect.x    += bRect.width;
            tabPage     = GUI.Toggle(bRect, tabPage == 2, "Search Events", EditorStyles.toolbarButton) ? 2 : tabPage;
            bRect.x    += bRect.width;
            tabPage     = GUI.Toggle(bRect, tabPage == 3, "Chat Events", EditorStyles.toolbarButton) ? 3 : tabPage;
            EditorGUILayout.EndHorizontal();

            switch (tabPage)
            {
            case 0: DrawSettingsTab(); break;

            case 1: DrawCommonEventsTab(); break;

            case 2: DrawSearchEventsTab(); break;

            case 3: DrawChatEventsTab(); break;

            default: DrawSettingsTab(); break;
            }

            serializedObject.ApplyModifiedProperties();
            settingsObject.ApplyModifiedProperties();
        }
Пример #9
0
 // Token: 0x06002004 RID: 8196 RVA: 0x00096784 File Offset: 0x00094984
 static SteamLobbyFinder()
 {
     SteamworksLobbyManager.onLobbyDataUpdated += SteamLobbyFinder.OnLobbyDataUpdated;
     GameNetworkManager.onStartClientGlobal    += delegate(NetworkClient client)
     {
         SteamworksLobbyManager.SetLobbyQuickPlayQueuedIfOwner(false);
         SteamLobbyFinder.userRequestedQuickplayQueue = false;
     };
     SteamworksLobbyManager.onLobbyOwnershipGained += delegate()
     {
         if (SteamworksLobbyManager.newestLobbyData.quickplayQueued)
         {
             SteamLobbyFinder.userRequestedQuickplayQueue = true;
         }
     };
     SteamworksLobbyManager.onLobbyOwnershipLost += delegate()
     {
         SteamLobbyFinder.userRequestedQuickplayQueue = false;
     };
 }
Пример #10
0
 // Token: 0x06002019 RID: 8217 RVA: 0x00096DEC File Offset: 0x00094FEC
 public override void OnExit()
 {
     SteamworksLobbyManager.SetLobbyQuickPlayCutoffTimeIfOwner(null);
     base.OnExit();
 }
Пример #11
0
 // Token: 0x06002018 RID: 8216 RVA: 0x00096D80 File Offset: 0x00094F80
 public override void OnEnter()
 {
     base.OnEnter();
     SteamLobbyFinder.steamClient.Lobby.LobbyType = Lobby.Type.Public;
     SteamworksLobbyManager.SetLobbyQuickPlayCutoffTimeIfOwner(new uint?((uint)(Util.UnixTimeStampToDateTimeUtc(SteamLobbyFinder.steamClient.Utils.GetServerRealTime()) + TimeSpan.FromSeconds((double)this.lobbyFinder.waitForFullDuration) - Util.dateZero).TotalSeconds));
 }
Пример #12
0
 private static void CCSteamQuickplayStop(ConCommandArgs args)
 {
     ConCommandException.CheckSteamworks();
     SteamLobbyFinder.userRequestedQuickplayQueue = false;
     SteamworksLobbyManager.CreateLobby();
 }
Пример #13
0
 private static void CCSteamQuickplayStart(ConCommandArgs args)
 {
     ConCommandException.CheckSteamworks();
     SteamLobbyFinder.userRequestedQuickplayQueue = true;
     SteamworksLobbyManager.SetLobbyQuickPlayQueuedIfOwner(true);
 }