private static string GetProcessNamePath(string serverId) { string cachePath = ServerPath.GetServersCache(serverId); Directory.CreateDirectory(cachePath); return(Path.Combine(cachePath, "processName")); }
public static string GetSetting(string serverId, string settingName) { string configFile = ServerPath.GetServersConfigs(serverId, "WindowsGSM.cfg"); if (File.Exists(configFile)) { //Read the config lines string[] lines = File.ReadAllLines(configFile); //Read all lines foreach (string line in lines) { string[] keyvalue = line.Split(new char[] { '=' }, 2); if (keyvalue.Length == 2) { if (settingName == keyvalue[0]) { return(keyvalue[1].Substring(1, keyvalue[1].Length - 2)); } } } } return(string.Empty); }
private static string GetWindowsIntPtrPath(string serverId) { string cachePath = ServerPath.GetServersCache(serverId); Directory.CreateDirectory(cachePath); return(Path.Combine(cachePath, "windowsIntPtr")); }
public bool AddToRight(List <string> rItems, string itemName = "") { if (_serverGame == GameServer.DAYZ.FullName) { string modPath = ServerPath.GetConfigs(_serverId, "DayZActivatedMods.cfg"); string text = string.Join("\n", rItems.ToArray()); File.WriteAllText(modPath, text); return(true); } dynamic gameServer = GameServer.Data.Class.Get(_serverGame, null); if (gameServer is GameServer.Engine.Source) { string pluginPath = ServerPath.GetServerFiles(_serverId, gameServer.Game, @"addons\sourcemod\plugins"); string dpluginPath = ServerPath.GetServerFiles(_serverId, gameServer.Game, @"addons\sourcemod\plugins\disabled"); if (Directory.Exists(pluginPath) && Directory.Exists(dpluginPath)) { try { File.Move(Path.Combine(dpluginPath, itemName), Path.Combine(pluginPath, itemName)); return(true); } catch { return(false); } } } return(false); }
public bool CreateWindowsGSMConfig() { CreateServerDirectory(); string configpath = ServerPath.GetServersConfigs(ServerID, "WindowsGSM.cfg"); if (!File.Exists(configpath)) { File.Create(configpath).Dispose(); using (TextWriter textwriter = new StreamWriter(configpath)) { textwriter.WriteLine($"{SettingName.ServerGame}=\"{ServerGame}\""); textwriter.WriteLine($"{SettingName.ServerName}=\"{ServerName}\""); textwriter.WriteLine($"{SettingName.ServerIP}=\"{ServerIP}\""); textwriter.WriteLine($"{SettingName.ServerPort}=\"{ServerPort}\""); textwriter.WriteLine($"{SettingName.ServerQueryPort}=\"{ServerQueryPort}\""); textwriter.WriteLine($"{SettingName.ServerMap}=\"{ServerMap}\""); textwriter.WriteLine($"{SettingName.ServerMaxPlayer}=\"{ServerMaxPlayer}\""); textwriter.WriteLine($"{SettingName.ServerGSLT}=\"{ServerGSLT}\""); textwriter.WriteLine($"{SettingName.ServerParam}=\"{ServerParam}\""); textwriter.WriteLine(string.Empty); textwriter.WriteLine($"{SettingName.CPUPriority}=\"{CPUPriority}\""); textwriter.WriteLine($"{SettingName.CPUAffinity}=\"{CPUAffinity}\""); textwriter.WriteLine(string.Empty); textwriter.WriteLine($"{SettingName.AutoRestart}=\"0\""); textwriter.WriteLine($"{SettingName.AutoStart}=\"0\""); textwriter.WriteLine($"{SettingName.AutoUpdate}=\"0\""); textwriter.WriteLine($"{SettingName.UpdateOnStart}=\"0\""); textwriter.WriteLine($"{SettingName.BackupOnStart}=\"0\""); textwriter.WriteLine(string.Empty); textwriter.WriteLine($"{SettingName.DiscordAlert}=\"0\""); textwriter.WriteLine($"{SettingName.DiscordMessage}=\"{DiscordMessage}\""); textwriter.WriteLine($"{SettingName.DiscordWebhook}=\"{DiscordWebhook}\""); textwriter.WriteLine(string.Empty); textwriter.WriteLine($"{SettingName.RestartCrontab}=\"0\""); textwriter.WriteLine($"{SettingName.CrontabFormat}=\"{CrontabFormat}\""); textwriter.WriteLine(string.Empty); textwriter.WriteLine($"{SettingName.EmbedConsole}=\"{(EmbedConsole ? "1" : "0")}\""); textwriter.WriteLine($"{SettingName.AutoScroll}=\"{(AutoScroll ? "1" : "0")}\""); textwriter.WriteLine(string.Empty); textwriter.WriteLine($"{SettingName.AutoStartAlert}=\"1\""); textwriter.WriteLine($"{SettingName.AutoRestartAlert}=\"1\""); textwriter.WriteLine($"{SettingName.AutoUpdateAlert}=\"1\""); textwriter.WriteLine($"{SettingName.RestartCrontabAlert}=\"1\""); textwriter.WriteLine($"{SettingName.CrashAlert}=\"1\""); } return(true); } return(false); }
public BackupConfig(string serverId) { _serverId = serverId; string configPath = ServerPath.GetServersConfigs(_serverId, "BackupConfig.cfg"); if (!File.Exists(configPath)) { File.WriteAllText(configPath, $"{SettingName.BackupLocation}=\"{Path.Combine(MainWindow.WGSM_PATH, "Backups", serverId)}\"{Environment.NewLine}{SettingName.MaximumBackups}=\"{DefaultMaximumBackups}\""); } LoadConfig(); }
public bool CreateWindowsGSMConfig() { CreateServerDirectory(); string configpath = ServerPath.GetServersConfigs(ServerID, "WindowsGSM.cfg"); if (!File.Exists(configpath)) { File.Create(configpath).Dispose(); using (TextWriter textwriter = new StreamWriter(configpath)) { textwriter.WriteLine($"servergame=\"{ServerGame}\""); textwriter.WriteLine($"servername=\"{ServerName}\""); textwriter.WriteLine($"serverip=\"{ServerIP}\""); textwriter.WriteLine($"serverport=\"{ServerPort}\""); textwriter.WriteLine($"serverqueryport=\"{ServerQueryPort}\""); textwriter.WriteLine($"servermap=\"{ServerMap}\""); textwriter.WriteLine($"servermaxplayer=\"{ServerMaxPlayer}\""); textwriter.WriteLine($"servergslt=\"{ServerGSLT}\""); textwriter.WriteLine($"serverparam=\"{ServerParam}\""); textwriter.WriteLine(""); textwriter.WriteLine("autorestart=\"0\""); textwriter.WriteLine("autostart=\"0\""); textwriter.WriteLine("autoupdate=\"0\""); textwriter.WriteLine("updateonstart=\"0\""); textwriter.WriteLine(""); textwriter.WriteLine("discordalert=\"0\""); textwriter.WriteLine($"discordmessage=\"{DiscordMessage}\""); textwriter.WriteLine($"discordwebhook=\"{DiscordWebhook}\""); textwriter.WriteLine(""); textwriter.WriteLine("restartcrontab=\"0\""); textwriter.WriteLine($"crontabformat=\"{CrontabFormat}\""); textwriter.WriteLine(""); textwriter.WriteLine($"embedconsole=\"{(EmbedConsole ? "1" : "0")}\""); textwriter.WriteLine(""); textwriter.WriteLine("autostartalert=\"1\""); textwriter.WriteLine("autorestartalert=\"1\""); textwriter.WriteLine("autoupdatealert=\"1\""); textwriter.WriteLine("restartcrontabalert=\"1\""); textwriter.WriteLine("crashalert=\"1\""); } return(true); } return(false); }
public List <string> GetLeftListBox() { var list = new List <string>(); if (_serverGame == GameServer.DAYZ.FullName) { string modPath = ServerPath.GetConfigs(_serverId, "DayZActivatedMods.cfg"); string activatedMods = File.Exists(modPath) ? File.ReadAllText(modPath) : ""; string[] folders = Directory.GetDirectories(ServerPath.GetServerFiles(_serverId), "@*", SearchOption.TopDirectoryOnly); foreach (string folder in folders) { string metaFile = Path.Combine(folder, "meta.cpp"); if (!File.Exists(metaFile)) { continue; } string folderName = Path.GetFileName(folder); if (activatedMods.Contains(folderName)) { continue; } list.Add(folderName); } } dynamic gameServer = GameServer.Data.Class.Get(_serverGame, null); if (gameServer is GameServer.Engine.Source) { string dpluginPath = ServerPath.GetServerFiles(_serverId, gameServer.Game, @"addons\sourcemod\plugins\disabled"); if (Directory.Exists(dpluginPath)) { string[] smxFiles = Directory.GetFiles(dpluginPath, "*.smx", SearchOption.TopDirectoryOnly); foreach (string smxFile in smxFiles) { list.Add(Path.GetFileName(smxFile)); } } return(list); } return(list); }
public static bool ToggleSetting(string serverId, string settingName) { string configFile = ServerPath.GetServersConfigs(serverId, "WindowsGSM.cfg"); if (File.Exists(configFile)) { bool?returnBool = null; //Read the config lines string[] lines = File.ReadAllLines(configFile); //Overwrite the config file File.Create(configFile).Dispose(); //Create the TextWriter using (TextWriter textwriter = new StreamWriter(configFile)) { //Write all lines foreach (string line in lines) { string[] keyvalue = line.Split(new char[] { '=' }, 2); if (keyvalue.Length == 2 && settingName == keyvalue[0]) { keyvalue[1] = keyvalue[1].Trim('\"'); returnBool = (keyvalue[1] == "1") ? false : true; string nextBool = (keyvalue[1] == "1") ? "0" : "1"; textwriter.WriteLine($"{keyvalue[0]}=\"{nextBool}\""); } else { textwriter.WriteLine(line); } } if (returnBool == null) { returnBool = true; textwriter.WriteLine($"{settingName}=\"1\""); } } return(returnBool ?? true); } return(false); }
public List <string> GetRightListBox() { var list = new List <string>(); if (_serverGame == GameServer.DAYZ.FullName) { string modPath = ServerPath.GetConfigs(_serverId, "DayZActivatedMods.cfg"); if (File.Exists(modPath)) { foreach (string folderName in File.ReadLines(modPath)) { string metaPath = ServerPath.GetServerFiles(_serverId, folderName.Trim()); if (Directory.Exists(metaPath)) { if (File.Exists(Path.Combine(metaPath, "meta.cpp"))) { list.Add(folderName.Trim()); } } } } return(list); } dynamic gameServer = GameServer.Data.Class.Get(_serverGame, null); if (gameServer is GameServer.Engine.Source) { string pluginPath = ServerPath.GetServerFiles(_serverId, gameServer.Game, @"addons\sourcemod\plugins"); if (Directory.Exists(pluginPath)) { string[] smxFiles = Directory.GetFiles(pluginPath, "*.smx", SearchOption.TopDirectoryOnly); foreach (string smxFile in smxFiles) { list.Add(Path.GetFileName(smxFile)); } } return(list); } return(list); }
public bool DeleteServerDirectory() { string serverid_dir = ServerPath.GetServers(ServerID); if (Directory.Exists(serverid_dir) && ServerID != null && ServerID != string.Empty) { try { Directory.Delete(serverid_dir, true); return(true); } catch { return(false); } } return(false); }
private void LoadConfig() { string configPath = ServerPath.GetServersConfigs(_serverId, "BackupConfig.cfg"); foreach (string line in File.ReadLines(configPath)) { string[] keyvalue = line.Split(new[] { '=' }, 2); if (keyvalue.Length == 2) { keyvalue[1] = keyvalue[1].Trim('\"'); switch (keyvalue[0]) { case SettingName.BackupLocation: BackupLocation = keyvalue[1]; break; case SettingName.MaximumBackups: MaximumBackups = int.TryParse(keyvalue[1], out int max) ? ((max <= 0) ? 1 : max) : DefaultMaximumBackups; break; } } } }
public async Task <List <PluginMetadata> > LoadPlugins(bool shouldAwait = true) { var plugins = new List <PluginMetadata>(); foreach (var pluginFolder in Directory.GetDirectories(ServerPath.GetPlugins(), "*.cs", SearchOption.TopDirectoryOnly).ToList()) { var pluginFile = Path.Combine(pluginFolder, Path.GetFileName(pluginFolder)); if (File.Exists(pluginFile)) { var plugin = await LoadPlugin(pluginFile, shouldAwait); if (plugin != null) { plugins.Add(plugin); } } } return(plugins); }
public static void SetSetting(string serverId, string settingName, string data) { string configFile = ServerPath.GetServersConfigs(serverId, "WindowsGSM.cfg"); if (File.Exists(configFile)) { bool saved = false; //Read the config lines string[] lines = File.ReadAllLines(configFile); //Overwrite the config file File.Create(configFile).Dispose(); //Create the TextWriter using (TextWriter textwriter = new StreamWriter(configFile)) { //Write lines foreach (string line in lines) { string[] keyvalue = line.Split(new[] { '=' }, 2); if (keyvalue.Length == 2 && settingName == keyvalue[0]) { textwriter.WriteLine($"{settingName}=\"{data}\""); saved = true; } else { textwriter.WriteLine(line); } } if (!saved) { textwriter.WriteLine($"{settingName}=\"{data}\""); } } } }
public ServerConfig(string serverid) { //Get next available ServerID if (string.IsNullOrEmpty(serverid)) { for (int id = 1; id <= MainWindow.MAX_SERVER; id++) { string serverid_dir = MainWindow.WGSM_PATH + @"\servers\" + id; if (Directory.Exists(serverid_dir)) { string config = MainWindow.WGSM_PATH + @"\servers\" + id + @"\configs\WindowsGSM.cfg"; if (!File.Exists(config)) { ServerID = id.ToString(); break; } } else { ServerID = id.ToString(); break; } } return; } ServerID = serverid; //Get values from configpath string configpath = ServerPath.GetServersConfigs(serverid, "WindowsGSM.cfg"); if (File.Exists(configpath)) { foreach (string line in File.ReadLines(configpath)) { string[] keyvalue = line.Split(new[] { '=' }, 2); if (keyvalue.Length == 2) { keyvalue[1] = keyvalue[1].Substring(1, keyvalue[1].Length - 2); switch (keyvalue[0]) { case SettingName.ServerGame: ServerGame = keyvalue[1]; break; case SettingName.ServerName: ServerName = keyvalue[1]; break; case SettingName.ServerIP: ServerIP = keyvalue[1]; break; case SettingName.ServerPort: ServerPort = keyvalue[1]; break; case SettingName.ServerQueryPort: ServerQueryPort = keyvalue[1]; break; case SettingName.ServerMap: ServerMap = keyvalue[1]; break; case SettingName.ServerMaxPlayer: ServerMaxPlayer = keyvalue[1]; break; case SettingName.ServerGSLT: ServerGSLT = keyvalue[1]; break; case SettingName.ServerParam: ServerParam = keyvalue[1]; break; case SettingName.AutoRestart: AutoRestart = keyvalue[1] == "1"; break; case SettingName.AutoStart: AutoStart = keyvalue[1] == "1"; break; case SettingName.AutoUpdate: AutoUpdate = keyvalue[1] == "1"; break; case SettingName.UpdateOnStart: UpdateOnStart = keyvalue[1] == "1"; break; case SettingName.BackupOnStart: BackupOnStart = keyvalue[1] == "1"; break; case SettingName.DiscordAlert: DiscordAlert = keyvalue[1] == "1"; break; case SettingName.DiscordMessage: DiscordMessage = keyvalue[1]; break; case SettingName.DiscordWebhook: DiscordWebhook = keyvalue[1]; break; case SettingName.RestartCrontab: RestartCrontab = keyvalue[1] == "1"; break; case SettingName.CrontabFormat: CrontabFormat = keyvalue[1]; break; case SettingName.EmbedConsole: EmbedConsole = keyvalue[1] == "1"; break; case SettingName.AutoStartAlert: AutoStartAlert = keyvalue[1] == "1"; break; case SettingName.AutoRestartAlert: AutoRestartAlert = keyvalue[1] == "1"; break; case SettingName.AutoUpdateAlert: AutoUpdateAlert = keyvalue[1] == "1"; break; case SettingName.RestartCrontabAlert: RestartCrontabAlert = keyvalue[1] == "1"; break; case SettingName.CrashAlert: CrashAlert = keyvalue[1] == "1"; break; case SettingName.CPUPriority: CPUPriority = keyvalue[1]; break; case SettingName.CPUAffinity: CPUAffinity = keyvalue[1]; break; } } } } }
public bool CreateWindowsGSMConfig(string servergame, string servername, string serverip, string serverport, string servermap, string servermaxplayer, string servergslt, string serverparam, bool toggleConsole) { CreateServerDirectory(); string configpath = ServerPath.GetConfigs(ServerID, "WindowsGSM.cfg"); if (!File.Exists(configpath)) { ServerGame = servergame; ServerName = servername; ServerIP = serverip; ServerPort = serverport; ServerMap = servermap; ServerMaxPlayer = servermaxplayer; ServerGSLT = servergslt; ServerParam = serverparam; AutoRestart = false; AutoStart = false; AutoUpdate = false; UpdateOnStart = false; DiscordAlert = false; DiscordMessage = ""; DiscordWebhook = ""; RestartCrontab = false; CrontabFormat = "0 6 * * *"; EmbedConsole = !toggleConsole; AutoStartAlert = true; AutoRestartAlert = true; AutoUpdateAlert = true; RestartCrontabAlert = true; CrashAlert = true; File.Create(configpath).Dispose(); using (TextWriter textwriter = new StreamWriter(configpath)) { textwriter.WriteLine($"servergame=\"{ServerGame}\""); textwriter.WriteLine($"servername=\"{ServerName}\""); textwriter.WriteLine($"serverip=\"{ServerIP}\""); textwriter.WriteLine($"serverport=\"{ServerPort}\""); textwriter.WriteLine($"servermap=\"{ServerMap}\""); textwriter.WriteLine($"servermaxplayer=\"{ServerMaxPlayer}\""); textwriter.WriteLine($"servergslt=\"{ServerGSLT}\""); textwriter.WriteLine($"serverparam=\"{ServerParam}\""); textwriter.WriteLine(""); textwriter.WriteLine("autorestart=\"0\""); textwriter.WriteLine("autostart=\"0\""); textwriter.WriteLine("autoupdate=\"0\""); textwriter.WriteLine("updateonstart=\"0\""); textwriter.WriteLine(""); textwriter.WriteLine("discordalert=\"0\""); textwriter.WriteLine($"discordmessage=\"{DiscordMessage}\""); textwriter.WriteLine($"discordwebhook=\"{DiscordWebhook}\""); textwriter.WriteLine(""); textwriter.WriteLine("restartcrontab=\"0\""); textwriter.WriteLine($"crontabformat=\"{CrontabFormat}\""); textwriter.WriteLine(""); textwriter.WriteLine($"embedconsole=\"{(EmbedConsole ? "1" : "0")}\""); textwriter.WriteLine(""); textwriter.WriteLine("autostartalert=\"1\""); textwriter.WriteLine("autorestartalert=\"1\""); textwriter.WriteLine("autoupdatealert=\"1\""); textwriter.WriteLine("restartcrontabalert=\"1\""); textwriter.WriteLine("crashalert=\"1\""); } return(true); } return(false); }
public void Open() { Process.Start(ServerPath.GetServersConfigs(_serverId, "BackupConfig.cfg")); }
public void CreateServerDirectory() { Directory.CreateDirectory(ServerPath.GetServers(ServerID)); Directory.CreateDirectory(ServerPath.GetServersConfigs(ServerID)); Directory.CreateDirectory(ServerPath.GetServersServerFiles(ServerID)); }
public PluginManagement() { Directory.CreateDirectory(ServerPath.GetPlugins()); }
public ServerConfig(string serverid) { //Get next available ServerID if (serverid == null || serverid == "") { for (int id = 1; id <= MainWindow.MAX_SERVER; id++) { string serverid_dir = MainWindow.WGSM_PATH + @"\servers\" + id.ToString(); if (Directory.Exists(serverid_dir)) { string config = MainWindow.WGSM_PATH + @"\servers\" + id.ToString() + @"\configs\WindowsGSM.cfg"; if (!File.Exists(config)) { ServerID = id.ToString(); break; } } else { ServerID = id.ToString(); break; } } return; } ServerID = serverid; //Get values from configpath string configpath = ServerPath.GetServersConfigs(serverid, "WindowsGSM.cfg"); if (File.Exists(configpath)) { foreach (string line in File.ReadLines(configpath)) { string[] keyvalue = line.Split(new char[] { '=' }, 2); if (keyvalue.Length == 2) { keyvalue[1] = keyvalue[1].Trim('\"'); switch (keyvalue[0]) { case "servergame": ServerGame = keyvalue[1]; break; case "servername": ServerName = keyvalue[1]; break; case "serverip": ServerIP = keyvalue[1]; break; case "serverport": ServerPort = keyvalue[1]; break; case "serverqueryport": ServerQueryPort = keyvalue[1]; break; case "servermap": ServerMap = keyvalue[1]; break; case "servermaxplayer": ServerMaxPlayer = keyvalue[1]; break; case "servergslt": ServerGSLT = keyvalue[1]; break; case "serverparam": ServerParam = keyvalue[1]; break; case "autorestart": AutoRestart = (keyvalue[1] == "1") ? true : false; break; case "autostart": AutoStart = (keyvalue[1] == "1") ? true : false; break; case "autoupdate": AutoUpdate = (keyvalue[1] == "1") ? true : false; break; case "updateonstart": UpdateOnStart = (keyvalue[1] == "1") ? true : false; break; case "discordalert": DiscordAlert = (keyvalue[1] == "1") ? true : false; break; case "discordmessage": DiscordMessage = keyvalue[1]; break; case "discordwebhook": DiscordWebhook = keyvalue[1]; break; case "restartcrontab": RestartCrontab = (keyvalue[1] == "1") ? true : false; break; case "crontabformat": CrontabFormat = keyvalue[1]; break; case "embedconsole": EmbedConsole = (keyvalue[1] == "1") ? true : false; break; case "autostartalert": AutoStartAlert = (keyvalue[1] == "1") ? true : false; break; case "autorestartalert": AutoRestartAlert = (keyvalue[1] == "1") ? true : false; break; case "autoupdatealert": AutoUpdateAlert = (keyvalue[1] == "1") ? true : false; break; case "restartcrontabalert": RestartCrontabAlert = (keyvalue[1] == "1") ? true : false; break; case "crashalert": CrashAlert = (keyvalue[1] == "1") ? true : false; break; } } } } }
public async Task <PluginMetadata> LoadPlugin(string path, bool shouldAwait = true) { var pluginMetadata = new PluginMetadata { FileName = Path.GetFileName(path) }; var options = new CompilerParameters(); options.ReferencedAssemblies.Add(Assembly.GetEntryAssembly().Location); options.ReferencedAssemblies.Add("System.dll"); options.ReferencedAssemblies.Add("System.Core.dll"); options.ReferencedAssemblies.Add("System.Data.dll"); options.ReferencedAssemblies.Add(ServerPath.GetBin("Newtonsoft.Json.dll")); options.GenerateInMemory = true; var c = new Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider(); var cr = shouldAwait ? await Task.Run(() => c.CompileAssemblyFromSource(options, File.ReadAllText(path))) : c.CompileAssemblyFromSource(options, File.ReadAllText(path)); if (cr.Errors.HasErrors) { var sb = new StringBuilder(); foreach (CompilerError err in cr.Errors) { sb.Append($"{err.ErrorText}\nLine: {err.Line} - Column: {err.Column}\n\n"); } pluginMetadata.Error = sb.ToString(); Console.WriteLine(pluginMetadata.Error); return(pluginMetadata); } try { pluginMetadata.Type = shouldAwait ? await Task.Run(() => cr.CompiledAssembly.GetType($"WindowsGSM.Plugins.{Path.GetFileNameWithoutExtension(path)}")) : cr.CompiledAssembly.GetType($"WindowsGSM.Plugins.{Path.GetFileNameWithoutExtension(path)}"); var plugin = GetPluginClass(pluginMetadata); pluginMetadata.FullName = $"{plugin.FullName} [{pluginMetadata.FileName}]"; pluginMetadata.Plugin = plugin.Plugin; try { string gameImage = ServerPath.GetPlugins(pluginMetadata.FileName, $"{Path.GetFileNameWithoutExtension(pluginMetadata.FileName)}.png"); ImageSource image = new BitmapImage(new Uri(gameImage)); pluginMetadata.GameImage = gameImage; } catch { pluginMetadata.GameImage = DefaultPluginImage; } try { string authorImage = ServerPath.GetPlugins(pluginMetadata.FileName, "author.png"); ImageSource image = new BitmapImage(new Uri(authorImage)); pluginMetadata.AuthorImage = authorImage; } catch { pluginMetadata.AuthorImage = DefaultUserImage; } pluginMetadata.IsLoaded = true; } catch (Exception e) { pluginMetadata.Error = e.Message; Console.WriteLine(pluginMetadata.Error); pluginMetadata.IsLoaded = false; } return(pluginMetadata); }
public bool IsWindowsGSMConfigExist() { string configpath = ServerPath.GetServersConfigs(ServerID, "WindowsGSM.cfg"); return(File.Exists(configpath)); }