Beispiel #1
0
 // Token: 0x06001B2F RID: 6959 RVA: 0x0007F604 File Offset: 0x0007D804
 protected override string RebuildValue()
 {
     if (this.groupId == CSteamID.nil)
     {
         return(null);
     }
     return(TextSerialization.ToStringInvariant(this.groupId.value));
 }
 // Token: 0x060023AE RID: 9134 RVA: 0x000A7C67 File Offset: 0x000A5E67
 private void OnSliderValueChanged(float newValue)
 {
     if (base.inUpdateControls)
     {
         return;
     }
     base.SubmitSetting(TextSerialization.ToStringInvariant(newValue));
 }
Beispiel #3
0
 // Token: 0x0600197F RID: 6527 RVA: 0x0006D7B0 File Offset: 0x0006B9B0
 public override string GetString()
 {
     if (!SettingsConVars.PpGammaConVar.colorGradingSettings)
     {
         return("0");
     }
     return(TextSerialization.ToStringInvariant(SettingsConVars.PpGammaConVar.colorGradingSettings.gamma.value.w));
 }
Beispiel #4
0
            // Token: 0x06001150 RID: 4432 RVA: 0x0004C2E4 File Offset: 0x0004A4E4
            public override string GetString()
            {
                int num;
                int num2;
                int value;

                RoR2Application.NtQueryTimerResolution(out num, out num2, out value);
                return(TextSerialization.ToStringInvariant(value));
            }
            // Token: 0x06000B49 RID: 2889 RVA: 0x00037DFC File Offset: 0x00035FFC
            public override string GetString()
            {
                int      num = 1;
                float    value;
                AKRESULT rtpcvalue = AkSoundEngine.GetRTPCValue(this.rtpcName, null, 0u, out value, ref num);

                if (rtpcvalue == AKRESULT.AK_Success)
                {
                    return(TextSerialization.ToStringInvariant(value));
                }
                return("ERROR: " + rtpcvalue);
            }
        // Token: 0x06001A57 RID: 6743 RVA: 0x0007CA18 File Offset: 0x0007AC18
        private static void UpdatePlayerCount()
        {
            if (SteamworksLobbyManager.client != null && SteamworksLobbyManager.client.Lobby.IsValid)
            {
                int    count      = LocalUserManager.readOnlyLocalUsersList.Count;
                string memberData = SteamworksLobbyManager.client.Lobby.GetMemberData(SteamworksLobbyManager.client.SteamId, "player_count");
                string text       = TextSerialization.ToStringInvariant(Math.Max(1, count));
                if (memberData != text)
                {
                    SteamworksLobbyManager.client.Lobby.SetMemberData("player_count", text);
                }
                SteamworksLobbyManager.playerCountsList.Clear();
                SteamworksLobbyManager.calculatedTotalPlayerCount = 0;
                ulong steamId = SteamworksLobbyManager.client.SteamId;
                int   num     = 0;
                foreach (ulong num2 in SteamworksLobbyManager.client.Lobby.GetMemberIDs())
                {
                    int num3 = TextSerialization.TryParseInvariant(SteamworksLobbyManager.client.Lobby.GetMemberData(num2, "player_count"), out num3) ? Math.Min(Math.Max(1, num3), RoR2Application.maxLocalPlayers) : 1;
                    if (num2 == steamId)
                    {
                        num3 = Math.Max(1, count);
                    }
                    SteamworksLobbyManager.playerCountsList.Add(num3);
                    SteamworksLobbyManager.calculatedTotalPlayerCount += num3;
                    if (num3 > 1)
                    {
                        num += num3 - 1;
                    }
                }
                if (SteamworksLobbyManager.ownsLobby)
                {
                    string data = SteamworksLobbyManager.client.Lobby.CurrentLobbyData.GetData("player_count");
                    string b    = TextSerialization.ToStringInvariant(SteamworksLobbyManager.calculatedTotalPlayerCount);
                    if (data != b)
                    {
                        SteamworksLobbyManager.client.Lobby.CurrentLobbyData.SetData("player_count", b);
                    }
                    int maxMembers = SteamworksLobbyManager.client.Lobby.MaxMembers;
                    int num4       = SteamworksLobbyManager.newestLobbyData.totalMaxPlayers - num;
                    if (maxMembers != num4)
                    {
                        SteamworksLobbyManager.client.Lobby.MaxMembers = num4;
                    }
                }
            }
            Action action = SteamworksLobbyManager.onPlayerCountUpdated;

            if (action == null)
            {
                return;
            }
            action();
        }
        // Token: 0x060023AF RID: 9135 RVA: 0x000A7C80 File Offset: 0x000A5E80
        private void OnInputFieldSubmit(string newString)
        {
            if (base.inUpdateControls)
            {
                return;
            }
            float value;

            if (TextSerialization.TryParseInvariant(newString, out value))
            {
                base.SubmitSetting(TextSerialization.ToStringInvariant(value));
            }
        }
