GetString() public method

public GetString ( string section, string key, string default_value = "" ) : string
section string
key string
default_value string
return string
Example #1
0
        private IEnumerator Load()
        {
            string profile = "";

            Info.text = "Loading configuration...";
            using (ConfigFile file = new ConfigFile(Application.dataPath + "/Configuration/Settings.ini", ' ', false))
            {
                file.Load();
                file.AutoSave = false;
                string[] res    = file.GetString("resolution").Split('x');
                int      width  = Convert.ToInt32(res[0]);
                int      height = Convert.ToInt32(res[1]);
                Screen.SetResolution(width, height, file.GetBool("fullscreen"));
                profile = file.GetString("profile");
                int fps = file.GetInt("fps");
                Application.targetFrameRate = fps >= 30 ? fps : -1;
                QualitySettings.SetQualityLevel(file.GetInt("graphics"), true);
                Localization.Language.SetLanguage(file.GetString("language"));

                Configuration.Settings.Load();
                Configuration.VideoSettings.Apply();
            }
            yield return(new WaitForSeconds(0.5f));

            Info.text = "Loading RCAssets...";
            yield return(StartCoroutine(RC.RCManager.DownloadAssets()));

            Optimization.Caching.Pool.Create();
            yield return(new WaitForSeconds(0.5f));

            Info.text = $"Loading profile({profile})..";
            User.LoadProfile(profile);
            Localization.Language.UpdateFormats();
            Localization.Locale loc = new Localization.Locale("GUI", true);

            GUI.LabelEnabled  = loc["enabled"];
            GUI.LabelDisabled = loc["disabled"];
            yield return(new WaitForSeconds(0.5f));

            Info.text = "Loading visuals..";
            Style.Load();
            Style.ResetScreenParameters();
            UIManager.UpdateGUIScaling();
            Optimization.Labels.Font = Style.Font;
            yield return(new WaitForSeconds(0.5f));

            Info.text = "Enjoy!";
            Optimization.Labels.VERSION = string.Format(UIMainReferences.VersionShow, AnarchyManager.AnarchyVersion.ToString());
            textUpdate   = false;
            Loading.text = "Loading complete";
            yield return(new WaitForSeconds(2f));

            Destroy(gameObject);
            AnarchyManager.Background.Enable();
        }
Example #2
0
 public void CmdSendQuery(string query)
 {
     if (ConfigFile.GetString("administrator_password", "none") != "none" && base.GetComponent <ServerRoles>().GetAccessToRemoteAdmin())
     {
         this.ProcessQuery(base.GetComponent <NetworkIdentity>().connectionToClient, query);
     }
 }
Example #3
0
 public void CmdCheckPassword(string admin_password)
 {
     if (base.GetComponent <ServerRoles>().GetAccessToRemoteAdmin())
     {
         this.CallTargetReturnValue(base.GetComponent <NetworkIdentity>().connectionToClient, new string[]
         {
             "_PasswordCheck_True"
         });
     }
     else
     {
         string @string = ConfigFile.GetString("administrator_password", "none");
         if (admin_password == @string && admin_password != string.Empty && @string != "none")
         {
             base.GetComponent <ServerRoles>().SetRole(5);
             this.CallTargetReturnValue(base.GetComponent <NetworkIdentity>().connectionToClient, new string[]
             {
                 "_PasswordCheck_True"
             });
         }
         else if (this.passwordTries >= 3)
         {
             BanPlayer.BanConnection(base.GetComponent <NetworkIdentity>().connectionToClient, 1);
         }
         else
         {
             this.CallTargetReturnValue(base.GetComponent <NetworkIdentity>().connectionToClient, new string[]
             {
                 "_PasswordCheck_False"
             });
             this.passwordTries++;
         }
     }
 }
Example #4
0
    public static int GetInt(string key, int defaultValue = 0)
    {
        int result = 0;

        if (int.TryParse(ConfigFile.GetString(key, "errorInConverting"), out result))
        {
            return(result);
        }
        return(defaultValue);
    }
Example #5
0
 private void Start()
 {
     if (base.isLocalPlayer)
     {
         if (base.isServer)
         {
             BanPlayer.dbpath = ConfigFile.GetString("ban_database_folder", "[appdata]/SCP Secret Laboratory/Bans");
             BanPlayer.dbpath = ((!BanPlayer.dbpath.Contains("[appdata]")) ? BanPlayer.dbpath : BanPlayer.dbpath.Replace("[appdata]", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)));
             BanPlayer.ReloadBans();
         }
         this.CallCmdSetHwId(SystemInfo.deviceUniqueIdentifier);
     }
 }
