diff --git a/Plugins/SimpleStats/Helpers/StatManager.cs b/Plugins/SimpleStats/Helpers/StatManager.cs
index b69778b90..d55a06d41 100644
--- a/Plugins/SimpleStats/Helpers/StatManager.cs
+++ b/Plugins/SimpleStats/Helpers/StatManager.cs
@@ -247,7 +247,7 @@ namespace StatsPlugin.Helpers
//statsSvc.KillStatsSvc.Insert(kill);
//await statsSvc.KillStatsSvc.SaveChangesAsync();
- if (attacker.CurrentServer.Config.EnableAntiCheat)
+ if(Manager.GetApplicationSettings().EnableAntiCheat)
{
async Task executePenalty(Cheat.DetectionPenaltyResult penalty)
{
diff --git a/Plugins/SimpleStats/Plugin.cs b/Plugins/SimpleStats/Plugin.cs
index 189bddeac..b647d5b92 100644
--- a/Plugins/SimpleStats/Plugin.cs
+++ b/Plugins/SimpleStats/Plugin.cs
@@ -92,6 +92,7 @@ namespace StatsPlugin
int deaths = clientStats.Sum(c => c.Deaths);
double kdr = Math.Round(kills / (double)deaths, 2);
double skill = Math.Round(clientStats.Sum(c => c.Skill) / clientStats.Count, 2);
+ double spm = Math.Round(clientStats.Sum(c => c.SPM), 1);
double chestRatio = 0;
double abdomenRatio = 0;
@@ -135,6 +136,11 @@ namespace StatsPlugin
Value = skill
},
new ProfileMeta()
+ {
+ Key = "Score Per Minute",
+ Value = spm
+ },
+ new ProfileMeta()
{
Key = "Chest Ratio",
Value = chestRatio,
diff --git a/Plugins/SimpleStats/StatsPlugin.csproj b/Plugins/SimpleStats/StatsPlugin.csproj
index b7eefa518..9b478c4c3 100644
--- a/Plugins/SimpleStats/StatsPlugin.csproj
+++ b/Plugins/SimpleStats/StatsPlugin.csproj
@@ -150,7 +150,11 @@
SharedLibrary
-
+
+
+ 1.1.2
+
+
copy /Y "$(TargetDir)$(TargetName).dll" "$(SolutionDir)BUILD\plugins\"
diff --git a/SharedLibrary/Commands/NativeCommands.cs b/SharedLibrary/Commands/NativeCommands.cs
index 32cb62d34..9b3a9b69f 100644
--- a/SharedLibrary/Commands/NativeCommands.cs
+++ b/SharedLibrary/Commands/NativeCommands.cs
@@ -424,9 +424,9 @@ 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)
+ if (newPerm == Player.Permission.Owner && !E.Owner.Manager.GetApplicationSettings().EnableMultipleOwners)
{
- await E.Origin.Tell("There can only be 1 owner. Modify your server configuration if multiple owners are required");
+ await E.Origin.Tell("There can only be 1 owner. Modify your appsettings if multiple owners are required");
return;
}
@@ -1033,13 +1033,15 @@ namespace SharedLibrary.Commands
#endif
process.StartInfo.FileName = $"{process.StartInfo.WorkingDirectory}\\iw4x.exe";
process.StartInfo.Arguments = commandLine.Substring(6);
- process.StartInfo.UserName = E.Owner.Config.RestartUsername;
+
+ /*process.StartInfo.UserName = E.Owner.ServerConfig.RestartUsername;
var pw = new System.Security.SecureString();
- foreach (char c in E.Owner.Config.RestartPassword)
+ foreach (char c in E.Owner.ServerConfig.RestartPassword)
pw.AppendChar(c);
process.StartInfo.Password = pw;
+ */
process.Start();
}
diff --git a/SharedLibrary/Configuration/ApplicationConfiguration.cs b/SharedLibrary/Configuration/ApplicationConfiguration.cs
new file mode 100644
index 000000000..2ff91c838
--- /dev/null
+++ b/SharedLibrary/Configuration/ApplicationConfiguration.cs
@@ -0,0 +1,17 @@
+using System.Collections.Generic;
+
+namespace SharedLibrary.Configuration
+{
+ public class ApplicationConfiguration
+ {
+ public bool EnableMultipleOwners { get; set; }
+ public bool EnableTrustedRank { get; set; }
+ public bool EnableClientVPNs { get; set; }
+ public bool EnableAntiCheat { get; set; }
+ public bool EnableDiscordLink { get; set; }
+ public string DiscordInviteCode { get; set; }
+ public string IPHubAPIKey { get; set; }
+ public List Servers { get; set; }
+
+ }
+}
diff --git a/SharedLibrary/Configuration/ServerConfiguration.cs b/SharedLibrary/Configuration/ServerConfiguration.cs
new file mode 100644
index 000000000..922f406c3
--- /dev/null
+++ b/SharedLibrary/Configuration/ServerConfiguration.cs
@@ -0,0 +1,9 @@
+namespace SharedLibrary.Configuration
+{
+ public class ServerConfiguration
+ {
+ public string IPAddress { get; set; }
+ public short Port { get; set; }
+ public string Password { get; set; }
+ }
+}
diff --git a/SharedLibrary/Interfaces/IManager.cs b/SharedLibrary/Interfaces/IManager.cs
index f0e6aab33..421592e8c 100644
--- a/SharedLibrary/Interfaces/IManager.cs
+++ b/SharedLibrary/Interfaces/IManager.cs
@@ -3,6 +3,8 @@ using SharedLibrary.Objects;
using SharedLibrary.Database.Models;
using SharedLibrary.Services;
using System.Threading.Tasks;
+using Microsoft.Extensions.Configuration;
+using SharedLibrary.Configuration;
namespace SharedLibrary.Interfaces
{
@@ -16,6 +18,7 @@ namespace SharedLibrary.Interfaces
IList GetCommands();
IList GetMessageTokens();
IList GetActiveClients();
+ ApplicationConfiguration GetApplicationSettings();
ClientService GetClientService();
AliasService GetAliasService();
PenaltyService GetPenaltyService();
diff --git a/SharedLibrary/Server.cs b/SharedLibrary/Server.cs
index aebc96a2a..897f10ba9 100644
--- a/SharedLibrary/Server.cs
+++ b/SharedLibrary/Server.cs
@@ -11,6 +11,7 @@ using System.Threading.Tasks;
using SharedLibrary.Helpers;
using SharedLibrary.Objects;
using SharedLibrary.Dtos;
+using SharedLibrary.Configuration;
namespace SharedLibrary
{
@@ -30,11 +31,11 @@ namespace SharedLibrary
public Server(Interfaces.IManager mgr, ServerConfiguration config)
{
Password = config.Password;
- IP = config.IP;
+ IP = config.IPAddress;
Port = config.Port;
Manager = mgr;
Logger = Manager.GetLogger();
- Config = config;
+ ServerConfig = config;
Players = new List(new Player[18]);
Reports = new List();
@@ -360,7 +361,7 @@ namespace SharedLibrary
// Objects
public Interfaces.IManager Manager { get; protected set; }
public Interfaces.ILogger Logger { get; private set; }
- public ServerConfiguration Config { get; private set; }
+ public ServerConfiguration ServerConfig { get; private set; }
public List