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:
@ -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)
|
||||
|
Reference in New Issue
Block a user