Example #6
0
    private void Start()
    {
        if (base.isLocalPlayer)
        {
            for (int i = 0; i < this.klasy.Length; i++)
            {
                this.klasy[i].fullName    = TranslationReader.Get("Class_Names", i);
                this.klasy[i].description = TranslationReader.Get("Class_Descriptions", i);
            }
            CharacterClassManager.staticClasses = this.klasy;
        }
        else if (CharacterClassManager.staticClasses == null || CharacterClassManager.staticClasses.Length == 0)
        {
            for (int j = 0; j < this.klasy.Length; j++)
            {
                this.klasy[j].description = TranslationReader.Get("Class_Descriptions", j);
                this.klasy[j].fullName    = TranslationReader.Get("Class_Names", j);
            }
        }
        else
        {
            this.klasy = CharacterClassManager.staticClasses;
        }
        this.lureSpj      = UnityEngine.Object.FindObjectOfType <LureSubjectContainer>();
        this.scp049       = base.GetComponent <Scp049PlayerScript>();
        this.scp049_2     = base.GetComponent <Scp049_2PlayerScript>();
        this.scp079       = base.GetComponent <Scp079PlayerScript>();
        this.scp106       = base.GetComponent <Scp106PlayerScript>();
        this.scp173       = base.GetComponent <Scp173PlayerScript>();
        this.scp096       = base.GetComponent <Scp096PlayerScript>();
        this.forceClass   = ConfigFile.GetInt("server_forced_class", -1);
        this.ciPercentage = (float)ConfigFile.GetInt("ci_on_start_percent", 10);
        base.StartCoroutine("Init");
        string text = ConfigFile.GetString("team_respawn_queue", "401431403144144") + "...........................";

        this.classTeamQueue.Clear();
        for (int k = 0; k < text.Length; k++)
        {
            int item = 4;
            if (!int.TryParse(text[k].ToString(), out item))
            {
                item = 4;
            }
            this.classTeamQueue.Add((Team)item);
        }
        if (!base.isLocalPlayer && TutorialManager.status)
        {
            this.ApplyProperties();
        }
    }
 private void Start()
 {
     this.plyID   = base.GetComponent <HlapiPlayer>();
     this.inv     = base.GetComponent <Inventory>();
     this.fpc     = base.GetComponent <FirstPersonController>();
     this.ammoBox = base.GetComponent <AmmoBox>();
     this.ccm     = base.GetComponent <CharacterClassManager>();
     this.invDis  = UnityEngine.Object.FindObjectOfType <InventoryDisplay>();
     if (base.isLocalPlayer)
     {
         if (base.isServer)
         {
             this.CallCmdSyncFF(ConfigFile.GetString("friendly_fire", "true").ToLower() == "true");
         }
         WeaponManager.holes.Clear();
     }
 }
Example #8
0
        public ServiceTarget()
        {
            //--- Init the config file and the message logger
            ConfigFile = new ConfigFile(Global.GetFileName(FileName_Cfg));

            TaskTimer          = new Timer();
            TaskTimer.Interval = Itv_TskTime;
            TaskTimer.Tick    += OnRunNextTask;
            ProgressManager    = new ProgressManager(ConfigFile.GetString(NodPath_Log_Path, true));

            //--- Init the task lists
            Tasks        = new List <Task>();
            TaskWaitList = new List <Task>();

            //--- Init the tasks
            InitTask(ImportADUserTask       = new ImportADUsersTask(this));
            InitTask(ImportSAPOrgaChartTask = new ImportSAPOrgaChartTask(this));
            InitTask(CleanUpTask            = new CleanUpTask(this));
        }
Example #9
0
        public static Patron FromString(string fileLine)
        {
            fileLine = fileLine?.Trim();

            if (string.IsNullOrEmpty(fileLine))
            {
                return(null);
            }

            string[] args = ArgumentParsing.StringToArgs(fileLine);

            if (ArgumentParsing.ArrayIsNullOrEmpty(args))
            {
                return(null);
            }

            string steam64Match = args[0];

            string tagTagValue    = ArgumentParsing.GetParamFromArgs(args, tagKeys, tagAliases);
            string colourTagValue = ArgumentParsing.GetParamFromArgs(args, colourKeys, colourAliases);
            string itemTagValue   = ArgumentParsing.GetParamFromArgs(args, itemKeys, itemAliases);
            bool   autoRefresh    = ArgumentParsing.GetFlagFromArgs(args, autoRefreshKeys, autoRefreshAliases);
            bool   autoReserve    = ArgumentParsing.GetFlagFromArgs(args, autoReserveKeys, autoReserveAliases);
            string rankTagValue   = ArgumentParsing.GetParamFromArgs(args, rankKeys, rankAliases);

            // Set from default or rank values
            if (tagTagValue == null)
            {
                const string rankConf = ConfigOptions.RankTag;
                const string defConf  = ConfigOptions.PatreonTag;
                tagTagValue = ConfigOptions.ContainsRank(rankConf, rankTagValue) ? ConfigFile.GetString(ConfigOptions.GetRankConf(rankConf, rankTagValue)) : PatreonPlugin.Singleton.GetConfigString(defConf);

                // PatreonPlugin.Singleton.Debug("No custom tag value, using default tag from " + (ConfigOptions.ContainsRank(rankConf, rankTagValue) ? "rank" : "patreon") + " config: \"" + tagTagValue + "\"");
            }

            if (colourTagValue == null)
            {
                const string rankConf = ConfigOptions.RankTagColour;
                const string defConf  = ConfigOptions.PatreonTagColour;
                colourTagValue = ConfigOptions.ContainsRank(rankConf, rankTagValue) ? ConfigFile.GetString(ConfigOptions.GetRankConf(rankConf, rankTagValue)) : PatreonPlugin.Singleton.GetConfigString(defConf);

                // PatreonPlugin.Singleton.Debug("No custom colour value, using default colour from " + (ConfigOptions.ContainsRank(rankConf, rankTagValue) ? "rank" : "patreon") + " config: \"" + colourTagValue + "\"");
            }

            if (itemTagValue == null)
            {
                const string rankConf = ConfigOptions.RankItems;
                const string defConf  = ConfigOptions.PatreonItems;
                itemTagValue = ConfigOptions.ContainsRank(rankConf, rankTagValue) ? ConfigFile.GetString(ConfigOptions.GetRankConf(rankConf, rankTagValue)) : PatreonPlugin.Singleton.GetConfigString(defConf);

                // PatreonPlugin.Singleton.Debug("No custom items value, using default items from " + (ConfigOptions.ContainsRank(rankConf, rankTagValue) ? "rank" : "patreon") + " config: \"" + itemTagValue + "\"");
            }

            if (!autoRefresh)
            {
                const string rankConf = ConfigOptions.RankTagAutoRefresh;
                const string defConf  = ConfigOptions.PatreonTagAutoRefresh;
                autoRefresh = ConfigOptions.ContainsRank(rankConf, rankTagValue) ? ConfigFile.GetBool(ConfigOptions.GetRankConf(rankConf, rankTagValue)) : PatreonPlugin.Singleton.GetConfigBool(defConf);

                // PatreonPlugin.Singleton.Debug("No custom auto-refresh value, using default auto-refresh from " + (ConfigOptions.ContainsRank(rankConf, rankTagValue) ? "rank" : "patreon") + " config: \"" + AutoRefreshTags + "\"");
            }

            if (!autoReserve)
            {
                const string rankConf = ConfigOptions.RankAutoReserve;
                const string defConf  = ConfigOptions.PatreonAutoReserve;
                autoReserve = ConfigOptions.ContainsRank(rankConf, rankTagValue) ? ConfigFile.GetBool(ConfigOptions.GetRankConf(rankConf, rankTagValue)) : PatreonPlugin.Singleton.GetConfigBool(defConf);

                // PatreonPlugin.Singleton.Debug("No custom auto-reserve value, using default auto-reserve from " + (ConfigOptions.ContainsRank(rankConf, rankTagValue) ? "rank" : "patreon") + " config: \"" + AutoRefreshTags + "\"");
            }

            // Return new instance with values
            return(new Patron(steam64Match, tagTagValue, colourTagValue, itemTagValue, autoRefresh, autoReserve, rankTagValue));
        }