Beispiel #8
0
        // Token: 0x06001CDD RID: 7389 RVA: 0x000867A4 File Offset: 0x000849A4
        public override string ToString()
        {
            StatDataType dataType = this.dataType;

            if (dataType == StatDataType.ULong)
            {
                return(TextSerialization.ToStringInvariant(this.value.ulongValue));
            }
            if (dataType != StatDataType.Double)
            {
                throw new ArgumentOutOfRangeException();
            }
            return(TextSerialization.ToStringInvariant(this.value.doubleValue));
        }
Beispiel #9
0
 // Token: 0x06001FF9 RID: 8185 RVA: 0x00096600 File Offset: 0x00094800
 private static void RequestLobbyListRefresh()
 {
     if (SteamLobbyFinder.awaitingLobbyRefresh)
     {
         return;
     }
     SteamLobbyFinder.awaitingLobbyRefresh = true;
     LobbyList.Filter filter = new LobbyList.Filter();
     filter.StringFilters["appid"]             = TextSerialization.ToStringInvariant(SteamLobbyFinder.steamClient.AppId);
     filter.StringFilters["build_id"]          = RoR2Application.GetBuildId();
     filter.StringFilters["qp"]                = "1";
     filter.StringFilters["total_max_players"] = TextSerialization.ToStringInvariant(RoR2Application.maxPlayers);
     LobbyList.Filter filter2 = filter;
     SteamLobbyFinder.steamClient.LobbyList.Refresh(filter2);
 }
        // Token: 0x06001A93 RID: 6803 RVA: 0x0007DB1C File Offset: 0x0007BD1C
        public static void SetLobbyQuickPlayQueuedIfOwner(bool quickplayQueuedState)
        {
            Lobby lobby = SteamworksLobbyManager.client.Lobby;

            if (((lobby != null) ? lobby.CurrentLobbyData : null) == null)
            {
                return;
            }
            lobby.CurrentLobbyData.SetData("qp", quickplayQueuedState ? "1" : "0");
            lobby.CurrentLobbyData.SetData("v", TextSerialization.ToStringInvariant(SteamworksLobbyManager.v++));
            if (!quickplayQueuedState)
            {
                lobby.LobbyType = SteamworksLobbyManager.preferredLobbyType;
            }
        }
