public static void ReloadGameConfigs(bool firstTime = false) { orig_ReloadGameConfigs(firstTime); YamlConfig ServerConfig = GameCore.ConfigFile.ServerConfig; announceChaos = ServerConfig.GetBool("announce_chaos_spawn", true); chaosAnnouncement = ServerConfig.GetString("chaos_announcement", "PITCH_1 ATTENTION ALL PERSONNEL . CHAOS INSURGENCY BREACH IN PROGRESS"); cassieGlitch = ServerConfig.GetBool("cassie_glitch", false); cassieGlitchDetonation = ServerConfig.GetBool("cassie_glitch_post_detonation", false); stickyRound = ServerConfig.GetBool("fix_sticky_round", true); webhookUrl = ServerConfig.GetString("report_discord_webhook_url", string.Empty); webhookName = ServerConfig.GetString("report_username", "Player Report"); webhookAvatar = ServerConfig.GetString("report_avatar_url", string.Empty); webhookMessage = ServerConfig.GetString("report_message_content", string.Empty); webhookColour = ServerConfig.GetInt("report_color", 14423100); targetAnnouncement = ServerConfig.GetBool("notify_096_target", true); doorCooldown173 = ServerConfig.GetFloat("scp173_door_cooldown", 25f); #region SmartGuard enableSmartGuard = ServerConfig.GetBool("smart_guard", true); #endregion }
public static void LoadConfig() { Config = Plugin.Config; StartTime = Config.GetInt("AWS_StartTime"); BroadcastTime = Config.GetUInt("AWS_BroadcastTime"); WarheadStart = Config.GetString("AWS_WarheadStart", ""); AutoWarheadStart = Config.GetString("AWS_AutoWarheadStart", ""); WarheadCancel = Config.GetString("AWS_WarheadCancel", ""); RoundStart = Config.GetString("AWS_RoundStart", ""); }
public static void ReloadGameConfigs(bool firstTime = false) { orig_ReloadGameConfigs(firstTime); YamlConfig ServerConfig = GameCore.ConfigFile.ServerConfig; announceChaos = ServerConfig.GetBool("announce_chaos_spawn", true); chaosAnnouncement = ServerConfig.GetString("chaos_announcement", "PITCH_1 ATTENTION ALL PERSONNEL . CHAOS INSURGENCY BREACH IN PROGRESS"); cassieGlitch = ServerConfig.GetBool("cassie_glitch", false); cassieGlitchDetonation = ServerConfig.GetBool("cassie_glitch_post_detonation", false); stickyRound = ServerConfig.GetBool("fix_sticky_round", true); mockCommand = ServerConfig.GetBool("enable_mock_command", true); targetAnnouncement = ServerConfig.GetBool("notify_096_target", true); tutorialTrigger096 = ServerConfig.GetBool("tutorial_triggers_096", false); enable008 = ServerConfig.GetBool("scp_008", true); detonationTimer = ServerConfig.GetInt("warhead_tminus_start_duration", 90); webhookUrl = ServerConfig.GetString("report_discord_webhook_url", string.Empty); webhookName = ServerConfig.GetString("report_username", "Player Report"); reportServerName = ServerConfig.GetString("report_server_name", "My SCP:SL Server"); reportHeader = ServerConfig.GetString("report_header", "Player Report"); reportContent = ServerConfig.GetString("report_content", "Player has just been reported."); webhookAvatar = ServerConfig.GetString("report_avatar_url", string.Empty); webhookMessage = ServerConfig.GetString("report_message_content", string.Empty); webhookColour = ServerConfig.GetInt("report_color", 14423100); doorCooldown173 = ServerConfig.GetFloat("scp173_door_cooldown", 25f); FFDetector.FFDetector.DetectorEnabled = ServerConfig.GetBool("pheggmod_friendly_fire_detector_enabled", true); }
public static MapPoint GetMapPoint(this YamlConfig config, string key, MapPoint def = null) { if (MapPoint.TryParse(config.GetString(key), out var point)) { return(point); } return(def); }
// ReSharper disable once UnusedMember.Global public static void LoadModSystem() { if (_loaded) { return; } ServerConsole.AddLog("Synapse Mod-Loader is now initialising.. :)", ConsoleColor.Blue); try { var startupFile = Assembly.GetExecutingAssembly().Location.Replace($"SCPSL_Data{Path.DirectorySeparatorChar}Managed{Path.DirectorySeparatorChar}Assembly-CSharp.dll", "SynapseStart-config.yml"); if (!File.Exists(startupFile)) { ServerConsole.AddLog($"Synapse Mod-Loader Start file is missing ... creating: {startupFile}", ConsoleColor.Blue); File.Create(startupFile).Close(); File.WriteAllLines(startupFile, new [] { "synapse_installation: default" }); } var config = new YamlConfig(startupFile); var text = config.GetString("synapse_installation", Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Synapse")); if (!Directory.Exists(text)) { Directory.CreateDirectory(text); } if (!File.Exists(Path.Combine(text, "Synapse.dll"))) { ServerConsole.AddLog("Error while loading Synapse! The Synapse.dll is missing!", ConsoleColor.Red); return; } var methodInfo = Assembly.Load(ReadFile(Path.Combine(text, "Synapse.dll"))).GetTypes() .SelectMany(p => p.GetMethods()).FirstOrDefault(f => f.Name == "LoaderExecutionCode"); if (!(methodInfo != null)) { return; } methodInfo.Invoke(null, null); _loaded = true; } catch (Exception e) { ServerConsole.AddLog($"Synapse Mod-Loader startup Error: {e}", ConsoleColor.Red); } }