Example #10
0
 public static void Load()
 {
     using (ConfigFile config = new ConfigFile(Application.dataPath + "/Configuration/Visuals.ini", ':', false))
     {
         config.Load();
         config.AutoSave        = false;
         FontName               = config.GetString("font");
         Font                   = AnarchyAssets.Load <Font>(FontName);
         BackgroundHex          = config.GetString("background");
         BackgroundTransparency = config.GetInt("backgroundTransparency");
         TextColors             = new string[6];
         TextColors[0]          = config.GetString("textNormal");
         TextColors[1]          = config.GetString("textHover");
         TextColors[2]          = config.GetString("textActive");
         TextColors[3]          = config.GetString("textOnNormal");
         TextColors[4]          = config.GetString("textOnHover");
         TextColors[5]          = config.GetString("textOnActive");
         TextureDeltas          = new Vector3[6];
         TextureDeltas[0]       = config.GetString("normalVector").ParseVector3();
         TextureDeltas[1]       = config.GetString("hoverVector").ParseVector3();
         TextureDeltas[2]       = config.GetString("activeVector").ParseVector3();
         TextureDeltas[3]       = config.GetString("onNormalVector").ParseVector3();
         TextureDeltas[4]       = config.GetString("onHoverVector").ParseVector3();
         TextureDeltas[5]       = config.GetString("onActiveVector").ParseVector3();
         if (!config.AllValues.ContainsKey("useVectors"))
         {
             UseVectors = false;
         }
         else
         {
             UseVectors = config.GetBool("useVectors");
         }
         TextureColors = new Color[6];
         if (!config.AllValues.ContainsKey("colorNormal") || !config.AllValues.ContainsKey("colorHover") || !config.AllValues.ContainsKey("colorActive") ||
             !config.AllValues.ContainsKey("colorOnNormal") || !config.AllValues.ContainsKey("colorOnHover") || !config.AllValues.ContainsKey("colorOnActive"))
         {
             UseVectors = true;
             Color[] colors = Helper.TextureColors(BackgroundColor, 6);
             for (int i = 0; i < 6; i++)
             {
                 TextureColors[i] = colors[i];
             }
             UseVectors = false;
         }
         else
         {
             TextureColors[0] = config.GetString("colorNormal").HexToColor();
             TextureColors[1] = config.GetString("colorHover").HexToColor();
             TextureColors[2] = config.GetString("colorActive").HexToColor();
             TextureColors[3] = config.GetString("colorOnNormal").HexToColor();
             TextureColors[4] = config.GetString("colorOnHover").HexToColor();
             TextureColors[5] = config.GetString("colorOnActive").HexToColor();
         }
         LoadPublicSettings();
     }
     wasLoaded = true;
     Initialize();
 }
Example #11
0
 public static void Load()
 {
     using (ConfigFile config = new ConfigFile(Application.dataPath + "/Configuration/Visuals.ini", ':', false))
     {
         using (ConfigFile settings = new ConfigFile(Application.dataPath + "/Configuration/Settings.ini", ' ', false))
         {
             settings.Load();
             settings.AutoSave = true;
             string[] res = settings.GetString("resolution").Split('x');
             ScreenWidthDefault  = (float)System.Convert.ToInt32(res[0]);
             ScreenHeightDefault = (float)System.Convert.ToInt32(res[1]);
             if (PlayerPrefs.GetInt("AnarchyModLaunched") == 0)
             {
                 PlayerPrefs.SetInt("AnarchyModLaunched", 1);
                 float xScale     = ScreenWidthDefault / 1920f;
                 float yScale     = ScreenHeightDefault / 1080f;
                 float totalScale = (xScale + yScale) / 2f;
                 UIManager.HUDScaleGUI.Value = Mathf.Clamp(totalScale, 0.75f, 1.5f);
                 UIManager.HUDScaleGUI.Save();
             }
             ResetScreenParameters();
         }
         config.Load();
         config.AutoSave        = false;
         FontName               = config.GetString("font");
         Font                   = AnarchyAssets.Load <Font>(FontName);
         BackgroundHex          = config.GetString("background");
         BackgroundTransparency = config.GetInt("backgroundTransparency");
         TextColors             = new string[6];
         TextColors[0]          = config.GetString("textNormal");
         TextColors[1]          = config.GetString("textHover");
         TextColors[2]          = config.GetString("textActive");
         TextColors[3]          = config.GetString("textOnNormal");
         TextColors[4]          = config.GetString("textOnHover");
         TextColors[5]          = config.GetString("textOnActive");
         TextureDeltas          = new Vector3[6];
         TextureDeltas[0]       = config.GetString("normalVector").ParseVector3();
         TextureDeltas[1]       = config.GetString("hoverVector").ParseVector3();
         TextureDeltas[2]       = config.GetString("activeVector").ParseVector3();
         TextureDeltas[3]       = config.GetString("onNormalVector").ParseVector3();
         TextureDeltas[4]       = config.GetString("onHoverVector").ParseVector3();
         TextureDeltas[5]       = config.GetString("onActiveVector").ParseVector3();
         if (!config.AllValues.ContainsKey("useVectors"))
         {
             UseVectors = false;
         }
         else
         {
             UseVectors = config.GetBool("useVectors");
         }
         TextureColors = new Color[6];
         if (!config.AllValues.ContainsKey("colorNormal") || !config.AllValues.ContainsKey("colorHover") || !config.AllValues.ContainsKey("colorActive") ||
             !config.AllValues.ContainsKey("colorOnNormal") || !config.AllValues.ContainsKey("colorOnHover") || !config.AllValues.ContainsKey("colorOnActive"))
         {
             UseVectors = true;
             Color[] colors = Helper.TextureColors(BackgroundColor, 6);
             for (int i = 0; i < 6; i++)
             {
                 TextureColors[i] = colors[i];
             }
             UseVectors = false;
         }
         else
         {
             TextureColors[0] = config.GetString("colorNormal").HexToColor();
             TextureColors[1] = config.GetString("colorHover").HexToColor();
             TextureColors[2] = config.GetString("colorActive").HexToColor();
             TextureColors[3] = config.GetString("colorOnNormal").HexToColor();
             TextureColors[4] = config.GetString("colorOnHover").HexToColor();
             TextureColors[5] = config.GetString("colorOnActive").HexToColor();
         }
         LoadPublicSettings();
     }
     wasLoaded = true;
     Initialize();
 }