Beispiel #11
0
 // Token: 0x0600199F RID: 6559 RVA: 0x0006DE78 File Offset: 0x0006C078
 private SteamworksClientManager()
 {
     if (!Application.isEditor && File.Exists("steam_appid.txt"))
     {
         try
         {
             File.Delete("steam_appid.txt");
         }
         catch (Exception ex)
         {
             Debug.Log(ex.Message);
         }
         if (File.Exists("steam_appid.txt"))
         {
             Debug.Log("Cannot delete steam_appid.txt. Quitting...");
             this.Dispose();
             return;
         }
     }
     Config.ForUnity(Application.platform.ToString());
     this.steamworksClient = new Client(632360U);
     if (!this.steamworksClient.IsValid)
     {
         this.Dispose();
         return;
     }
     if (!Application.isEditor)
     {
         if (Client.RestartIfNecessary(632360U) || !this.steamworksClient.IsValid || !SteamApiValidator.IsValidSteamApiDll())
         {
             Debug.Log("Unable to initialize Facepunch.Steamworks.");
             this.Dispose();
             return;
         }
         if (!this.steamworksClient.App.IsSubscribed(632360U))
         {
             Debug.Log("Steam user not subscribed to app. Quitting...");
             this.Dispose();
             return;
         }
     }
     RoR2Application.steamBuildId = TextSerialization.ToStringInvariant(this.steamworksClient.BuildId);
     RoR2Application.onUpdate    += this.Update;
     RoR2Application.cloudStorage = new SteamworksRemoteStorageFileSystem();
     SteamworksLobbyManager.Init();
     SteamLobbyFinder.Init();
 }
        // Token: 0x06001A94 RID: 6804 RVA: 0x0007DB94 File Offset: 0x0007BD94
        public static void SetLobbyQuickPlayCutoffTimeIfOwner(uint?timestamp)
        {
            Lobby lobby = SteamworksLobbyManager.client.Lobby;

            if (((lobby != null) ? lobby.CurrentLobbyData : null) == null)
            {
                return;
            }
            if (timestamp == null)
            {
                lobby.CurrentLobbyData.RemoveData("qp_cutoff_time");
                return;
            }
            string text = TextSerialization.ToStringInvariant(timestamp.Value);

            lobby.CurrentLobbyData.SetData("qp_cutoff_time", text);
        }
        private static void SetBuildIdSteam(ConCommandArgs args)
        {
            var instance = RoR2Application.instance;

            if (instance == null)
            {
                throw new ConCommandException("RoR2Application is null.");
            }
            var client = instance.steamworksClient;

            if (client == null)
            {
                throw new ConCommandException("SteamworksClient is null");
            }

            _buildId = TextSerialization.ToStringInvariant(client.BuildId);
            client.Lobby?.CurrentLobbyData?.SetData("build_id", _buildId);
            Debug.Log($"BuildId set to {_buildId}");
        }
Beispiel #14
0
        private static string GetVRSettingValue(On.RoR2.UI.BaseSettingsControl.orig_GetCurrentValue orig, BaseSettingsControl self)
        {
            if (self.gameObject.name.Contains("VRModSetting"))
            {
                ModConfig.ConfigSetting setting;
                if (ModConfig.settings.TryGetValue(self.settingName, out setting))
                {
                    ConfigEntryBase entry = setting.entry;
                    if (entry.SettingType == typeof(bool))
                    {
                        return((entry as ConfigEntry <bool>).Value ? "1" : "0");
                    }
                    else if (entry.SettingType == typeof(int))
                    {
                        return(TextSerialization.ToStringInvariant((entry as ConfigEntry <int>).Value));
                    }
                    else if (entry.SettingType == typeof(float))
                    {
                        return(TextSerialization.ToStringInvariant((entry as ConfigEntry <float>).Value));
                    }
                    else if (entry.SettingType == typeof(string))
                    {
                        string value = (entry as ConfigEntry <string>).Value;

                        if (Array.Exists((self as CarouselController).choices, x => x.convarValue == value))
                        {
                            return(value);
                        }
                        else
                        {
                            return("#FFFFFF");
                        }
                    }
                }
                else
                {
                    return("0");
                }
            }
            return(orig(self));
        }
Beispiel #15
0
 // Token: 0x0600196B RID: 6507 RVA: 0x0006D48D File Offset: 0x0006B68D
 public override string GetString()
 {
     return(TextSerialization.ToStringInvariant(QualitySettings.shadowDistance));
 }
