1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

-added back player history graphs (past 12 hours every 15 minutes)

-fixed issue with configurationmanager files and threading
-servers on webfront listed in descending player count
-fixed resolution of tempban times from console feedback
-Added tests plugin to simulate functionality
This commit is contained in:
RaidMax
2017-09-27 15:07:43 -05:00
parent 9227335d25
commit 8d52d7ddc5
21 changed files with 470 additions and 127 deletions

View File

@ -1,35 +1,38 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
namespace SharedLibrary.Helpers
{
public class ConfigurationManager
{
Dictionary<string, Dictionary<string, object>> ConfigurationSet;
ConcurrentDictionary<string, Dictionary<string, object>> ConfigurationSet;
Type PluginType;
public ConfigurationManager(Type PluginType)
{
ConfigurationSet = new Dictionary<string, Dictionary<string, object>>();
ConfigurationSet = new ConcurrentDictionary<string, Dictionary<string, object>>();
this.PluginType = PluginType;
}
public void AddConfiguration(Server S)
{
/* if (ConfigurationSet.ContainsKey(S.ToString()))
{
S.Logger.WriteWarning($"not adding server configuration for {S} as it already exists");
return;
}*/
try
{
var Config = Interfaces.Serialize<Dictionary<string, object>>.Read($"config/{PluginType.ToString()}_{S.ToString()}.cfg");
lock (ConfigurationSet)
{
ConfigurationSet.Add(S.ToString(), Config);
}
ConfigurationSet.TryAdd(S.ToString(), Config);
}
catch (Exceptions.SerializeException)
{
ConfigurationSet.Add(S.ToString(), new Dictionary<string, object>());
ConfigurationSet.TryAdd(S.ToString(), new Dictionary<string, object>());
}
}
public void AddProperty(Server S, KeyValuePair<string, object> Property)