Example #12
0
 public static bool ContainsRank(string rankConfigString, string rank)
 {
     return(!string.IsNullOrEmpty(rank) && ConfigFile.GetString(string.Format(rankConfigString, rank), null) != null);
 }
    private IEnumerator CreateLobby()
    {
        yield return(new WaitForEndOfFrame());

        string ip = string.Empty;

        if (ConfigFile.GetString("server_ip", "auto") != "auto")
        {
            ip = ConfigFile.GetString("server_ip", "auto");
            ServerConsole.AddLog("Custom config detected. Your game-server IP will be " + ip);
        }
        else
        {
            ServerConsole.AddLog("Downloading your external IP address from: http://icanhazip.com/");
            WWW www = new WWW("http://icanhazip.com/");
            yield return(www);

            if (!string.IsNullOrEmpty(www.error))
            {
                ServerConsole.AddLog("Error: connection to http://icanhazip.com/ failed. Website returned: " + www.error + " | Aborting startup... LOGTYPE-8");
                yield break;
            }
            ip = www.text.Remove(www.text.Length - 1);
            ServerConsole.AddLog("Done, your game-server IP will be " + ip);
        }
        ServerConsole.AddLog("Initializing game-server...");
        this.StartHost();
        while (SceneManager.GetActiveScene().name != "Facility")
        {
            yield return(new WaitForEndOfFrame());
        }
        ServerConsole.AddLog("Level loaded. Creating match...");
        string info = string.Concat(new string[]
        {
            ConfigFile.GetString("server_name", "Unnamed server"),
            ":[:BREAK:]:",
            ConfigFile.GetString("serverinfo_pastebin_id", "7wV681fT"),
            ":[:BREAK:]:",
            this.versionstring
        });

        ServerConsole.ip = ip;
        WWWForm form = new WWWForm();

        form.AddField("update", 1);
        form.AddField("ip", ip);
        form.AddField("info", info);
        form.AddField("port", base.networkPort);
        form.AddField("players", 0);
        bool   codeNotGenerated = false;
        string pth = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/SCP Secret Laboratory/verkey.txt";

        if (File.Exists(pth))
        {
            StreamReader streamReader = new StreamReader(pth);
            string       text         = streamReader.ReadToEnd();
            form.AddField("passcode", text);
            ServerConsole.password = text;
            streamReader.Close();
        }
        else
        {
            form.AddField("passcode", string.Empty);
            codeNotGenerated = true;
        }
        WWW www2 = new WWW("https://hubertmoszka.pl/authenticator.php", form);

        yield return(www2);

        if (string.IsNullOrEmpty(www2.error))
        {
            if (www2.text.Contains("YES"))
            {
                UnityEngine.Object.FindObjectOfType <ServerConsole>().RunServer();
                ServerConsole.AddLog("The match is ready!LOGTYPE-8");
                if (codeNotGenerated)
                {
                    try
                    {
                        StreamWriter streamWriter = new StreamWriter(pth);
                        string       text2        = www2.text.Remove(0, www2.text.IndexOf(":")).Remove(www2.text.IndexOf(":"));
                        while (text2.Contains(":"))
                        {
                            text2 = text2.Replace(":", string.Empty);
                        }
                        streamWriter.WriteLine(text2);
                        streamWriter.Close();
                        ServerConsole.AddLog("New password saved.LOGTYPE-8");
                    }
                    catch
                    {
                        ServerConsole.AddLog("New password could not be saved.LOGTYPE-8");
                    }
                    yield return(new WaitForSeconds(2f));

                    ServerConsole.AddLog("THIS SESSION HAS TO BE RESTARTED TO CONTINUE.LOGTYPE-2");
                    yield return(new WaitForSeconds(2f));

                    ServerConsole.AddLog("This is a standard procedure. Don't worry about that crash!LOGTYPE-2");
                    yield return(new WaitForSeconds(2f));

                    ServerConsole.AddLog("Forcing the crash in:LOGTYPE-2");
                    for (int i = 5; i > 0; i--)
                    {
                        yield return(new WaitForSeconds(1f));

                        ServerConsole.AddLog(i + "LOGTYPE-2");
                    }
                    Application.Quit();
                }
            }
            else
            {
                ServerConsole.AddLog(string.Concat(new string[]
                {
                    "Your server won't be visible on the public server list - ",
                    www2.text,
                    " (",
                    ip,
                    ")LOGTYPE-8"
                }));
                ServerConsole.AddLog("If you are 100% sure that the server is working correctly send your IP address at: LOGTYPE-8");
                ServerConsole.AddLog("[email protected] LOGTYPE-8");
            }
        }
        else
        {
            ServerConsole.AddLog("Could not create the match - " + www2.error + "LOGTYPE-8");
        }
        yield break;
    }