Beispiel #16
0
 // Token: 0x0600195B RID: 6491 RVA: 0x0006D2F9 File Offset: 0x0006B4F9
 public override string GetString()
 {
     return(TextSerialization.ToStringInvariant(QualitySettings.masterTextureLimit));
 }
Beispiel #17
0
 // Token: 0x06001957 RID: 6487 RVA: 0x0006D2B5 File Offset: 0x0006B4B5
 public override string GetString()
 {
     return(TextSerialization.ToStringInvariant(QualitySettings.maximumLODLevel));
 }
Beispiel #18
0
 // Token: 0x06001936 RID: 6454 RVA: 0x0006CE85 File Offset: 0x0006B085
 public override string GetString()
 {
     return(TextSerialization.ToStringInvariant(QualitySettings.vSyncCount));
 }
Beispiel #19
0
 // Token: 0x06001953 RID: 6483 RVA: 0x0006D271 File Offset: 0x0006B471
 public override string GetString()
 {
     return(TextSerialization.ToStringInvariant(QualitySettings.lodBias));
 }
Beispiel #20
0
 // Token: 0x06001943 RID: 6467 RVA: 0x0006D0ED File Offset: 0x0006B2ED
 public override string GetString()
 {
     return(TextSerialization.ToStringInvariant(Application.targetFrameRate));
 }
Beispiel #21
0
 // Token: 0x060009D8 RID: 2520 RVA: 0x0002AF1D File Offset: 0x0002911D
 public override string GetString()
 {
     return(TextSerialization.ToStringInvariant(Corpse.maxCorpses));
 }
Beispiel #22
0
 // Token: 0x06001159 RID: 4441 RVA: 0x0004C389 File Offset: 0x0004A589
 public override string GetString()
 {
     return(TextSerialization.ToStringInvariant(Time.timeScale));
 }
Beispiel #23
0
 // Token: 0x06000BDB RID: 3035 RVA: 0x00039EDE File Offset: 0x000380DE
 public override string GetString()
 {
     return(TextSerialization.ToStringInvariant(CameraResolutionScaler.resolutionScale));
 }
Beispiel #24
0
 // Token: 0x0600115C RID: 4444 RVA: 0x0004C3B5 File Offset: 0x0004A5B5
 public override string GetString()
 {
     return(TextSerialization.ToStringInvariant(Time.fixedDeltaTime));
 }
Beispiel #25
0
 // Token: 0x06001B37 RID: 6967 RVA: 0x0007F6BF File Offset: 0x0007D8BF
 protected override string RebuildValue()
 {
     return(TextSerialization.ToStringInvariant(this.groupSize));
 }
 // Token: 0x06001A76 RID: 6774 RVA: 0x0007D2E8 File Offset: 0x0007B4E8
 public static void StartMigrateLobby(CSteamID newLobbyId)
 {
     SteamworksLobbyManager.client.Lobby.Joinable = false;
     SteamworksLobbyManager.client.Lobby.CurrentLobbyData.SetData("migration_id", TextSerialization.ToStringInvariant(newLobbyId.value));
 }
