// Token: 0x060021CF RID: 8655 RVA: 0x000922A8 File Offset: 0x000904A8
 private void SubmitSettingInternal(string newValue)
 {
     if (this.originalValue == null)
     {
         this.originalValue = this.GetCurrentValue();
     }
     if (this.originalValue == newValue)
     {
         this.originalValue = null;
     }
     BaseSettingsControl.SettingSource settingSource = this.settingSource;
     if (settingSource != BaseSettingsControl.SettingSource.ConVar)
     {
         if (settingSource == BaseSettingsControl.SettingSource.UserProfilePref)
         {
             UserProfile currentUserProfile = this.GetCurrentUserProfile();
             if (currentUserProfile != null)
             {
                 currentUserProfile.SetSaveFieldString(this.settingName, newValue);
             }
             UserProfile currentUserProfile2 = this.GetCurrentUserProfile();
             if (currentUserProfile2 != null)
             {
                 currentUserProfile2.RequestSave(false);
             }
         }
     }
     else
     {
         BaseConVar conVar = this.GetConVar();
         if (conVar != null)
         {
             conVar.AttemptSetString(newValue);
         }
     }
     RoR2Application.onNextUpdate += this.UpdateControls;
 }
 // Token: 0x06000984 RID: 2436 RVA: 0x0002946C File Offset: 0x0002766C
 private void InitConVars()
 {
     this.allConVars     = new Dictionary <string, BaseConVar>();
     this.archiveConVars = new List <BaseConVar>();
     foreach (Type type in typeof(BaseConVar).Assembly.GetTypes())
     {
         foreach (FieldInfo fieldInfo in type.GetFields(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic))
         {
             if (fieldInfo.FieldType.IsSubclassOf(typeof(BaseConVar)))
             {
                 if (fieldInfo.IsStatic)
                 {
                     BaseConVar conVar = (BaseConVar)fieldInfo.GetValue(null);
                     this.RegisterConVarInternal(conVar);
                 }
                 else if (type.GetCustomAttribute <CompilerGeneratedAttribute>() == null)
                 {
                     Debug.LogErrorFormat("ConVar defined as {0}.{1} could not be registered. ConVars must be static fields.", new object[]
                     {
                         type.Name,
                         fieldInfo.Name
                     });
                 }
             }
         }
         foreach (MethodInfo methodInfo in type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic))
         {
             if (methodInfo.GetCustomAttribute <ConVarProviderAttribute>() != null)
             {
                 if (methodInfo.ReturnType != typeof(IEnumerable <BaseConVar>) || methodInfo.GetParameters().Length != 0)
                 {
                     Debug.LogErrorFormat("ConVar provider {0}.{1} does not match the signature \"static IEnumerable<ConVar.BaseConVar>()\".", new object[]
                     {
                         type.Name,
                         methodInfo.Name
                     });
                 }
                 else if (!methodInfo.IsStatic)
                 {
                     Debug.LogErrorFormat("ConVar provider {0}.{1} could not be invoked. Methods marked with the ConVarProvider attribute must be static.", new object[]
                     {
                         type.Name,
                         methodInfo.Name
                     });
                 }
                 else
                 {
                     foreach (BaseConVar conVar2 in ((IEnumerable <BaseConVar>)methodInfo.Invoke(null, Array.Empty <object>())))
                     {
                         this.RegisterConVarInternal(conVar2);
                     }
                 }
             }
         }
     }
     foreach (KeyValuePair <string, BaseConVar> keyValuePair in this.allConVars)
     {
         BaseConVar value = keyValuePair.Value;
         if ((value.flags & ConVarFlags.Engine) != ConVarFlags.None)
         {
             value.defaultValue = value.GetString();
         }
         else if (value.defaultValue != null)
         {
             value.AttemptSetString(value.defaultValue);
         }
     }
 }
        // Token: 0x0600098A RID: 2442 RVA: 0x00029854 File Offset: 0x00027A54
        private void RunCmd(NetworkUser sender, string concommandName, List <string> userArgs)
        {
            bool flag = sender != null && !sender.isLocalPlayer;

            Console.ConCommand conCommand = null;
            BaseConVar         baseConVar = null;
            ConVarFlags        flags;

            if (this.concommandCatalog.TryGetValue(concommandName, out conCommand))
            {
                flags = conCommand.flags;
            }
            else
            {
                baseConVar = this.FindConVar(concommandName);
                if (baseConVar == null)
                {
                    Debug.LogFormat("\"{0}\" is not a recognized ConCommand or ConVar.", new object[]
                    {
                        concommandName
                    });
                    return;
                }
                flags = baseConVar.flags;
            }
            bool flag2 = (flags & ConVarFlags.ExecuteOnServer) > ConVarFlags.None;

            if (!NetworkServer.active && flag2)
            {
                this.ForwardCmdToServer(new ConCommandArgs
                {
                    sender      = sender,
                    commandName = concommandName,
                    userArgs    = userArgs
                });
                return;
            }
            if (flag && (flags & ConVarFlags.SenderMustBeServer) != ConVarFlags.None)
            {
                Debug.LogFormat("Blocked server-only command {0} from remote user {1}.", new object[]
                {
                    concommandName,
                    sender.userName
                });
                return;
            }
            if (flag && !flag2)
            {
                Debug.LogFormat("Blocked non-transmittable command {0} from remote user {1}.", new object[]
                {
                    concommandName,
                    sender.userName
                });
                return;
            }
            if ((flags & ConVarFlags.Cheat) != ConVarFlags.None && !RoR2Application.cvCheats.boolValue)
            {
                Debug.LogFormat("Command \"{0}\" cannot be used while cheats are disabled.", new object[]
                {
                    concommandName
                });
                return;
            }
            if (conCommand != null)
            {
                try
                {
                    conCommand.action(new ConCommandArgs
                    {
                        sender      = sender,
                        commandName = concommandName,
                        userArgs    = userArgs
                    });
                }
                catch (ConCommandException ex)
                {
                    Debug.LogFormat("Command \"{0}\" failed: {1}", new object[]
                    {
                        concommandName,
                        ex.Message
                    });
                }
                return;
            }
            if (baseConVar == null)
            {
                return;
            }
            if (userArgs.Count > 0)
            {
                baseConVar.AttemptSetString(userArgs[0]);
                return;
            }
            Debug.LogFormat("\"{0}\" = \"{1}\"\n{2}", new object[]
            {
                concommandName,
                baseConVar.GetString(),
                baseConVar.helpText
            });
        }