protected override void Load() { Instance = this; U.Events.OnPlayerConnected += Events_OnPlayerConnected; if (Instance.Configuration.Instance.Notifications <= 0) { Instance.Configuration.Instance.Notifications = 3; Instance.Configuration.Save(); } Logger.Log("Connecting the database ...", ConsoleColor.DarkGreen); Database = new Database(); if (!Instance.MySQLON) { Logger.Log("To connect to the database, please check the settings!", ConsoleColor.DarkGreen); Logger.Log("Report Plugin has been loaded without MySQL!", ConsoleColor.DarkGreen); if (Instance.Configuration.Instance.LogFile) { File.AppendAllText(ReportLog, "[" + DateTime.Now + "] Report Plugin has been loaded without MySQL!" + System.Environment.NewLine); } } else { Logger.Log("Successful connection!", ConsoleColor.DarkGreen); Logger.Log("Report Plugin has been loaded with MySQL!", ConsoleColor.DarkGreen); if (Instance.Configuration.Instance.LogFile) { File.AppendAllText(ReportLog, "[" + DateTime.Now + "] Report Plugin has been loaded with MySQL!" + System.Environment.NewLine); } } }
protected override void Unload() { Instance = null; U.Events.OnPlayerConnected -= Events_OnPlayerConnected; Logger.Log("Report Plugin has been unloaded!", ConsoleColor.DarkGreen); if (Instance.Configuration.Instance.LogFile) { File.AppendAllText(ReportLog, "[" + DateTime.Now + "] Report Plugin has been unloaded!" + System.Environment.NewLine); } }