Beispiel #27
0
        // Token: 0x0600140C RID: 5132 RVA: 0x00062108 File Offset: 0x00060308
        private void OnLoad()
        {
            RoR2Application.UnitySystemConsoleRedirector.Redirect();
            if (File.Exists("steam_appid.txt"))
            {
                try
                {
                    File.Delete("steam_appid.txt");
                }
                catch (Exception ex)
                {
                    Debug.Log(ex.Message);
                }
                if (File.Exists("steam_appid.txt"))
                {
                    Debug.Log("Cannot delete steam_appid.txt. Quitting...");
                    Application.Quit();
                    return;
                }
            }
            Config.ForUnity(Application.platform.ToString());
            this.steamworksClient = new Client(632360u);
            if (Client.RestartIfNecessary(632360u) || !this.steamworksClient.IsValid || !SteamApiValidator.IsValidSteamApiDll())
            {
                Debug.Log("Unable to initialize Facepunch.Steamworks.");
                Application.Quit();
                return;
            }
            if (!this.steamworksClient.App.IsSubscribed(632360u))
            {
                Debug.Log("Steam user not subscribed to app. Quitting...");
                Application.Quit();
                return;
            }
            RoR2Application.steamBuildId = TextSerialization.ToStringInvariant(this.steamworksClient.BuildId);
            this.steamworksAuthTicket    = this.steamworksClient.Auth.GetAuthSessionTicket();
            SteamworksEventManager.Init(this.steamworksClient);
            this.steamworksAvailability.MakeAvailable();
            PhysicalFileSystem physicalFileSystem = new PhysicalFileSystem();

            RoR2Application.fileSystem   = new SubFileSystem(physicalFileSystem, physicalFileSystem.ConvertPathFromInternal(Application.dataPath), true);
            RoR2Application.cloudStorage = RoR2Application.fileSystem;
            RoR2Application.cloudStorage = new SteamworksRemoteStorageFileSystem();
            UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/Rewired Input Manager"));
            ReInput.ControllerConnectedEvent += RoR2Application.AssignNewController;
            foreach (ControllerType controllerType in new ControllerType[]
            {
                ControllerType.Keyboard,
                ControllerType.Mouse,
                ControllerType.Joystick
            })
            {
                Controller[] controllers = ReInput.controllers.GetControllers(controllerType);
                if (controllers != null)
                {
                    for (int j = 0; j < controllers.Length; j++)
                    {
                        RoR2Application.AssignNewController(controllers[j]);
                    }
                }
            }
            this.stateManager.Initialize();
            UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/UI/MPEventSystemManager"));
            UnityEngine.Object.Instantiate <GameObject>(this.networkManagerPrefab);
            if (UnityEngine.Object.FindObjectOfType <AkInitializer>())
            {
                Debug.LogError("Attempting to initialize wwise when AkInitializer already exists! This will cause a crash!");
                return;
            }
            this.wwiseGlobalInstance = UnityEngine.Object.Instantiate <GameObject>(this.wwiseGlobalPrefab);
            UnityEngine.Object.Instantiate <GameObject>(this.audioManagerPrefab);
            GameObject gameObject = new GameObject("Console");

            gameObject.AddComponent <SetDontDestroyOnLoad>();
            gameObject.AddComponent <Console>();
            SceneManager.sceneLoaded += delegate(Scene scene, LoadSceneMode loadSceneMode)
            {
                Debug.LogFormat("Loaded scene {0} loadSceneMode={1}", new object[]
                {
                    scene.name,
                    loadSceneMode
                });
            };
            SceneManager.sceneUnloaded += delegate(Scene scene)
            {
                Debug.LogFormat("Unloaded scene {0}", new object[]
                {
                    scene.name
                });
            };
            SceneManager.activeSceneChanged += delegate(Scene oldScene, Scene newScene)
            {
                Debug.LogFormat("Active scene changed from {0} to {1}", new object[]
                {
                    oldScene.name,
                    newScene.name
                });
            };
            SystemInitializerAttribute.Execute();
            UserProfile.LoadUserProfiles();
            if (RoR2Application.onLoad != null)
            {
                RoR2Application.onLoad();
                RoR2Application.onLoad = null;
            }
        }
