diff --git a/Admin/Application.csproj b/Admin/Application.csproj index 599b29c85..ece9d59fb 100644 --- a/Admin/Application.csproj +++ b/Admin/Application.csproj @@ -122,7 +122,6 @@ - @@ -135,6 +134,7 @@ Settings.settings + @@ -333,8 +333,8 @@ copy /Y "$(ProjectDir)lib\Kayak.dll" "$(SolutionDir)BUILD\lib" xcopy /Y /I /E "$(ProjectDir)webfront\*" "$(SolutionDir)BUILD\Webfront" -if $(ConfigurationName) == Release powershell.exe -file "$(SolutionDir)DEPLOY\publish_nightly.ps1" 1.3 -if $(ConfigurationName) == Release-Stable powershell.exe -file "$(SolutionDir)DEPLOY\publish_stable.ps1" 1.3 +if $(ConfigurationName) == Release powershell.exe -file "$(SolutionDir)DEPLOY\publish_nightly.ps1" 1.4 +if $(ConfigurationName) == Release-Stable powershell.exe -file "$(SolutionDir)DEPLOY\publish_stable.ps1" 1.4 diff --git a/Admin/Kayak.cs b/Admin/Kayak.cs index 82d7cedac..1a62ccbc8 100644 --- a/Admin/Kayak.cs +++ b/Admin/Kayak.cs @@ -18,20 +18,20 @@ namespace IW4MAdmin if (e.GetType() == typeof(NullReferenceException)) return; - Manager.GetInstance().Logger.WriteWarning("Web service has encountered an error - " + e.Message); - Manager.GetInstance().Logger.WriteDebug($"Stack Trace: {e.StackTrace}"); + ApplicationManager.GetInstance().Logger.WriteWarning("Web service has encountered an error - " + e.Message); + ApplicationManager.GetInstance().Logger.WriteDebug($"Stack Trace: {e.StackTrace}"); if (e.InnerException != null) { - Manager.GetInstance().Logger.WriteDebug($"Inner Exception: {e.InnerException.Message}"); - Manager.GetInstance().Logger.WriteDebug($"Inner Stack Trace: {e.InnerException.StackTrace}"); + ApplicationManager.GetInstance().Logger.WriteDebug($"Inner Exception: {e.InnerException.Message}"); + ApplicationManager.GetInstance().Logger.WriteDebug($"Inner Stack Trace: {e.InnerException.StackTrace}"); } } public void OnStop(IScheduler scheduler) { - Manager.GetInstance().Logger.WriteInfo("Web service has been stopped..."); + ApplicationManager.GetInstance().Logger.WriteInfo("Web service has been stopped..."); } } diff --git a/Admin/Main.cs b/Admin/Main.cs index 379dbcca9..b0d0b61f3 100644 --- a/Admin/Main.cs +++ b/Admin/Main.cs @@ -11,7 +11,7 @@ namespace IW4MAdmin class Program { static public double Version { get; private set; } - static private Manager ServerManager; + static private ApplicationManager ServerManager; static void Main(string[] args) { @@ -33,7 +33,7 @@ namespace IW4MAdmin { CheckDirectories(); - ServerManager = Manager.GetInstance(); + ServerManager = ApplicationManager.GetInstance(); ServerManager.Init(); Task.Run(() => diff --git a/Admin/Manager.cs b/Admin/Manager.cs index f74847ad7..219279dc0 100644 --- a/Admin/Manager.cs +++ b/Admin/Manager.cs @@ -2,39 +2,45 @@ using System.Collections.Generic; using System.Linq; using System.Threading; -using SharedLibrary; using System.IO; using System.Threading.Tasks; +using SharedLibrary; +using SharedLibrary.Interfaces; +using SharedLibrary.Commands; +using SharedLibrary.Helpers; +using SharedLibrary.Exceptions; + namespace IW4MAdmin { - class Manager : SharedLibrary.Interfaces.IManager + class ApplicationManager : IManager { - static Manager Instance; public List Servers { get; private set; } - List TaskStatuses; + public ILogger Logger { get; private set; } + public bool Running { get; private set; } + + static ApplicationManager Instance; + List TaskStatuses; Database ClientDatabase; Database AliasesDatabase; - SharedLibrary.Interfaces.IPenaltyList ClientPenalties; + IPenaltyList ClientPenalties; List Commands; - List MessageTokens; + List MessageTokens; Kayak.IScheduler webServiceTask; Thread WebThread; - public SharedLibrary.Interfaces.ILogger Logger { get; private set; } - public bool Running { get; private set; } #if FTP_LOG const int UPDATE_FREQUENCY = 15000; #else const int UPDATE_FREQUENCY = 300; #endif - private Manager() + private ApplicationManager() { Logger = new Logger("Logs/IW4MAdmin.log"); Servers = new List(); Commands = new List(); - TaskStatuses = new List(); - MessageTokens = new List(); + TaskStatuses = new List(); + MessageTokens = new List(); ClientDatabase = new ClientsDB("Database/clients.rm"); AliasesDatabase = new AliasesDB("Database/aliases.rm"); @@ -51,14 +57,51 @@ namespace IW4MAdmin return Commands; } - public static Manager GetInstance() + public static ApplicationManager GetInstance() { - return Instance ?? (Instance = new Manager()); + return Instance ?? (Instance = new ApplicationManager()); } public void Init() { - SharedLibrary.WebService.Init(); + #region CONFIG + var Configs = Directory.EnumerateFiles("config/servers").Where(x => x.Contains(".cfg")); + + if (Configs.Count() == 0) + ServerConfigurationGenerator.Generate(); + + foreach (var file in Configs) + { + var Conf = ServerConfiguration.Read(file); + var ServerInstance = new IW4MServer(this, Conf); + + Task.Run(async () => + { + try + { + await ServerInstance.Initialize(); + Servers.Add(ServerInstance); + + // this way we can keep track of execution time and see if problems arise. + var Status = new AsyncStatus(ServerInstance, UPDATE_FREQUENCY); + TaskStatuses.Add(Status); + + Logger.WriteVerbose($"Now monitoring {ServerInstance.Hostname}"); + } + + catch (ServerException e) + { + Logger.WriteWarning($"Not monitoring server {Conf.IP}:{Conf.Port} due to uncorrectable errors"); + if (e.GetType() == typeof(DvarException)) + Logger.WriteError($"Could not get the dvar value for {(e as DvarException).Data["dvar_name"]} (ensure the server has a map loaded)"); + else if (e.GetType() == typeof(NetworkException)) + Logger.WriteError("Could not communicate with the server (ensure the configuration is correct)"); + } + }); + } + #endregion + + #region PLUGINS SharedLibrary.Plugins.PluginImporter.Load(this); foreach (var Plugin in SharedLibrary.Plugins.PluginImporter.ActivePlugins) @@ -75,43 +118,49 @@ namespace IW4MAdmin Logger.WriteDebug($"Stack Trace: {e.StackTrace}"); } } + #endregion - var Configs = Directory.EnumerateFiles("config/servers").Where(x => x.Contains(".cfg")); + #region COMMANDS + if ((ClientDatabase as ClientsDB).GetOwner() != null) + Commands.Add(new COwner("owner", "claim ownership of the server", "owner", Player.Permission.User, 0, false)); - if (Configs.Count() == 0) - ServerConfig.Generate(); + Commands.Add(new CQuit("quit", "quit IW4MAdmin", "q", Player.Permission.Owner, 0, false)); + Commands.Add(new CKick("kick", "kick a player by name. syntax: !kick .", "k", Player.Permission.Trusted, 2, true)); + Commands.Add(new CSay("say", "broadcast message to all players. syntax: !say .", "s", Player.Permission.Moderator, 1, false)); + Commands.Add(new CTempBan("tempban", "temporarily ban a player for 1 hour. syntax: !tempban .", "tb", Player.Permission.Moderator, 2, true)); + Commands.Add(new CBan("ban", "permanently ban a player from the server. syntax: !ban ", "b", Player.Permission.SeniorAdmin, 2, true)); + Commands.Add(new CWhoAmI("whoami", "give information about yourself. syntax: !whoami.", "who", Player.Permission.User, 0, false)); + Commands.Add(new CList("list", "list active clients syntax: !list.", "l", Player.Permission.Moderator, 0, false)); + Commands.Add(new CHelp("help", "list all available commands. syntax: !help.", "h", Player.Permission.User, 0, false)); + Commands.Add(new CFastRestart("fastrestart", "fast restart current map. syntax: !fastrestart.", "fr", Player.Permission.Moderator, 0, false)); + Commands.Add(new CMapRotate("maprotate", "cycle to the next map in rotation. syntax: !maprotate.", "mr", Player.Permission.Administrator, 0, false)); + Commands.Add(new CSetLevel("setlevel", "set player to specified administration level. syntax: !setlevel .", "sl", Player.Permission.Owner, 2, true)); + Commands.Add(new CUsage("usage", "get current application memory usage. syntax: !usage.", "us", Player.Permission.Moderator, 0, false)); + Commands.Add(new CUptime("uptime", "get current application running time. syntax: !uptime.", "up", Player.Permission.Moderator, 0, false)); + Commands.Add(new CWarn("warn", "warn player for infringing rules syntax: !warn .", "w", Player.Permission.Trusted, 2, true)); + Commands.Add(new CWarnClear("warnclear", "remove all warning for a player syntax: !warnclear .", "wc", Player.Permission.Trusted, 1, true)); + Commands.Add(new CUnban("unban", "unban player by database id. syntax: !unban @.", "ub", Player.Permission.SeniorAdmin, 1, true)); + Commands.Add(new CListAdmins("admins", "list currently connected admins. syntax: !admins.", "a", Player.Permission.User, 0, false)); + Commands.Add(new CLoadMap("map", "change to specified map. syntax: !map", "m", Player.Permission.Administrator, 1, false)); + Commands.Add(new CFindPlayer("find", "find player in database. syntax: !find ", "f", Player.Permission.SeniorAdmin, 1, false)); + Commands.Add(new CListRules("rules", "list server rules. syntax: !rules", "r", Player.Permission.User, 0, false)); + Commands.Add(new CPrivateMessage("privatemessage", "send message to other player. syntax: !pm ", "pm", Player.Permission.User, 2, true)); + Commands.Add(new CFlag("flag", "flag a suspicious player and announce to admins on join . syntax !flag :", "flag", Player.Permission.Moderator, 2, true)); + Commands.Add(new CReport("report", "report a player for suspicious behaivor. syntax !report ", "rep", Player.Permission.User, 2, true)); + Commands.Add(new CListReports("reports", "get most recent reports. syntax !reports", "reports", Player.Permission.Moderator, 0, false)); + Commands.Add(new CMask("mask", "hide your online presence from online admin list. syntax: !mask", "mask", Player.Permission.Administrator, 0, false)); + Commands.Add(new CListBanInfo("baninfo", "get information about a ban for a player. syntax: !baninfo ", "bi", Player.Permission.Moderator, 1, true)); + Commands.Add(new CListAlias("alias", "get past aliases and ips of a player. syntax: !alias ", "known", Player.Permission.Moderator, 1, true)); + Commands.Add(new CExecuteRCON("rcon", "send rcon command to server. syntax: !rcon ", "rcon", Player.Permission.Owner, 1, false)); + Commands.Add(new CFindAllPlayers("findall", "find a player by their aliase(s). syntax: !findall ", "fa", Player.Permission.Moderator, 1, false)); + Commands.Add(new CPlugins("plugins", "view all loaded plugins. syntax: !plugins", "p", Player.Permission.Administrator, 0, false)); - foreach (var file in Configs) - { - var Conf = ServerConfig.Read(file); - var ServerInstance = new IW4MServer(this, Conf.IP, Conf.Port, Conf.Password); - - Task.Run(async () => - { - try - { - await ServerInstance.Initialize(); - Servers.Add(ServerInstance); - - // this way we can keep track of execution time and see if problems arise. - var Status = new SharedLibrary.Helpers.AsyncStatus(ServerInstance, UPDATE_FREQUENCY); - TaskStatuses.Add(Status); - - Logger.WriteVerbose($"Now monitoring {ServerInstance.Hostname}"); - } - - catch (SharedLibrary.Exceptions.ServerException e) - { - Logger.WriteWarning($"Not monitoring server {Conf.IP}:{Conf.Port} due to uncorrectable errors"); - if (e.GetType() == typeof(SharedLibrary.Exceptions.DvarException)) - Logger.WriteError($"Could not get the dvar value for {(e as SharedLibrary.Exceptions.DvarException).Data["dvar_name"]} (ensure the server has a map loaded)"); - else if (e.GetType() == typeof(SharedLibrary.Exceptions.NetworkException)) - Logger.WriteError("Could not communicate with the server (ensure the configuration is correct)"); - } - }); - - } + foreach (Command C in SharedLibrary.Plugins.PluginImporter.ActiveCommands) + Commands.Add(C); + #endregion + #region WEBSERVICE + SharedLibrary.WebService.Init(); webServiceTask = WebService.GetScheduler(); WebThread = new Thread(webServiceTask.Start) @@ -120,6 +169,7 @@ namespace IW4MAdmin }; WebThread.Start(); + #endregion Running = true; } @@ -165,17 +215,17 @@ namespace IW4MAdmin return AliasesDatabase as AliasesDB; } - public SharedLibrary.Interfaces.IPenaltyList GetClientPenalties() + public IPenaltyList GetClientPenalties() { return ClientPenalties; } - public SharedLibrary.Interfaces.ILogger GetLogger() + public ILogger GetLogger() { return Logger; } - public IList GetMessageTokens() + public IList GetMessageTokens() { return MessageTokens; } diff --git a/Admin/PenaltyList.cs b/Admin/PenaltyList.cs index d6c969132..e40ad159a 100644 --- a/Admin/PenaltyList.cs +++ b/Admin/PenaltyList.cs @@ -15,22 +15,22 @@ namespace IW4MAdmin public void AddPenalty(Penalty P) { - Manager.GetInstance().GetClientDatabase().AddBan(P); + ApplicationManager.GetInstance().GetClientDatabase().AddBan(P); } public void RemovePenalty(Penalty P) { - Manager.GetInstance().GetClientDatabase().RemoveBan(P.OffenderID); + ApplicationManager.GetInstance().GetClientDatabase().RemoveBan(P.OffenderID); } public List FindPenalties(Player P) { - return Manager.GetInstance().GetClientDatabase().GetClientPenalties(P); + return ApplicationManager.GetInstance().GetClientDatabase().GetClientPenalties(P); } public List AsChronoList(int offset, int count) { - return Manager.GetInstance().GetClientDatabase().GetPenaltiesChronologically(offset, count); + return ApplicationManager.GetInstance().GetClientDatabase().GetPenaltiesChronologically(offset, count); } } } diff --git a/Admin/Properties/AssemblyInfo.cs b/Admin/Properties/AssemblyInfo.cs index da5918ddf..9f74d3fed 100644 --- a/Admin/Properties/AssemblyInfo.cs +++ b/Admin/Properties/AssemblyInfo.cs @@ -6,11 +6,11 @@ using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("IW4M Admin")] -[assembly: AssemblyDescription("Server administration for your IW4X Servers")] +[assembly: AssemblyTitle("IW4MAdmin Application")] +[assembly: AssemblyDescription("Server administration for IW4X Servers")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ForeverNone LLC")] -[assembly: AssemblyProduct("")] +[assembly: AssemblyProduct("IW4MAdmin")] [assembly: AssemblyCopyright("2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -33,5 +33,5 @@ using System.Resources; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.*")] +[assembly: AssemblyVersion("1.4.*")] [assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/Admin/Server.cs b/Admin/Server.cs index 65a484e57..3ac34efc3 100644 --- a/Admin/Server.cs +++ b/Admin/Server.cs @@ -3,18 +3,17 @@ using System.Collections.Generic; using System.Threading; using System.IO; using System.Linq; +using System.Threading.Tasks; + using SharedLibrary; using SharedLibrary.Network; -using System.Threading.Tasks; +using SharedLibrary.Interfaces; namespace IW4MAdmin { public class IW4MServer : Server { - public IW4MServer(SharedLibrary.Interfaces.IManager mgr, string address, int port, string password) : base(mgr, address, port, password) - { - InitializeCommands(); - } + public IW4MServer(IManager mgr, ServerConfiguration cfg) : base(mgr, cfg) { } private void GetAliases(List returnAliases, Aliases currentAlias) { @@ -76,7 +75,6 @@ namespace IW4MAdmin Manager.GetAliasesDatabase().AddPlayerAliases(new Aliases(NewPlayer.DatabaseID, NewPlayer.Name, NewPlayer.IP)); } - List Admins = Manager.GetClientDatabase().GetAdmins(); if (Admins.Find(x => x.Name == P.Name) != null) { @@ -108,9 +106,7 @@ namespace IW4MAdmin // and ips if (NewPlayer.Alias.IPS.Find(i => i.Equals(P.IP)) == null || P.IP == null || P.IP == String.Empty) - { NewPlayer.Alias.IPS.Add(P.IP); - } NewPlayer.SetIP(P.IP); @@ -127,7 +123,7 @@ namespace IW4MAdmin return true; } - List newPlayerAliases = GetPlayerAliases(NewPlayer); + var newPlayerAliases = GetPlayerAliases(NewPlayer); foreach (Player aP in newPlayerAliases) // lets check their aliases { @@ -209,21 +205,7 @@ namespace IW4MAdmin return null; } - else - { - Player P = null; - try - { - P = Players[pID]; - return P; - } - catch (Exception) - { - Logger.WriteError("Client index is invalid - " + pID); - Logger.WriteDebug(L.ToString()); - return null; - } - } + return Players[pID]; } //Check ban list for every banned player and return ban if match is found @@ -272,7 +254,6 @@ namespace IW4MAdmin int cNum = -1; int.TryParse(Args[0], out cNum); - if (Args[0] == String.Empty) return C; @@ -296,9 +277,10 @@ namespace IW4MAdmin E.Target = Players[cNum]; } - E.Target = GetClientByName(E.Data.Trim()); + if (E.Target == null) // Find active player including quotes (multiple words) + E.Target = GetClientByName(E.Data.Trim()); - if (E.Target == null) + if (E.Target == null) // Find active player as single word E.Target = GetClientByName(Args[0]); if (E.Target == null && C.RequiresTarget) @@ -312,17 +294,13 @@ namespace IW4MAdmin public override async Task ExecuteEvent(Event E) { - await ProcessEvent(E); + await ProcessEvent(E); - foreach (SharedLibrary.Interfaces.IPlugin P in SharedLibrary.Plugins.PluginImporter.ActivePlugins) + foreach (IPlugin P in SharedLibrary.Plugins.PluginImporter.ActivePlugins) { try { -#if DEBUG await P.OnEventAsync(E, this); -#else - P.OnEventAsync(E, this); -#endif } catch (Exception Except) @@ -381,19 +359,13 @@ namespace IW4MAdmin Logger.WriteError($"{e.Message} {IP}:{Port}, reducing polling rate"); } - lastMessage = DateTime.Now - start; + LastMessage = DateTime.Now - start; lastCount = DateTime.Now; if ((DateTime.Now - tickTime).TotalMilliseconds >= 1000) { - // We don't want to await here, just in case user plugins are really slow :c foreach (var Plugin in SharedLibrary.Plugins.PluginImporter.ActivePlugins) -#if !DEBUG - Plugin.OnTickAsync(this); -#else await Plugin.OnTickAsync(this); -#endif - tickTime = DateTime.Now; } @@ -405,24 +377,24 @@ namespace IW4MAdmin playerCountStart = DateTime.Now; } - if (lastMessage.TotalSeconds > messageTime && messages.Count > 0 && Players.Count > 0) + if (LastMessage.TotalSeconds > MessageTime && BroadcastMessages.Count > 0 && Players.Count > 0) { - await Broadcast(Utilities.ProcessMessageToken(Manager.GetMessageTokens(), messages[nextMessage])); - if (nextMessage == (messages.Count - 1)) - nextMessage = 0; + await Broadcast(Utilities.ProcessMessageToken(Manager.GetMessageTokens(), BroadcastMessages[NextMessage])); + if (NextMessage == (BroadcastMessages.Count - 1)) + NextMessage = 0; else - nextMessage++; + NextMessage++; start = DateTime.Now; } //logFile = new IFile(); - if (l_size != logFile.Length()) + if (l_size != LogFile.Length()) { // this should be the longest running task - await Task.FromResult(lines = logFile.Tail(12)); + await Task.FromResult(lines = LogFile.Tail(12)); if (lines != oldLines) { - l_size = logFile.Length(); + l_size = LogFile.Length(); int end; if (lines.Length == oldLines.Length) end = lines.Length - 1; @@ -459,7 +431,7 @@ namespace IW4MAdmin } } oldLines = lines; - l_size = logFile.Length(); + l_size = LogFile.Length(); } #if DEBUG == false catch (SharedLibrary.Exceptions.NetworkException) @@ -501,7 +473,7 @@ namespace IW4MAdmin } this.Hostname = hostname.Value.StripColors(); - this.CurrentMap = maps.Find(m => m.Name == mapname.Value) ?? new Map(mapname.Value, mapname.Value); + this.CurrentMap = Maps.Find(m => m.Name == mapname.Value) ?? new Map(mapname.Value, mapname.Value); this.MaxClients = maxplayers.Value; this.FSGame = game.Value; @@ -531,7 +503,7 @@ namespace IW4MAdmin #endif } else - logFile = new IFile(logPath); + LogFile = new IFile(logPath); Logger.WriteInfo("Log file is " + logPath); await ExecuteEvent(new Event(Event.GType.Start, "Server started", null, null, this)); @@ -543,26 +515,15 @@ namespace IW4MAdmin //Process any server event override protected async Task ProcessEvent(Event E) { - //todo: move - while (ChatHistory.Count > Math.Ceiling((double)ClientNum / 2)) - ChatHistory.RemoveAt(0); if (E.Type == Event.GType.Connect) { ChatHistory.Add(new Chat(E.Origin.Name, "CONNECTED", DateTime.Now)); - return; } if (E.Type == Event.GType.Disconnect) { ChatHistory.Add(new Chat(E.Origin.Name, "DISCONNECTED", DateTime.Now)); - - // the last client hasn't fully disconnected yet - // so there will still be at least 1 client left - if (ClientNum < 2) - ChatHistory.Clear(); - - return; } if (E.Type == Event.GType.Kill) @@ -574,6 +535,15 @@ namespace IW4MAdmin await ExecuteEvent(new Event(Event.GType.Death, "suicide", E.Target, null, this)); } + //todo: move + while (ChatHistory.Count > Math.Ceiling((double)ClientNum / 2)) + ChatHistory.RemoveAt(0); + + // the last client hasn't fully disconnected yet + // so there will still be at least 1 client left + if (ClientNum < 2) + ChatHistory.Clear(); + if (E.Type == Event.GType.Say) { if (E.Data.Length < 2) // ITS A LIE! @@ -643,7 +613,7 @@ namespace IW4MAdmin FSGame = (await this.GetDvarAsync("fs_game")).Value.StripColors(); string mapname = this.GetDvarAsync("mapname").Result.Value; - CurrentMap = maps.Find(m => m.Name == mapname) ?? new Map(mapname, mapname); + CurrentMap = Maps.Find(m => m.Name == mapname) ?? new Map(mapname, mapname); return; } @@ -779,9 +749,9 @@ namespace IW4MAdmin catch (Exception E) { Logger.WriteError("Unable to reload configs! - " + E.Message); - messages = new List(); - maps = new List(); - rules = new List(); + BroadcastMessages = new List(); + Maps = new List(); + Rules = new List(); return false; } } diff --git a/Admin/ServerConfig.cs b/Admin/ServerConfigurationGenerator.cs similarity index 64% rename from Admin/ServerConfig.cs rename to Admin/ServerConfigurationGenerator.cs index 31070fdc4..f5abeb256 100644 --- a/Admin/ServerConfig.cs +++ b/Admin/ServerConfigurationGenerator.cs @@ -1,33 +1,23 @@ -using System; +using SharedLibrary; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Net; - -using SharedLibrary.Interfaces; - +using System.Text; +using System.Threading.Tasks; namespace IW4MAdmin { - public class ServerConfig : Serialize + class ServerConfigurationGenerator { - public string IP; - public int Port; - public string Password; - public string FtpPrefix; - - public override string Filename() - { - return $"config/servers/{IP}_{Port}.cfg"; - } - - public static ServerConfig Generate() + public static ServerConfiguration Generate() { string IP = String.Empty; int Port = 0; string Password; + bool AllowMultipleOwners; - while(IP == String.Empty) + while (IP == String.Empty) { try { @@ -43,7 +33,7 @@ namespace IW4MAdmin } } - while(Port == 0) + while (Port == 0) { try { @@ -60,10 +50,13 @@ namespace IW4MAdmin Console.Write("Enter server RCON password: "); Password = Console.ReadLine(); - var config = new ServerConfig() { IP = IP, Password = Password, Port = Port }; + Console.Write("Allow multiple owners? [y/n]: "); + AllowMultipleOwners = (Console.ReadLine().ToLower().FirstOrDefault() as char?) == 'y'; + + var config = new ServerConfiguration() { IP = IP, Password = Password, Port = Port, AllowMultipleOwners = AllowMultipleOwners }; config.Write(); - Console.WriteLine("Config saved, add another? [y/n]:"); + Console.Write("Configuration saved, add another? [y/n]:"); if (Console.ReadLine().ToLower().First() == 'y') Generate(); diff --git a/Admin/WebService.cs b/Admin/WebService.cs index 4c0ff6fca..45fb6b15d 100644 --- a/Admin/WebService.cs +++ b/Admin/WebService.cs @@ -55,7 +55,7 @@ namespace IW4MAdmin catch (Exception e) { - Manager.GetInstance().Logger.WriteError($"Unable to start webservice ( port is probably in use ): {e.Message}"); + ApplicationManager.GetInstance().Logger.WriteError($"Unable to start webservice ( port is probably in use ): {e.Message}"); } } @@ -194,7 +194,7 @@ namespace IW4MAdmin { var info = new List(); - foreach (Server S in Manager.GetInstance().Servers) + foreach (Server S in ApplicationManager.GetInstance().Servers) { ServerInfo eachServer = new ServerInfo() { @@ -307,11 +307,11 @@ namespace IW4MAdmin if (querySet["server"] != null) { - Server S = Manager.GetInstance().Servers.ToList().Find(x => (x.GetPort().ToString() == querySet["server"])); + Server S = ApplicationManager.GetInstance().Servers.ToList().Find(x => (x.GetPort().ToString() == querySet["server"])); if (S != null) { - Player admin = Manager.GetInstance().GetClientDatabase().GetPlayer(querySet["IP"]); + Player admin = ApplicationManager.GetInstance().GetClientDatabase().GetPlayer(querySet["IP"]); if (admin == null) admin = new Player("RestUser", "-1", -1, (int)Player.Permission.User); @@ -382,7 +382,7 @@ namespace IW4MAdmin try { //selectedPenalties = Manager.GetInstance().Servers.First().Bans.OrderByDescending(x => x.When).ToList().GetRange(Convert.ToInt32(querySet["from"]), 15); - selectedPenalties = ((Manager.GetInstance().GetClientPenalties()) as PenaltyList).AsChronoList(Convert.ToInt32(querySet["from"]), 15).OrderByDescending(b => b.When).ToList(); + selectedPenalties = ((ApplicationManager.GetInstance().GetClientPenalties()) as PenaltyList).AsChronoList(Convert.ToInt32(querySet["from"]), 15).OrderByDescending(b => b.When).ToList(); } catch (Exception) @@ -394,8 +394,8 @@ namespace IW4MAdmin foreach (var p in selectedPenalties) { - Player admin = Manager.GetInstance().GetClientDatabase().GetPlayer(p.PenaltyOriginID, 0); - Player penalized = Manager.GetInstance().GetClientDatabase().GetPlayer(p.OffenderID, 0); + Player admin = ApplicationManager.GetInstance().GetClientDatabase().GetPlayer(p.PenaltyOriginID, 0); + Player penalized = ApplicationManager.GetInstance().GetClientDatabase().GetPlayer(p.OffenderID, 0); if (admin == null && penalized == null) continue; if (admin == null) @@ -538,7 +538,7 @@ namespace IW4MAdmin HttpResponse resp = new HttpResponse() { contentType = GetContentType(), - content = Newtonsoft.Json.JsonConvert.SerializeObject(((Manager.GetInstance().GetClientPenalties()) as PenaltyList).AsChronoList(Convert.ToInt32(querySet["from"]), 15), Newtonsoft.Json.Formatting.Indented, new Newtonsoft.Json.JsonConverter[] { new Newtonsoft.Json.Converters.StringEnumConverter() }), + content = Newtonsoft.Json.JsonConvert.SerializeObject(((ApplicationManager.GetInstance().GetClientPenalties()) as PenaltyList).AsChronoList(Convert.ToInt32(querySet["from"]), 15), Newtonsoft.Json.Formatting.Indented, new Newtonsoft.Json.JsonConverter[] { new Newtonsoft.Json.Converters.StringEnumConverter() }), additionalHeaders = new Dictionary() }; return resp; @@ -631,27 +631,27 @@ namespace IW4MAdmin contentType = GetContentType(), additionalHeaders = new Dictionary() }; - bool authed = Manager.GetInstance().GetClientDatabase().GetAdmins().FindAll(x => x.IP == querySet["IP"]).Count > 0; + bool authed = ApplicationManager.GetInstance().GetClientDatabase().GetAdmins().FindAll(x => x.IP == querySet["IP"]).Count > 0; bool recent = false; if (querySet["id"] != null) { - matchedPlayers.Add(Manager.GetInstance().GetClientDatabase().GetPlayer(Convert.ToInt32(querySet["id"]))); + matchedPlayers.Add(ApplicationManager.GetInstance().GetClientDatabase().GetPlayer(Convert.ToInt32(querySet["id"]))); } else if (querySet["npID"] != null) { - matchedPlayers.Add(Manager.GetInstance().GetClientDatabase().GetPlayers(new List { querySet["npID"] }).First()); + matchedPlayers.Add(ApplicationManager.GetInstance().GetClientDatabase().GetPlayers(new List { querySet["npID"] }).First()); } else if (querySet["name"] != null) { - matchedPlayers = Manager.GetInstance().GetClientDatabase().FindPlayers(querySet["name"]); + matchedPlayers = ApplicationManager.GetInstance().GetClientDatabase().FindPlayers(querySet["name"]); } else if (querySet["recent"] != null) { - matchedPlayers = Manager.GetInstance().GetClientDatabase().GetRecentPlayers(); + matchedPlayers = ApplicationManager.GetInstance().GetClientDatabase().GetRecentPlayers(); recent = true; } @@ -675,7 +675,7 @@ namespace IW4MAdmin if (!recent) { - foreach (var a in Manager.GetInstance().Servers.First().GetAliases(pp)) + foreach (var a in ApplicationManager.GetInstance().Servers.First().GetAliases(pp)) { eachPlayer.playerAliases = a.Names; eachPlayer.playerIPs = a.IPS; diff --git a/Admin/lib/SharedLibrary.dll b/Admin/lib/SharedLibrary.dll index 61365399f..f580f357a 100644 Binary files a/Admin/lib/SharedLibrary.dll and b/Admin/lib/SharedLibrary.dll differ diff --git a/IW4MAdmin.sln b/IW4MAdmin.sln index 73d7081ad..8d9d19a6d 100644 --- a/IW4MAdmin.sln +++ b/IW4MAdmin.sln @@ -54,166 +54,166 @@ Global Release-Stable|x86 = Release-Stable|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|Any CPU.ActiveCfg = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|Any CPU.Build.0 = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|x64.ActiveCfg = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|x64.Build.0 = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|x86.ActiveCfg = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|x86.Build.0 = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Any CPU.ActiveCfg = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Any CPU.Build.0 = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|x64.ActiveCfg = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|x64.Build.0 = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|x86.ActiveCfg = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|x86.Build.0 = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|Any CPU.ActiveCfg = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|Any CPU.Build.0 = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|x64.ActiveCfg = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|x64.Build.0 = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|x86.ActiveCfg = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|x86.Build.0 = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|Any CPU.ActiveCfg = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|Any CPU.Build.0 = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|x64.ActiveCfg = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|x64.Build.0 = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|x86.ActiveCfg = Release-Stable|Any CPU - {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|x86.Build.0 = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|Any CPU.ActiveCfg = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|Any CPU.Build.0 = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|x64.ActiveCfg = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|x64.Build.0 = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|x86.ActiveCfg = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|x86.Build.0 = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release|Any CPU.ActiveCfg = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release|Any CPU.Build.0 = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release|x64.ActiveCfg = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release|x64.Build.0 = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release|x86.ActiveCfg = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release|x86.Build.0 = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Nightly|Any CPU.ActiveCfg = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Nightly|Any CPU.Build.0 = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Nightly|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Nightly|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Nightly|x64.ActiveCfg = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Nightly|x64.Build.0 = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Nightly|x86.ActiveCfg = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Nightly|x86.Build.0 = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|Any CPU.ActiveCfg = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|Any CPU.Build.0 = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|x64.ActiveCfg = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|x64.Build.0 = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|x86.ActiveCfg = Release-Stable|Any CPU - {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|x86.Build.0 = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|Any CPU.ActiveCfg = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|Any CPU.Build.0 = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|x64.ActiveCfg = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|x64.Build.0 = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|x86.ActiveCfg = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|x86.Build.0 = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|Any CPU.ActiveCfg = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|Any CPU.Build.0 = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|x64.ActiveCfg = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|x64.Build.0 = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|x86.ActiveCfg = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|x86.Build.0 = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|Any CPU.ActiveCfg = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|Any CPU.Build.0 = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|x64.ActiveCfg = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|x64.Build.0 = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|x86.ActiveCfg = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|x86.Build.0 = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|Any CPU.ActiveCfg = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|Any CPU.Build.0 = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|x64.ActiveCfg = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|x64.Build.0 = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|x86.ActiveCfg = Release-Stable|Any CPU - {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|x86.Build.0 = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|Any CPU.ActiveCfg = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|Any CPU.Build.0 = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|x64.ActiveCfg = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|x64.Build.0 = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|x86.ActiveCfg = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|x86.Build.0 = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release|Any CPU.ActiveCfg = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release|Any CPU.Build.0 = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release|x64.ActiveCfg = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release|x64.Build.0 = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release|x86.ActiveCfg = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release|x86.Build.0 = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Nightly|Any CPU.ActiveCfg = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Nightly|Any CPU.Build.0 = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Nightly|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Nightly|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Nightly|x64.ActiveCfg = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Nightly|x64.Build.0 = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Nightly|x86.ActiveCfg = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Nightly|x86.Build.0 = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Stable|Any CPU.ActiveCfg = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Stable|Any CPU.Build.0 = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Stable|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Stable|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Stable|x64.ActiveCfg = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Stable|x64.Build.0 = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Stable|x86.ActiveCfg = Release-Stable|Any CPU - {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Stable|x86.Build.0 = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Debug|Any CPU.ActiveCfg = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Debug|Any CPU.Build.0 = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Debug|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Debug|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Debug|x64.ActiveCfg = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Debug|x64.Build.0 = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Debug|x86.ActiveCfg = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Debug|x86.Build.0 = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release|Any CPU.ActiveCfg = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release|Any CPU.Build.0 = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release|x64.ActiveCfg = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release|x64.Build.0 = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release|x86.ActiveCfg = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release|x86.Build.0 = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Nightly|Any CPU.ActiveCfg = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Nightly|Any CPU.Build.0 = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Nightly|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Nightly|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Nightly|x64.ActiveCfg = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Nightly|x64.Build.0 = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Nightly|x86.ActiveCfg = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Nightly|x86.Build.0 = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|Any CPU.ActiveCfg = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|Any CPU.Build.0 = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|x64.ActiveCfg = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|x64.Build.0 = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|x86.ActiveCfg = Release-Stable|Any CPU - {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|x86.Build.0 = Release-Stable|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|Any CPU.Build.0 = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|Mixed Platforms.ActiveCfg = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|Mixed Platforms.Build.0 = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|x64.ActiveCfg = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|x64.Build.0 = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|x86.ActiveCfg = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Debug|x86.Build.0 = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Any CPU.Build.0 = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|x64.ActiveCfg = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|x64.Build.0 = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|x86.ActiveCfg = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release|x86.Build.0 = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|Any CPU.ActiveCfg = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|Any CPU.Build.0 = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|Mixed Platforms.ActiveCfg = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|Mixed Platforms.Build.0 = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|x64.ActiveCfg = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|x64.Build.0 = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|x86.ActiveCfg = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Nightly|x86.Build.0 = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|Any CPU.ActiveCfg = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|Any CPU.Build.0 = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|Mixed Platforms.ActiveCfg = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|Mixed Platforms.Build.0 = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|x64.ActiveCfg = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|x64.Build.0 = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|x86.ActiveCfg = Release|Any CPU + {DD5DCDA2-51DB-4B1A-922F-5705546E6115}.Release-Stable|x86.Build.0 = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|Any CPU.Build.0 = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|Mixed Platforms.ActiveCfg = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|Mixed Platforms.Build.0 = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|x64.ActiveCfg = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|x64.Build.0 = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|x86.ActiveCfg = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Debug|x86.Build.0 = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release|Any CPU.Build.0 = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release|x64.ActiveCfg = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release|x64.Build.0 = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release|x86.ActiveCfg = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release|x86.Build.0 = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Nightly|Any CPU.ActiveCfg = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Nightly|Any CPU.Build.0 = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Nightly|Mixed Platforms.ActiveCfg = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Nightly|Mixed Platforms.Build.0 = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Nightly|x64.ActiveCfg = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Nightly|x64.Build.0 = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Nightly|x86.ActiveCfg = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Nightly|x86.Build.0 = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|Any CPU.ActiveCfg = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|Any CPU.Build.0 = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|Mixed Platforms.ActiveCfg = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|Mixed Platforms.Build.0 = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|x64.ActiveCfg = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|x64.Build.0 = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|x86.ActiveCfg = Release|Any CPU + {4785AB75-66F3-4391-985D-63A5A049A0FA}.Release-Stable|x86.Build.0 = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|Any CPU.Build.0 = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|Mixed Platforms.ActiveCfg = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|Mixed Platforms.Build.0 = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|x64.ActiveCfg = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|x64.Build.0 = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|x86.ActiveCfg = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Debug|x86.Build.0 = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|Any CPU.Build.0 = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|x64.ActiveCfg = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|x64.Build.0 = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|x86.ActiveCfg = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release|x86.Build.0 = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|Any CPU.ActiveCfg = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|Any CPU.Build.0 = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|Mixed Platforms.ActiveCfg = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|Mixed Platforms.Build.0 = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|x64.ActiveCfg = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|x64.Build.0 = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|x86.ActiveCfg = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Nightly|x86.Build.0 = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|Any CPU.ActiveCfg = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|Any CPU.Build.0 = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|Mixed Platforms.ActiveCfg = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|Mixed Platforms.Build.0 = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|x64.ActiveCfg = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|x64.Build.0 = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|x86.ActiveCfg = Release|Any CPU + {D51EECEB-438A-47DA-870F-7D7B41BC24D6}.Release-Stable|x86.Build.0 = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|Any CPU.Build.0 = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|Mixed Platforms.ActiveCfg = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|Mixed Platforms.Build.0 = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|x64.ActiveCfg = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|x64.Build.0 = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|x86.ActiveCfg = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Debug|x86.Build.0 = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release|Any CPU.Build.0 = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release|x64.ActiveCfg = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release|x64.Build.0 = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release|x86.ActiveCfg = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release|x86.Build.0 = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Nightly|Any CPU.ActiveCfg = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Nightly|Any CPU.Build.0 = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Nightly|Mixed Platforms.ActiveCfg = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Nightly|Mixed Platforms.Build.0 = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Nightly|x64.ActiveCfg = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Nightly|x64.Build.0 = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Nightly|x86.ActiveCfg = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Nightly|x86.Build.0 = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Stable|Any CPU.ActiveCfg = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Stable|Any CPU.Build.0 = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Stable|Mixed Platforms.ActiveCfg = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Stable|Mixed Platforms.Build.0 = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Stable|x64.ActiveCfg = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Stable|x64.Build.0 = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Stable|x86.ActiveCfg = Release|Any CPU + {AF097E6B-48D5-4452-9CCF-0A81A21F341D}.Release-Stable|x86.Build.0 = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Debug|Any CPU.Build.0 = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Debug|Mixed Platforms.ActiveCfg = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Debug|Mixed Platforms.Build.0 = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Debug|x64.ActiveCfg = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Debug|x64.Build.0 = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Debug|x86.ActiveCfg = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Debug|x86.Build.0 = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release|Any CPU.Build.0 = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release|x64.ActiveCfg = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release|x64.Build.0 = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release|x86.ActiveCfg = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release|x86.Build.0 = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Nightly|Any CPU.ActiveCfg = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Nightly|Any CPU.Build.0 = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Nightly|Mixed Platforms.ActiveCfg = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Nightly|Mixed Platforms.Build.0 = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Nightly|x64.ActiveCfg = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Nightly|x64.Build.0 = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Nightly|x86.ActiveCfg = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Nightly|x86.Build.0 = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|Any CPU.ActiveCfg = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|Any CPU.Build.0 = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|Mixed Platforms.ActiveCfg = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|Mixed Platforms.Build.0 = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|x64.ActiveCfg = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|x64.Build.0 = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|x86.ActiveCfg = Release|Any CPU + {428D8EB9-ECA3-4A66-AA59-3A944378C33F}.Release-Stable|x86.Build.0 = Release|Any CPU {E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Debug|Any CPU.ActiveCfg = Release-Stable|Any CPU {E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Debug|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU {E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Debug|x64.ActiveCfg = Release-Stable|Any CPU @@ -230,38 +230,38 @@ Global {E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release-Stable|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU {E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release-Stable|x64.ActiveCfg = Release-Stable|Any CPU {E46C85BD-A99C-484E-BCCE-0F1831C5925E}.Release-Stable|x86.ActiveCfg = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Debug|Any CPU.ActiveCfg = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Debug|Any CPU.Build.0 = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Debug|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Debug|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Debug|x64.ActiveCfg = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Debug|x64.Build.0 = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Debug|x86.ActiveCfg = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Debug|x86.Build.0 = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release|Any CPU.ActiveCfg = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release|Any CPU.Build.0 = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release|x64.ActiveCfg = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release|x64.Build.0 = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release|x86.ActiveCfg = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release|x86.Build.0 = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Nightly|Any CPU.ActiveCfg = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Nightly|Any CPU.Build.0 = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Nightly|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Nightly|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Nightly|x64.ActiveCfg = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Nightly|x64.Build.0 = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Nightly|x86.ActiveCfg = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Nightly|x86.Build.0 = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Stable|Any CPU.ActiveCfg = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Stable|Any CPU.Build.0 = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Stable|Mixed Platforms.ActiveCfg = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Stable|Mixed Platforms.Build.0 = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Stable|x64.ActiveCfg = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Stable|x64.Build.0 = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Stable|x86.ActiveCfg = Release-Stable|Any CPU - {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Stable|x86.Build.0 = Release-Stable|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Debug|Any CPU.Build.0 = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Debug|Mixed Platforms.ActiveCfg = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Debug|Mixed Platforms.Build.0 = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Debug|x64.ActiveCfg = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Debug|x64.Build.0 = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Debug|x86.ActiveCfg = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Debug|x86.Build.0 = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release|Any CPU.Build.0 = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release|x64.ActiveCfg = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release|x64.Build.0 = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release|x86.ActiveCfg = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release|x86.Build.0 = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Nightly|Any CPU.ActiveCfg = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Nightly|Any CPU.Build.0 = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Nightly|Mixed Platforms.ActiveCfg = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Nightly|Mixed Platforms.Build.0 = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Nightly|x64.ActiveCfg = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Nightly|x64.Build.0 = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Nightly|x86.ActiveCfg = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Nightly|x86.Build.0 = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Stable|Any CPU.ActiveCfg = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Stable|Any CPU.Build.0 = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Stable|Mixed Platforms.ActiveCfg = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Stable|Mixed Platforms.Build.0 = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Stable|x64.ActiveCfg = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Stable|x64.Build.0 = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Stable|x86.ActiveCfg = Release|Any CPU + {C9E821BF-23AD-4CB5-B7F9-B3B99B606650}.Release-Stable|x86.Build.0 = Release|Any CPU {1479DE87-ACB5-4046-81C8-A0BA5041227D}.Debug|Any CPU.ActiveCfg = Release|Any CPU {1479DE87-ACB5-4046-81C8-A0BA5041227D}.Debug|Any CPU.Build.0 = Release|Any CPU {1479DE87-ACB5-4046-81C8-A0BA5041227D}.Debug|Mixed Platforms.ActiveCfg = Release|Any CPU diff --git a/Plugins/SimpleStats/StatsPlugin.csproj b/Plugins/SimpleStats/StatsPlugin.csproj index ee65a861f..9ef25daa3 100644 --- a/Plugins/SimpleStats/StatsPlugin.csproj +++ b/Plugins/SimpleStats/StatsPlugin.csproj @@ -45,7 +45,7 @@ - ..\Admin\lib\System.Data.SQLite.dll + ..\..\Admin\lib\System.Data.SQLite.dll diff --git a/Plugins/VoteMap/Plugin.cs b/Plugins/VoteMap/Plugin.cs index 7e6f71a99..67236b8bf 100644 --- a/Plugins/VoteMap/Plugin.cs +++ b/Plugins/VoteMap/Plugin.cs @@ -38,7 +38,7 @@ namespace Votemap_Plugin { string mapSearch = E.Data.ToLower().Trim(); // probably not the most optimized way to match the map.. but nothing is time critical here - Map votedMap = E.Owner.maps.Find(m => (m.Alias.ToLower().Contains(mapSearch) || m.Name.Contains(mapSearch))); + Map votedMap = E.Owner.Maps.Find(m => (m.Alias.ToLower().Contains(mapSearch) || m.Name.Contains(mapSearch))); if (votedMap == null) await E.Origin.Tell("^1" + E.Data + " is not a recognized map"); else diff --git a/SharedLibrary/Commands/NativeCommands.cs b/SharedLibrary/Commands/NativeCommands.cs index cd2e9bfad..35eaea8ea 100644 --- a/SharedLibrary/Commands/NativeCommands.cs +++ b/SharedLibrary/Commands/NativeCommands.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace SharedLibrary.Commands { - class CQuit : Command + public class CQuit : Command { public CQuit(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -17,7 +17,7 @@ namespace SharedLibrary.Commands } } - class COwner : Command + public class COwner : Command { public COwner(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -27,7 +27,6 @@ namespace SharedLibrary.Commands { E.Origin.SetLevel(Player.Permission.Owner); await E.Origin.Tell("Congratulations, you have claimed ownership of this server!"); - E.Owner.owner = E.Origin; E.Owner.Manager.GetClientDatabase().UpdatePlayer(E.Origin); } else @@ -35,21 +34,21 @@ namespace SharedLibrary.Commands } } - class Cwarn : Command + public class CWarn : Command { - public Cwarn(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } + public CWarn(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } public override async Task ExecuteAsync(Event E) { E.Target.lastOffense = E.Data.RemoveWords(1); if (E.Origin.Level <= E.Target.Level) - await E.Origin.Tell("You cannot warn " + E.Target.Name); + await E.Origin.Tell($"You do not have the required privileges to warn {E.Target.Name}"); else await E.Target.Warn(E.Target.lastOffense, E.Origin); } } - class CWarnClear : Command + public class CWarnClear : Command { public CWarnClear(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -62,7 +61,7 @@ namespace SharedLibrary.Commands } } - class CKick : Command + public class CKick : Command { public CKick(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -70,13 +69,16 @@ namespace SharedLibrary.Commands { E.Target.lastOffense = E.Data.RemoveWords(1); if (E.Origin.Level > E.Target.Level) + { + await E.Owner.ExecuteEvent(new Event(Event.GType.Kick, E.Data, E.Origin, E.Target, E.Owner)); await E.Target.Kick(E.Target.lastOffense, E.Origin); + } else - await E.Origin.Tell($"You cannot kick {E.Target.Name}"); + await E.Origin.Tell($"You do not have the required privileges to kick {E.Target.Name}"); } } - class CSay : Command + public class CSay : Command { public CSay(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -86,13 +88,13 @@ namespace SharedLibrary.Commands } } - class CTempBan : Command + public class CTempBan : Command { public CTempBan(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } public override async Task ExecuteAsync(Event E) { - E.Target.lastOffense = SharedLibrary.Utilities.RemoveWords(E.Data, 1); + E.Target.lastOffense = Utilities.RemoveWords(E.Data, 1); String Message = E.Target.lastOffense; if (E.Origin.Level > E.Target.Level) { @@ -104,13 +106,13 @@ namespace SharedLibrary.Commands } } - class CBan : Command + public class CBan : Command { public CBan(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } public override async Task ExecuteAsync(Event E) { - E.Target.lastOffense = SharedLibrary.Utilities.RemoveWords(E.Data, 1); + E.Target.lastOffense = Utilities.RemoveWords(E.Data, 1); E.Target.lastEvent = E; // needs to be fixed String Message; if (E.Owner.Website == null) @@ -119,6 +121,7 @@ namespace SharedLibrary.Commands Message = "^1Player Banned: ^5" + E.Target.lastOffense; if (E.Origin.Level > E.Target.Level) { + await E.Owner.ExecuteEvent(new Event(Event.GType.Ban, E.Data, E.Origin, E.Target, E.Owner)); await E.Target.Ban(Message, E.Origin); await E.Origin.Tell(String.Format("Sucessfully banned ^5{0} ^7({1})", E.Target.Name, E.Target.NetworkID)); } @@ -127,7 +130,7 @@ namespace SharedLibrary.Commands } } - class CUnban : Command + public class CUnban : Command { public CUnban(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -138,7 +141,7 @@ namespace SharedLibrary.Commands } } - class CWhoAmI : Command + public class CWhoAmI : Command { public CWhoAmI(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -149,7 +152,7 @@ namespace SharedLibrary.Commands } } - class CList : Command + public class CList : Command { public CList(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -165,9 +168,9 @@ namespace SharedLibrary.Commands continue; if (P.Masked) - playerList.AppendFormat("[^3{0}^7]{3}[^3{1}^7] {2}", Utilities.ConvertLevelToColor(Player.Permission.User), P.ClientID, P.Name, SharedLibrary.Utilities.GetSpaces(Player.Permission.SeniorAdmin.ToString().Length - Player.Permission.User.ToString().Length)); + playerList.AppendFormat("[^3{0}^7]{3}[^3{1}^7] {2}", Utilities.ConvertLevelToColor(Player.Permission.User), P.ClientID, P.Name, Utilities.GetSpaces(Player.Permission.SeniorAdmin.ToString().Length - Player.Permission.User.ToString().Length)); else - playerList.AppendFormat("[^3{0}^7]{3}[^3{1}^7] {2}", Utilities.ConvertLevelToColor(P.Level), P.ClientID, P.Name, SharedLibrary.Utilities.GetSpaces(Player.Permission.SeniorAdmin.ToString().Length - P.Level.ToString().Length)); + playerList.AppendFormat("[^3{0}^7]{3}[^3{1}^7] {2}", Utilities.ConvertLevelToColor(P.Level), P.ClientID, P.Name, Utilities.GetSpaces(Player.Permission.SeniorAdmin.ToString().Length - P.Level.ToString().Length)); if (count == 2 || E.Owner.GetPlayersAsList().Count == 1) { @@ -182,7 +185,7 @@ namespace SharedLibrary.Commands } } - class CHelp : Command + public class CHelp : Command { public CHelp(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -195,7 +198,7 @@ namespace SharedLibrary.Commands bool found = false; foreach (Command C in E.Owner.Manager.GetCommands()) { - if (C.Name.Contains(cmd) || C.Name == cmd) + if (C.Name.Contains(cmd)) { await E.Origin.Tell(" [^3" + C.Name + "^7] " + C.Description); found = true; @@ -235,7 +238,7 @@ namespace SharedLibrary.Commands } } - class CFastRestart : Command + public class CFastRestart : Command { public CFastRestart(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -250,7 +253,7 @@ namespace SharedLibrary.Commands } } - class CMapRotate : Command + public class CMapRotate : Command { public CMapRotate(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -265,7 +268,7 @@ namespace SharedLibrary.Commands } } - class CSetLevel : Command + public class CSetLevel : Command { public CSetLevel(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -282,16 +285,21 @@ namespace SharedLibrary.Commands if (newPerm == Player.Permission.Owner && E.Origin.Level != Player.Permission.Console) newPerm = Player.Permission.Banned; + if (newPerm == Player.Permission.Owner && !E.Owner.Config.AllowMultipleOwners) + { + await E.Origin.Tell("There can only be 1 owner. Modify your server configuration if multiple owners are required"); + return; + } + if (newPerm > Player.Permission.Banned) { var ActiveClient = E.Owner.Manager.GetActiveClients().FirstOrDefault(p => p.NetworkID == E.Target.NetworkID); ActiveClient?.SetLevel(newPerm); if (ActiveClient != null) - { - await ActiveClient?.Tell("Congratulations! You have been promoted to ^3" + newPerm); - await E.Origin.Tell($"{E.Target.Name} was successfully promoted!"); - } + await ActiveClient.Tell("Congratulations! You have been promoted to ^3" + newPerm); + + await E.Origin.Tell($"{E.Target.Name} was successfully promoted!"); E.Target.SetLevel(newPerm); E.Owner.Manager.GetClientDatabase().UpdatePlayer(E.Target); @@ -302,7 +310,7 @@ namespace SharedLibrary.Commands } } - class CUsage : Command + public class CUsage : Command { public CUsage(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -312,7 +320,7 @@ namespace SharedLibrary.Commands } } - class CUptime : Command + public class CUptime : Command { public CUptime(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -323,7 +331,7 @@ namespace SharedLibrary.Commands } } - class CListAdmins : Command + public class CListAdmins : Command { public CListAdmins(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -343,14 +351,14 @@ namespace SharedLibrary.Commands } } - class CLoadMap : Command + public class CLoadMap : Command { public CLoadMap(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } public override async Task ExecuteAsync(Event E) { string newMap = E.Data.Trim().ToLower(); - foreach (Map m in E.Owner.maps) + foreach (Map m in E.Owner.Maps) { if (m.Name.ToLower() == newMap || m.Alias.ToLower() == newMap) { @@ -367,7 +375,7 @@ namespace SharedLibrary.Commands } } - class CFindPlayer : Command + public class CFindPlayer : Command { public CFindPlayer(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -383,13 +391,13 @@ namespace SharedLibrary.Commands foreach (Player P in db_players) { - String mesg = String.Format("[^3{0}^7] [^3@{1}^7] - [{2}^7] - {3} | last seen {4} ago", P.Name, P.DatabaseID, SharedLibrary.Utilities.ConvertLevelToColor(P.Level), P.IP, P.GetLastConnection()); + String mesg = String.Format("[^3{0}^7] [^3@{1}^7] - [{2}^7] - {3} | last seen {4} ago", P.Name, P.DatabaseID, Utilities.ConvertLevelToColor(P.Level), P.IP, P.GetLastConnection()); await E.Origin.Tell(mesg); } } } - class CFindAllPlayers : Command + public class CFindAllPlayers : Command { public CFindAllPlayers(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -435,13 +443,13 @@ namespace SharedLibrary.Commands } } - class CListRules : Command + public class CListRules : Command { public CListRules(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } public override async Task ExecuteAsync(Event E) { - if (E.Owner.rules.Count < 1) + if (E.Owner.Rules.Count < 1) { if (E.Message.IsBroadcastCommand()) await E.Owner.Broadcast("The server owner has not set any rules."); @@ -451,7 +459,7 @@ namespace SharedLibrary.Commands else { - foreach (String r in E.Owner.rules) + foreach (String r in E.Owner.Rules) { if (E.Message.IsBroadcastCommand()) await E.Owner.Broadcast("- " + r); @@ -462,7 +470,7 @@ namespace SharedLibrary.Commands } } - class CPrivateMessage : Command + public class CPrivateMessage : Command { public CPrivateMessage(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -474,7 +482,7 @@ namespace SharedLibrary.Commands } } - class CReload : Command + public class CReload : Command { public CReload(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -487,7 +495,7 @@ namespace SharedLibrary.Commands } } - class CFlag : Command + public class CFlag : Command { public CFlag(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -510,6 +518,7 @@ namespace SharedLibrary.Commands E.Data = Utilities.RemoveWords(E.Data, 1); E.Target.SetLevel(Player.Permission.Flagged); E.Owner.Manager.GetClientPenalties().AddPenalty(new Penalty(Penalty.Type.Flag, E.Data, E.Target.NetworkID, E.Origin.NetworkID, DateTime.Now, E.Target.IP)); + await E.Owner.ExecuteEvent(new Event(Event.GType.Flag, E.Data, E.Origin, E.Target, E.Owner)); await E.Origin.Tell("You have ^5flagged ^7" + E.Target.Name); } @@ -517,7 +526,7 @@ namespace SharedLibrary.Commands } } - class CReport : Command + public class CReport : Command { public CReport(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -546,12 +555,11 @@ namespace SharedLibrary.Commands await E.Origin.Tell("Successfully reported " + E.Target.Name); await E.Owner.ExecuteEvent(new Event(Event.GType.Report, E.Data, E.Origin, E.Target, E.Owner)); - await E.Owner.ToAdmins(String.Format("^5{0}^7->^1{1}^7: {2}", E.Origin.Name, E.Target.Name, E.Data)); } } - class CListReports : Command + public class CListReports : Command { public CListReports(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -575,7 +583,7 @@ namespace SharedLibrary.Commands } } - class CMask : Command + public class CMask : Command { public CMask(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -591,10 +599,12 @@ namespace SharedLibrary.Commands E.Origin.Masked = true; await E.Origin.Tell("You are now masked"); } + + E.Owner.Manager.GetClientDatabase().UpdatePlayer(E.Origin); } } - class CListBanInfo : Command + public class CListBanInfo : Command { public CListBanInfo(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -627,7 +637,7 @@ namespace SharedLibrary.Commands } } - class CListAlias : Command + public class CListAlias : Command { public CListAlias(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -668,7 +678,7 @@ namespace SharedLibrary.Commands } } - class CExecuteRCON : Command + public class CExecuteRCON : Command { public CExecuteRCON(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } @@ -682,7 +692,7 @@ namespace SharedLibrary.Commands } } - class CPlugins : Command + public class CPlugins : Command { public CPlugins(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { } diff --git a/SharedLibrary/Event.cs b/SharedLibrary/Event.cs index 245c95035..02a9bede7 100644 --- a/SharedLibrary/Event.cs +++ b/SharedLibrary/Event.cs @@ -82,7 +82,8 @@ namespace SharedLibrary Unknown, //FROM PLAYER - Report + Report, + Flag } public Event(GType t, string d, Player O, Player T, Server S) diff --git a/SharedLibrary/Properties/AssemblyInfo.cs b/SharedLibrary/Properties/AssemblyInfo.cs index 94a57df85..ac893eb8c 100644 --- a/SharedLibrary/Properties/AssemblyInfo.cs +++ b/SharedLibrary/Properties/AssemblyInfo.cs @@ -6,11 +6,11 @@ using System.Runtime.InteropServices; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("SharedLibrary")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyDescription("Common library components for IW4MAdmin")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SharedLibrary")] -[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyCompany("ForeverNone LLC")] +[assembly: AssemblyProduct("IW4MAdmin")] +[assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/SharedLibrary/Server.cs b/SharedLibrary/Server.cs index c1fe5ad60..30934cc7f 100644 --- a/SharedLibrary/Server.cs +++ b/SharedLibrary/Server.cs @@ -14,64 +14,25 @@ namespace SharedLibrary [Guid("61d3829e-fcbe-44d3-bb7c-51db8c2d7ac5")] public abstract class Server { - public Server(Interfaces.IManager mgr, string address, int port, string password) + public Server(Interfaces.IManager mgr, ServerConfiguration config) { - Password = password; - IP = address; - Port = port; + Password = config.Password; + IP = config.IP; + Port = config.Port; Manager = mgr; Logger = Manager.GetLogger(); - ClientNum = 0; + ClientNum = 0; + Config = config; Players = new List(new Player[18]); - events = new Queue(); Reports = new List(); PlayerHistory = new Queue(); ChatHistory = new List(); - lastWebChat = DateTime.Now; - nextMessage = 0; + NextMessage = 0; InitializeTokens(); InitializeAutoMessages(); InitializeMaps(); InitializeRules(); - - var commands = mgr.GetCommands(); - - owner = Manager.GetClientDatabase().GetOwner(); - - if (owner == null) - commands.Add(new COwner("owner", "claim ownership of the server", "owner", Player.Permission.User, 0, false)); - - commands.Add(new CQuit("quit", "quit IW4MAdmin", "q", Player.Permission.Owner, 0, false)); - commands.Add(new CKick("kick", "kick a player by name. syntax: !kick .", "k", Player.Permission.Trusted, 2, true)); - commands.Add(new CSay("say", "broadcast message to all players. syntax: !say .", "s", Player.Permission.Moderator, 1, false)); - commands.Add(new CTempBan("tempban", "temporarily ban a player for 1 hour. syntax: !tempban .", "tb", Player.Permission.Moderator, 2, true)); - commands.Add(new CBan("ban", "permanently ban a player from the server. syntax: !ban ", "b", Player.Permission.SeniorAdmin, 2, true)); - commands.Add(new CWhoAmI("whoami", "give information about yourself. syntax: !whoami.", "who", Player.Permission.User, 0, false)); - commands.Add(new CList("list", "list active clients syntax: !list.", "l", Player.Permission.Moderator, 0, false)); - commands.Add(new CHelp("help", "list all available commands. syntax: !help.", "h", Player.Permission.User, 0, false)); - commands.Add(new CFastRestart("fastrestart", "fast restart current map. syntax: !fastrestart.", "fr", Player.Permission.Moderator, 0, false)); - commands.Add(new CMapRotate("maprotate", "cycle to the next map in rotation. syntax: !maprotate.", "mr", Player.Permission.Administrator, 0, false)); - commands.Add(new CSetLevel("setlevel", "set player to specified administration level. syntax: !setlevel .", "sl", Player.Permission.Owner, 2, true)); - commands.Add(new CUsage("usage", "get current application memory usage. syntax: !usage.", "us", Player.Permission.Moderator, 0, false)); - commands.Add(new CUptime("uptime", "get current application running time. syntax: !uptime.", "up", Player.Permission.Moderator, 0, false)); - commands.Add(new Cwarn("warn", "warn player for infringing rules syntax: !warn .", "w", Player.Permission.Trusted, 2, true)); - commands.Add(new CWarnClear("warnclear", "remove all warning for a player syntax: !warnclear .", "wc", Player.Permission.Trusted, 1, true)); - commands.Add(new CUnban("unban", "unban player by database id. syntax: !unban @.", "ub", Player.Permission.SeniorAdmin, 1, true)); - commands.Add(new CListAdmins("admins", "list currently connected admins. syntax: !admins.", "a", Player.Permission.User, 0, false)); - commands.Add(new CLoadMap("map", "change to specified map. syntax: !map", "m", Player.Permission.Administrator, 1, false)); - commands.Add(new CFindPlayer("find", "find player in database. syntax: !find ", "f", Player.Permission.SeniorAdmin, 1, false)); - commands.Add(new CListRules("rules", "list server rules. syntax: !rules", "r", Player.Permission.User, 0, false)); - commands.Add(new CPrivateMessage("privatemessage", "send message to other player. syntax: !pm ", "pm", Player.Permission.User, 2, true)); - commands.Add(new CFlag("flag", "flag a suspicious player and announce to admins on join . syntax !flag :", "flag", Player.Permission.Moderator, 2, true)); - commands.Add(new CReport("report", "report a player for suspicious behaivor. syntax !report ", "rep", Player.Permission.User, 2, true)); - commands.Add(new CListReports("reports", "get most recent reports. syntax !reports", "reports", Player.Permission.Moderator, 0, false)); - commands.Add(new CMask("mask", "hide your online presence from online admin list. syntax: !mask", "mask", Player.Permission.Administrator, 0, false)); - commands.Add(new CListBanInfo("baninfo", "get information about a ban for a player. syntax: !baninfo ", "bi", Player.Permission.Moderator, 1, true)); - commands.Add(new CListAlias("alias", "get past aliases and ips of a player. syntax: !alias ", "known", Player.Permission.Moderator, 1, true)); - commands.Add(new CExecuteRCON("rcon", "send rcon command to server. syntax: !rcon ", "rcon", Player.Permission.Owner, 1, false)); - commands.Add(new CFindAllPlayers("findall", "find a player by their aliase(s). syntax: !findall ", "fa", Player.Permission.Moderator, 1, false)); - commands.Add(new CPlugins("plugins", "view all loaded plugins. syntax: !plugins", "p", Player.Permission.Administrator, 0, false)); } //Returns current server IP set by `net_ip` -- *STRING* @@ -287,7 +248,7 @@ namespace SharedLibrary /// protected void InitializeMaps() { - maps = new List(); + Maps = new List(); IFile mapfile = new IFile("config/maps.cfg"); String[] _maps = mapfile.ReadAllLines(); @@ -300,7 +261,7 @@ namespace SharedLibrary if (m2.Length > 1) { Map map = new Map(m2[0].Trim(), m2[1].Trim()); - maps.Add(map); + Maps.Add(map); } } } @@ -314,7 +275,7 @@ namespace SharedLibrary /// protected void InitializeAutoMessages() { - messages = new List(); + BroadcastMessages = new List(); IFile messageCFG = new IFile("config/messages.cfg"); String[] lines = messageCFG.ReadAllLines(); @@ -329,15 +290,15 @@ namespace SharedLibrary int mTime = -1; int.TryParse(lines[0], out mTime); - if (messageTime == -1) - messageTime = 60; + if (MessageTime == -1) + MessageTime = 60; else - messageTime = mTime; + MessageTime = mTime; foreach (String l in lines) { if (lines[0] != l && l.Length > 1) - messages.Add(l); + BroadcastMessages.Add(l); } messageCFG.Close(); @@ -352,7 +313,7 @@ namespace SharedLibrary /// protected void InitializeRules() { - rules = new List(); + Rules = new List(); IFile ruleFile = new IFile("config/rules.cfg"); String[] _rules = ruleFile.ReadAllLines(); @@ -362,7 +323,7 @@ namespace SharedLibrary foreach (String r in _rules) { if (r.Length > 1) - rules.Add(r); + Rules.Add(r); } } else @@ -376,55 +337,39 @@ namespace SharedLibrary return $"{IP}_{Port}"; } - /// - /// Load up the built in commands - /// - public void InitializeCommands() - { - foreach (Command C in Plugins.PluginImporter.ActiveCommands) - Manager.GetCommands().Add(C); - } - - //Objects + // Objects public Interfaces.IManager Manager { get; protected set; } public Interfaces.ILogger Logger { get; private set; } - public Player owner; - public List maps; - public List rules; - public Queue events; - public String Website; - public String Gametype; - public int totalKills = 0; - public List Reports; - public List ChatHistory; + public ServerConfiguration Config { get; private set; } + public List Maps { get; protected set; } + public List Rules { get; protected set; } + public List Reports { get; set; } + public List ChatHistory { get; protected set; } public Queue PlayerHistory { get; private set; } - protected int ConnectionErrors; - protected DateTime LastPoll; - - //Info - protected String IP; - protected int Port; - public String Hostname { get; protected set; } + // Info + public string Hostname { get; protected set; } + public string Website { get; protected set; } + public string Gametype { get; protected set; } public Map CurrentMap { get; protected set; } - protected string FSGame; public int ClientNum { get; protected set; } public int MaxClients { get; protected set; } public List Players { get; protected set; } - protected List messages; - protected int messageTime; - protected TimeSpan lastMessage; - protected DateTime lastPoll; - protected int nextMessage; - - protected DateTime lastWebChat; public string Password { get; private set; } - protected IFile logFile; - // Log stuff - protected String Mod; + // Internal + protected string IP; + protected int Port; + protected string FSGame; + protected int MessageTime; + protected int NextMessage; + protected int ConnectionErrors; + protected List BroadcastMessages; + protected TimeSpan LastMessage; + protected IFile LogFile; + protected DateTime LastPoll; //Remote - public Queue commandResult = new Queue(); + public Queue commandResult = new Queue(); } } diff --git a/SharedLibrary/ServerConfiguration.cs b/SharedLibrary/ServerConfiguration.cs new file mode 100644 index 000000000..5e8b6f7d9 --- /dev/null +++ b/SharedLibrary/ServerConfiguration.cs @@ -0,0 +1,18 @@ +using SharedLibrary.Interfaces; + +namespace SharedLibrary +{ + public class ServerConfiguration : Serialize + { + public string IP; + public int Port; + public string Password; + public string FtpPrefix; + public bool AllowMultipleOwners; + + public override string Filename() + { + return $"config/servers/{IP}_{Port}.cfg"; + } + } +} diff --git a/SharedLibrary/SharedLibrary.csproj b/SharedLibrary/SharedLibrary.csproj index af6638ce1..672cbd65c 100644 --- a/SharedLibrary/SharedLibrary.csproj +++ b/SharedLibrary/SharedLibrary.csproj @@ -93,6 +93,7 @@ + diff --git a/SharedLibrary/Utilities.cs b/SharedLibrary/Utilities.cs index ebd518f7c..2287e33ae 100644 --- a/SharedLibrary/Utilities.cs +++ b/SharedLibrary/Utilities.cs @@ -72,11 +72,9 @@ namespace SharedLibrary { String lookingFor = str.ToLower(); - for (Player.Permission Perm = Player.Permission.User; Perm < Player.Permission.Owner; Perm++) - { + for (Player.Permission Perm = Player.Permission.User; Perm < Player.Permission.Console; Perm++) if (lookingFor.Contains(Perm.ToString().ToLower())) return Perm; - } return Player.Permission.Banned; }