Example #14
0
 public string TypeCommand(string cmd)
 {
     try
     {
         if (!GameObject.Find("Host").GetComponent <NetworkIdentity>().isLocalPlayer)
         {
             this.AddLog("Console commands are disabled for the clients.", new Color32(byte.MaxValue, 0, 0, byte.MaxValue), false);
             return("not owner");
         }
     }
     catch
     {
         return("not owner");
     }
     this.response = string.Empty;
     string[] array = cmd.ToUpper().Split(new char[]
     {
         ' '
     });
     cmd = array[0];
     if (cmd == "HELLO")
     {
         this.AddLog("Hello World!", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false);
     }
     else if (cmd == "LENNY")
     {
         this.AddLog("<size=450>( ͡° ͜ʖ ͡°)</size>\n\n", new Color32(byte.MaxValue, 180, 180, byte.MaxValue), false);
     }
     else if (cmd == "GIVE")
     {
         int num = 0;
         if (array.Length >= 2 && int.TryParse(array[1], out num))
         {
             string       a      = "offline";
             GameObject[] array2 = GameObject.FindGameObjectsWithTag("Player");
             foreach (GameObject gameObject in array2)
             {
                 if (gameObject.GetComponent <NetworkIdentity>().isLocalPlayer)
                 {
                     a = "online";
                     Inventory component = gameObject.GetComponent <Inventory>();
                     if (component != null)
                     {
                         if (component.availableItems.Length > num)
                         {
                             component.AddNewItem(num, -4.65664672E+11f);
                             a = "none";
                         }
                         else
                         {
                             this.AddLog("Failed to add ITEM#" + num.ToString("000") + " - item does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
                         }
                     }
                 }
             }
             if (a == "offline" || a == "online")
             {
                 this.AddLog((!(a == "offline")) ? "Player inventory script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
             }
             else
             {
                 this.AddLog("ITEM#" + num.ToString("000") + " has been added!", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false);
             }
         }
         else
         {
             this.AddLog("Second argument has to be a number!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
         }
     }
     else if (cmd == "ITEMLIST")
     {
         string       a2     = "offline";
         GameObject[] array4 = GameObject.FindGameObjectsWithTag("Player");
         foreach (GameObject gameObject2 in array4)
         {
             int num2 = 1;
             if (array.Length >= 2 && !int.TryParse(array[1], out num2))
             {
                 this.AddLog("Please enter correct page number!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
                 return(this.response);
             }
             if (gameObject2.GetComponent <NetworkIdentity>().isLocalPlayer)
             {
                 a2 = "online";
                 Inventory component2 = gameObject2.GetComponent <Inventory>();
                 if (component2 != null)
                 {
                     a2 = "none";
                     if (num2 < 1)
                     {
                         this.AddLog("Page '" + num2 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
                         this.RefreshConsoleScreen();
                         return(this.response);
                     }
                     Item[] availableItems = component2.availableItems;
                     for (int k = 10 * (num2 - 1); k < 10 * num2; k++)
                     {
                         if (10 * (num2 - 1) > availableItems.Length)
                         {
                             this.AddLog("Page '" + num2 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
                             break;
                         }
                         if (k >= availableItems.Length)
                         {
                             break;
                         }
                         this.AddLog("ITEM#" + k.ToString("000") + " : " + availableItems[k].label, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false);
                     }
                 }
             }
         }
         if (a2 != "none")
         {
             this.AddLog((!(a2 == "offline")) ? "Player inventory script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
         }
     }
     else if (cmd == "CLS" || cmd == "CLEAR")
     {
         this.logs.Clear();
         this.RefreshConsoleScreen();
     }
     else if (cmd == "QUIT" || cmd == "EXIT")
     {
         this.logs.Clear();
         this.RefreshConsoleScreen();
         this.AddLog("<size=50>GOODBYE!</size>", new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false);
         this.RefreshConsoleScreen();
         base.Invoke("QuitGame", 1f);
     }
     else if (cmd == "HELP")
     {
         if (array.Length > 1)
         {
             string b = array[1];
             foreach (Console.CommandHint commandHint in this.hints)
             {
                 if (commandHint.name == b)
                 {
                     this.AddLog(commandHint.name + " - " + commandHint.fullDesc, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false);
                     this.RefreshConsoleScreen();
                     return(this.response);
                 }
             }
             this.AddLog("Help for command '" + array[1] + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
             this.RefreshConsoleScreen();
             return(this.response);
         }
         this.AddLog("List of available commands:\n", new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false);
         foreach (Console.CommandHint commandHint2 in this.hints)
         {
             this.AddLog(commandHint2.name + " - " + commandHint2.shortDesc, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), true);
         }
         this.AddLog("Type 'HELP [COMMAND]' to print a full description of the chosen command.", new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false);
         this.RefreshConsoleScreen();
     }
     else if (cmd == "REFRESHFIX")
     {
         this.allwaysRefreshing = !this.allwaysRefreshing;
         this.AddLog("Console log refresh mode: " + ((!this.allwaysRefreshing) ? "OPTIMIZED" : "FIXED"), new Color32(0, byte.MaxValue, 0, byte.MaxValue), false);
     }
     else if (cmd == "VALUE")
     {
         if (array.Length < 2)
         {
             this.AddLog("The second argument cannot be <i>null</i>!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
         }
         else
         {
             bool   flag = false;
             string text = array[1];
             foreach (Console.Value value in this.values)
             {
                 if (value.key == text)
                 {
                     flag = true;
                     this.AddLog(string.Concat(new string[]
                     {
                         "The value of ",
                         text,
                         " is: @#{[",
                         text,
                         "}]#@"
                     }), new Color32(50, 70, 100, byte.MaxValue), false);
                 }
             }
             if (!flag)
             {
                 this.AddLog("Key " + text + " not found!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
             }
         }
     }
     else if (cmd == "SEED")
     {
         GameObject gameObject3 = GameObject.Find("Host");
         int        num3        = -1;
         if (gameObject3 != null)
         {
             num3 = gameObject3.GetComponent <RandomSeedSync>().seed;
         }
         this.AddLog("Map seed is: <b>" + ((num3 != -1) ? num3.ToString() : "NONE") + "</b>", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false);
     }
     else if (cmd == "SHOWRIDS")
     {
         GameObject[] array8 = GameObject.FindGameObjectsWithTag("RoomID");
         foreach (GameObject gameObject4 in array8)
         {
             gameObject4.GetComponentsInChildren <MeshRenderer>()[0].enabled = !gameObject4.GetComponentsInChildren <MeshRenderer>()[0].enabled;
             gameObject4.GetComponentsInChildren <MeshRenderer>()[1].enabled = !gameObject4.GetComponentsInChildren <MeshRenderer>()[1].enabled;
         }
         if (array8.Length > 0)
         {
             this.AddLog("Show RIDS: " + array8[0].GetComponentInChildren <MeshRenderer>().enabled, new Color32(0, byte.MaxValue, 0, byte.MaxValue), false);
         }
         else
         {
             this.AddLog("There are no RIDS!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
         }
     }
     else if (cmd == "CLASSLIST")
     {
         string       a3      = "offline";
         GameObject[] array10 = GameObject.FindGameObjectsWithTag("Player");
         foreach (GameObject gameObject5 in array10)
         {
             int num5 = 1;
             if (array.Length >= 2 && !int.TryParse(array[1], out num5))
             {
                 this.AddLog("Please enter correct page number!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
                 return(this.response);
             }
             if (gameObject5.GetComponent <NetworkIdentity>().isLocalPlayer)
             {
                 a3 = "online";
                 CharacterClassManager component3 = gameObject5.GetComponent <CharacterClassManager>();
                 if (component3 != null)
                 {
                     a3 = "none";
                     if (num5 < 1)
                     {
                         this.AddLog("Page '" + num5 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
                         this.RefreshConsoleScreen();
                         return(this.response);
                     }
                     Class[] klasy = component3.klasy;
                     for (int num6 = 10 * (num5 - 1); num6 < 10 * num5; num6++)
                     {
                         if (10 * (num5 - 1) > klasy.Length)
                         {
                             this.AddLog("Page '" + num5 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
                             break;
                         }
                         if (num6 >= klasy.Length)
                         {
                             break;
                         }
                         this.AddLog("CLASS#" + num6.ToString("000") + " : " + klasy[num6].fullName, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false);
                     }
                 }
             }
         }
         if (a3 != "none")
         {
             this.AddLog((!(a3 == "offline")) ? "Player inventory script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
         }
     }
     else if (cmd == "GOTO")
     {
         if (array.Length >= 2)
         {
             GameObject   gameObject6 = null;
             GameObject[] array12     = GameObject.FindGameObjectsWithTag("RoomID");
             foreach (GameObject gameObject7 in array12)
             {
                 if (gameObject7.GetComponent <Rid>().id.ToUpper() == array[1].ToUpper())
                 {
                     gameObject6 = gameObject7;
                 }
             }
             string a4 = "offline";
             if (gameObject6 != null)
             {
                 GameObject[] array14 = GameObject.FindGameObjectsWithTag("Player");
                 foreach (GameObject gameObject8 in array14)
                 {
                     if (gameObject8.GetComponent <NetworkIdentity>().isLocalPlayer)
                     {
                         if (array[1].ToUpper() == "RANGE" && !gameObject8.GetComponent <ShootingRange>().isOnRange)
                         {
                             a4 = "range";
                         }
                         else
                         {
                             a4 = "none";
                             gameObject8.transform.position = gameObject6.transform.position;
                         }
                     }
                 }
                 if (a4 == "range")
                 {
                     this.AddLog("<b>Shooting range is disabled!</b>", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
                 }
                 else if (a4 == "offline")
                 {
                     this.AddLog("You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
                 }
                 else
                 {
                     this.AddLog("Teleported!", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false);
                 }
             }
             else
             {
                 this.AddLog("Room: <i>" + array[1].ToUpper() + "</i> not found!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
             }
         }
         else
         {
             this.AddLog("Second argument is missing!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
         }
         this.RefreshConsoleScreen();
     }
     else if (cmd == "RANGE")
     {
         string       a5      = "offline";
         GameObject[] array16 = GameObject.FindGameObjectsWithTag("Player");
         foreach (GameObject gameObject9 in array16)
         {
             if (gameObject9.GetComponent <NetworkIdentity>().isLocalPlayer)
             {
                 a5 = "online";
                 ShootingRange component4 = gameObject9.GetComponent <ShootingRange>();
                 if (component4 != null)
                 {
                     a5 = "none";
                     component4.isOnRange = true;
                 }
             }
         }
         if (a5 == "offline" || a5 == "online")
         {
             this.AddLog((!(a5 == "offline")) ? "Player range script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
         }
         else
         {
             this.AddLog("<b>Shooting range</b> is now available!", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false);
         }
     }
     else if (cmd == "ROUNDRESTART")
     {
         bool flag2 = false;
         foreach (GameObject gameObject10 in GameObject.FindGameObjectsWithTag("Player"))
         {
             PlayerStats component5 = gameObject10.GetComponent <PlayerStats>();
             if (component5.isLocalPlayer && component5.isServer)
             {
                 flag2 = true;
                 this.AddLog("The round is about to restart! Please wait..", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false);
                 component5.Roundrestart();
             }
         }
         if (!flag2)
         {
             this.AddLog("You're not owner of this server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
         }
     }
     else if (cmd == "CONFIG")
     {
         if (array.Length < 2)
         {
             this.TypeCommand("HELP CONFIG");
         }
         else
         {
             string text2 = array[1];
             if (text2 != null)
             {
                 if (!(text2 == "RELOAD") && !(text2 == "R") && !(text2 == "RLD"))
                 {
                     if (!(text2 == "PATH"))
                     {
                         if (text2 == "VALUE")
                         {
                             if (array.Length < 3)
                             {
                                 this.AddLog("Please enter key name in the third argument. (CONFIG VALUE <i>KEYNAME</i>)", new Color32(byte.MaxValue, byte.MaxValue, 0, byte.MaxValue), false);
                             }
                             else
                             {
                                 this.AddLog("The value of <i>'" + array[2] + "'</i> is: " + ConfigFile.GetString(array[2], "<color=ff0>DENIED: Entered key does not exists</color>"), new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false);
                             }
                         }
                     }
                     else
                     {
                         this.AddLog("Configuration file path: <i>" + ConfigFile.path + "</i>", new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false);
                         this.AddLog("<i>No visible drive letter means the root game directory.</i>", new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false);
                     }
                 }
                 else if (ConfigFile.singleton.ReloadConfig())
                 {
                     this.AddLog("Configuration file <b>successfully reloaded</b>. New settings will be applied on <b>your</b> server in <b>next</b> round.", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false);
                 }
                 else
                 {
                     this.AddLog("Configuration file reload <b>failed</b> - no such file - '<i>" + ConfigFile.path + "</i>'. Loading defult settings..", new Color32(byte.MaxValue, 0, 0, byte.MaxValue), false);
                     this.AddLog("Default settings have been loaded.", new Color32(byte.MaxValue, byte.MaxValue, 0, byte.MaxValue), false);
                 }
             }
         }
     }
     else if (cmd == "BAN")
     {
         if (GameObject.Find("Host").GetComponent <NetworkIdentity>().isLocalPlayer)
         {
             if (array.Length < 3)
             {
                 this.AddLog("Syntax: BAN [player kick / ip] [minutes]", new Color32(byte.MaxValue, byte.MaxValue, 0, byte.MaxValue), false);
                 foreach (NetworkConnection networkConnection in NetworkServer.connections)
                 {
                     string     text3        = string.Empty;
                     GameObject gameObject11 = Console.FindConnectedRoot(networkConnection);
                     if (gameObject11 != null)
                     {
                         text3 = gameObject11.GetComponent <NicknameSync>().myNick;
                     }
                     if (text3 == string.Empty)
                     {
                         this.AddLog("Player :: " + networkConnection.address, new Color32(160, 128, 128, byte.MaxValue), true);
                     }
                     else
                     {
                         this.AddLog("Player :: " + text3 + " :: " + networkConnection.address, new Color32(128, 160, 128, byte.MaxValue), true);
                     }
                 }
             }
             else
             {
                 int duration = 0;
                 if (int.TryParse(array[2], out duration))
                 {
                     bool flag3 = false;
                     foreach (NetworkConnection networkConnection2 in NetworkServer.connections)
                     {
                         GameObject gameObject12 = Console.FindConnectedRoot(networkConnection2);
                         if (networkConnection2.address.ToUpper().Contains(array[1]) || (gameObject12 != null && gameObject12.GetComponent <NicknameSync>().myNick.ToUpper().Contains(array[1])))
                         {
                             flag3 = true;
                             BanPlayer.BanConnection(networkConnection2, duration);
                             this.AddLog("Player banned.", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false);
                         }
                     }
                     if (!flag3)
                     {
                         this.AddLog("Player not found.", new Color32(byte.MaxValue, byte.MaxValue, 0, byte.MaxValue), false);
                     }
                 }
                 else
                 {
                     this.AddLog("Parse error: [minutes] - has to be an integer.", new Color32(byte.MaxValue, byte.MaxValue, 0, byte.MaxValue), false);
                 }
             }
         }
         else
         {
             this.AddLog("You are not the owner!.", new Color32(byte.MaxValue, byte.MaxValue, 0, byte.MaxValue), false);
         }
     }
     else if (cmd == "BANREFRESH")
     {
         if (GameObject.Find("Host").GetComponent <NetworkIdentity>().isLocalPlayer)
         {
             BanPlayer.ReloadBans();
         }
         else
         {
             this.AddLog("You are not the owner!.", new Color32(byte.MaxValue, byte.MaxValue, 0, byte.MaxValue), false);
         }
     }
     else
     {
         this.AddLog("Command " + cmd + " does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false);
     }
     return(this.response);
 }
Example #15
0
 public bool GetAccessToRemoteAdmin()
 {
     ServerRoles.Role role = this.roles[this.myRole];
     return(role.remoteAdminAccess != ServerRoles.RemoteAdminAccess.Never && (role.remoteAdminAccess == ServerRoles.RemoteAdminAccess.Allways || (role.remoteAdminAccess == ServerRoles.RemoteAdminAccess.ConfigOnly && ConfigFile.GetString("allow_scpsl_staff_to_use_remoteadmin", "true") == "true")));
 }
Example #16
0
        public static Patron FromString(string fileLine)
        {
            fileLine = fileLine?.Trim();

            if (string.IsNullOrEmpty(fileLine))
            {
                return(null);
            }

            string steam64Match = FindFirstSteamId(fileLine);

            if (string.IsNullOrEmpty(steam64Match))
            {
                return(null);
            }

            string tagTagValue    = MatchOption(fileLine, tagRegex, tagOptionRegex);
            string colourTagValue = MatchOption(fileLine, colourRegex, colourOptionRegex);
            string itemTagValue   = MatchOption(fileLine, itemsRegex, itemsOptionRegex);
            bool   autoRefresh    = MatchFlag(fileLine, autoRefreshRegex);
            bool   autoReserve    = MatchFlag(fileLine, autoReserveRegex);
            string rankTagValue   = MatchOption(fileLine, rankRegex, rankOptionRegex);

            // Set from default or rank values
            if (tagTagValue == null)
            {
                const string rankConf = ConfigOptions.RankTag;
                const string defConf  = ConfigOptions.PatreonTag;
                tagTagValue = ConfigOptions.ContainsRank(rankConf, rankTagValue) ? ConfigFile.GetString(ConfigOptions.GetRankConf(rankConf, rankTagValue)) : PatreonPlugin.Singleton.GetConfigString(defConf);

                // PatreonPlugin.Singleton.Debug("No custom tag value, using default tag from " + (ConfigOptions.ContainsRank(rankConf, rankTagValue) ? "rank" : "patreon") + " config: \"" + tagTagValue + "\"");
            }

            if (colourTagValue == null)
            {
                const string rankConf = ConfigOptions.RankTagColour;
                const string defConf  = ConfigOptions.PatreonTagColour;
                colourTagValue = ConfigOptions.ContainsRank(rankConf, rankTagValue) ? ConfigFile.GetString(ConfigOptions.GetRankConf(rankConf, rankTagValue)) : PatreonPlugin.Singleton.GetConfigString(defConf);

                // PatreonPlugin.Singleton.Debug("No custom colour value, using default colour from " + (ConfigOptions.ContainsRank(rankConf, rankTagValue) ? "rank" : "patreon") + " config: \"" + colourTagValue + "\"");
            }

            if (itemTagValue == null)
            {
                const string rankConf = ConfigOptions.RankItems;
                const string defConf  = ConfigOptions.PatreonItems;
                itemTagValue = ConfigOptions.ContainsRank(rankConf, rankTagValue) ? ConfigFile.GetString(ConfigOptions.GetRankConf(rankConf, rankTagValue)) : PatreonPlugin.Singleton.GetConfigString(defConf);

                // PatreonPlugin.Singleton.Debug("No custom items value, using default items from " + (ConfigOptions.ContainsRank(rankConf, rankTagValue) ? "rank" : "patreon") + " config: \"" + itemTagValue + "\"");
            }

            if (!autoRefresh)
            {
                const string rankConf = ConfigOptions.RankTagAutoRefresh;
                const string defConf  = ConfigOptions.PatreonTagAutoRefresh;
                autoRefresh = ConfigOptions.ContainsRank(rankConf, rankTagValue) ? ConfigFile.GetBool(ConfigOptions.GetRankConf(rankConf, rankTagValue)) : PatreonPlugin.Singleton.GetConfigBool(defConf);

                // PatreonPlugin.Singleton.Debug("No custom auto-refresh value, using default auto-refresh from " + (ConfigOptions.ContainsRank(rankConf, rankTagValue) ? "rank" : "patreon") + " config: \"" + AutoRefreshTags + "\"");
            }

            if (!autoReserve)
            {
                const string rankConf = ConfigOptions.RankAutoReserve;
                const string defConf  = ConfigOptions.PatreonAutoReserve;
                autoReserve = ConfigOptions.ContainsRank(rankConf, rankTagValue) ? ConfigFile.GetBool(ConfigOptions.GetRankConf(rankConf, rankTagValue)) : PatreonPlugin.Singleton.GetConfigBool(defConf);

                // PatreonPlugin.Singleton.Debug("No custom auto-reserve value, using default auto-reserve from " + (ConfigOptions.ContainsRank(rankConf, rankTagValue) ? "rank" : "patreon") + " config: \"" + AutoRefreshTags + "\"");
            }

            // Return new instance with values
            return(new Patron(steam64Match, tagTagValue, colourTagValue, itemTagValue, autoRefresh, autoReserve, rankTagValue));
        }
Example #17
0
 public string GetServerPassword()
 {
     return(Library.Text.Crypt.Decrypt(ConfigFile.GetString(NodPath_SBM_Pwd, true)));
 }
Example #18
0
 public string GetServerUser()
 {
     return(ConfigFile.GetString(NodPath_SBM_Usr, true));
 }
Example #19
0
 public string GetServerName()
 {
     return(ConfigFile.GetString(NodPath_SBM_Svr, true));
 }
    public int GetFreePort()
    {
        ServerConsole.AddLog("Loading config... - " + ConfigFile.path);
        string @string = ConfigFile.GetString("port_queue", "7777,7778,7779,7780,7781,7782,7783,7784");

        try
        {
            while (@string.Contains(" "))
            {
                @string.Replace(" ", string.Empty);
            }
        }
        catch
        {
            ServerConsole.AddLog("Failed to remove spaces from config - port_queue - please make it manualy.");
        }
        string q = string.Empty;

        try
        {
            q = "Failed to split ports.";
            string[] array = @string.Split(new char[]
            {
                ','
            });
            if (array.Length == 0)
            {
                q = "Failed to detect ports.";
                throw new Exception();
            }
            ServerConsole.AddLog("Port queue loaded: " + @string);
            for (int i = 0; i < array.Length; i++)
            {
                ServerConsole.AddLog("Trying to init port: " + array[i] + "...");
                q = "Failed to convert [" + array[i] + "]  into integer number!";
                base.networkPort = int.Parse(array[i]);
                if (NetworkServer.Listen(base.networkPort))
                {
                    NetworkServer.Reset();
                    string text = string.Concat(new object[]
                    {
                        Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                        "/SCP Secret Laboratory/",
                        base.networkPort,
                        "/config.txt"
                    });
                    if (File.Exists(text))
                    {
                        q = "Failed to read config file: " + text;
                        ConfigFile.path = text;
                        ConfigFile.singleton.ReloadConfig();
                        ServerConsole.AddLog("Custom config detected, using " + text);
                    }
                    else
                    {
                        ServerConsole.AddLog("No custom config detected, using config.txt");
                    }
                    ServerConsole.AddLog("Done!LOGTYPE-10");
                    return(base.networkPort);
                }
                ServerConsole.AddLog("...failed.LOGTYPE-6");
            }
        }
        catch
        {
            ServerConsole.AddLog(q);
        }
        return(7777);
    }