Beispiel #28
0
            // Token: 0x060023F2 RID: 9202 RVA: 0x000A8D30 File Offset: 0x000A6F30
            private void RefreshCrownAndPromoteButton()
            {
                if (Client.Instance == null)
                {
                    return;
                }
                bool flag = Client.Instance.Lobby.Owner == this.steamId && this.steamId > 0UL;

                if (this.lobbyLeaderCrown != flag)
                {
                    if (flag)
                    {
                        this.lobbyLeaderCrown = UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/UI/LobbyLeaderCrown"), this.gameObject.transform);
                    }
                    else
                    {
                        UnityEngine.Object.Destroy(this.lobbyLeaderCrown);
                        this.lobbyLeaderCrown = null;
                    }
                }
                if (this.elementChildLocator)
                {
                    bool       flag2      = !flag && SteamworksLobbyManager.ownsLobby && this.steamId != 0UL && !SteamLobbyFinder.running && !NetworkSession.instance;
                    GameObject gameObject = this.elementChildLocator.FindChild("PromoteButton").gameObject;
                    if (gameObject)
                    {
                        gameObject.SetActive(flag2);
                        if (flag2)
                        {
                            MPButton component = gameObject.GetComponent <MPButton>();
                            if (component)
                            {
                                component.onClick.RemoveAllListeners();
                                component.onClick.AddListener(delegate()
                                {
                                    Console.instance.SubmitCmd(null, string.Format(CultureInfo.InvariantCulture, "steam_lobby_assign_owner {0}", TextSerialization.ToStringInvariant(this.steamId)), false);
                                });
                            }
                        }
                    }
                }
            }
Beispiel #29
0
 public override string GetString()
 {
     return(TextSerialization.ToStringInvariant(this.value));
 }
    // Token: 0x0600018E RID: 398 RVA: 0x00008E80 File Offset: 0x00007080
    static HGXml()
    {
        HGXml.Register <int>(delegate(XElement element, int contents)
        {
            element.Value = TextSerialization.ToStringInvariant(contents);
        }, delegate(XElement element, ref int contents)
        {
            int num;
            if (TextSerialization.TryParseInvariant(element.Value, out num))
            {
                contents = num;
                return(true);
            }
            return(false);
        });
        HGXml.Register <uint>(delegate(XElement element, uint contents)
        {
            element.Value = TextSerialization.ToStringInvariant(contents);
        }, delegate(XElement element, ref uint contents)
        {
            uint num;
            if (TextSerialization.TryParseInvariant(element.Value, out num))
            {
                contents = num;
                return(true);
            }
            return(false);
        });
        HGXml.Register <ulong>(delegate(XElement element, ulong contents)
        {
            element.Value = TextSerialization.ToStringInvariant(contents);
        }, delegate(XElement element, ref ulong contents)
        {
            ulong num;
            if (TextSerialization.TryParseInvariant(element.Value, out num))
            {
                contents = num;
                return(true);
            }
            return(false);
        });
        HGXml.Register <bool>(delegate(XElement element, bool contents)
        {
            element.Value = (contents ? "1" : "0");
        }, delegate(XElement element, ref bool contents)
        {
            int num;
            if (TextSerialization.TryParseInvariant(element.Value, out num))
            {
                contents = (num != 0);
                return(true);
            }
            return(false);
        });
        HGXml.Register <float>(delegate(XElement element, float contents)
        {
            element.Value = TextSerialization.ToStringInvariant(contents);
        }, delegate(XElement element, ref float contents)
        {
            float num;
            if (TextSerialization.TryParseInvariant(element.Value, out num))
            {
                contents = num;
                return(true);
            }
            return(false);
        });
        HGXml.Register <double>(delegate(XElement element, double contents)
        {
            element.Value = TextSerialization.ToStringInvariant(contents);
        }, delegate(XElement element, ref double contents)
        {
            double num;
            if (TextSerialization.TryParseInvariant(element.Value, out num))
            {
                contents = num;
                return(true);
            }
            return(false);
        });
        HGXml.Register <string>(delegate(XElement element, string contents)
        {
            element.Value = contents;
        }, delegate(XElement element, ref string contents)
        {
            contents = element.Value;
            return(true);
        });
        MethodInfo method = typeof(HGXml).GetMethod("RegisterEnum");

        foreach (TypeInfo typeInfo in from t in typeof(HGXml).Assembly.DefinedTypes
                 where t.IsEnum
                 select t)
        {
            method.MakeGenericMethod(new Type[]
            {
                typeInfo
            }).Invoke(null, Array.Empty <object>());
        }
    }