public override void Initialize() { Logger.LogDebug(ConsolePrefix + " Loading..."); string ConfigFile = Path.Combine(ModuleFolder, "Anticheat.cfg"); if(File.Exists(ConfigFile)) INIConfig = new IniParser(ConfigFile); else { Logger.LogError("Anticheat.cfg does not exist. Can't load module."); return; } DS = DataStore.GetInstance(); DS.Flush("loginCooldown"); ConfigInit(); TimersInit(); Hooks.OnEntityDecay += EntityDecay; Hooks.OnDoorUse += DoorUse; Hooks.OnEntityHurt += EntityHurt; Hooks.OnPlayerConnected += PlayerConnect; Hooks.OnPlayerDisconnected += PlayerDisconnect; Hooks.OnPlayerHurt += PlayerHurt; Hooks.OnPlayerSpawned += PlayerSpawned; if (AntiAIM_Enabled) Hooks.OnPlayerKilled += PlayerKilled; Hooks.OnServerShutdown += ServerShutdown; Hooks.OnShowTalker += ShowTalker; Hooks.OnChat += Chat; Logger.LogDebug(ConsolePrefix + " Loaded!"); }
public static DataStore GetInstance() { Contract.Ensures(Contract.Result<DataStore>() != null); if (instance == null) { instance = new DataStore(); } return instance; }