protected /*override*/ void OnEnable() { //Context.Server.UserManager = new UserManager<MiNET.Security.User>(new DefaultUserStore()); //Please do not use the default level /*if(_notdefaultlevel = Context.LevelManager.Levels.Count != 0) * { * foreach (var level in Context.LevelManager.Levels){ * level.BlockBreak += OnBreak; * level.BlockPlace += OnPlace; * } * }*/ //BanManager = new BanManager (); //Context.Server.PlayerFactory = new PlayerFactoryAuthME(); var server = Context.Server; server.LevelManager.LevelCreated += (sender, args) => { Level level = args.Level; level.BlockBreak += OnBreak; level.BlockPlace += OnPlace; }; server.PlayerFactory.PlayerCreated += (sender, args) => { Player player = args.Player; player.PlayerJoin += OnPlayerJoin; player.PlayerLeave += OnPlayerLeave; }; var instance = new BanManager(this, Context); Context.PluginManager.LoadPacketHandlers(instance); Context.PluginManager.LoadCommands(instance); Database = new Database(); Database.open(); LangManager = new LangManager(); LangManager.addLang("eng", new Lang("eng", MiNET.Utils.Config.GetProperty("PluginDirectory", "plugins") + "/lang/AuthME/eng.ini")); //LangManager.addLang("por", new Lang("eng", MiNET.Utils.Config.GetProperty ("PluginDirectory", "plugins") + "\\lang\\AuthME\\por.ini")); //LangManager.addLang("rus", new Lang("rus", MiNET.Utils.Config.GetProperty ("PluginDirectory", "plugins") + "\\lang\\AuthME\\rus.ini")); Log.Info("AuthME Enable"); }
public void OnEnable(xCoreGames core, PluginContext context) { Core = core; Context = context; var instance = new AccountManager(this); Context.PluginManager.LoadCommands(instance); Context.PluginManager.LoadCommands(this); AccManager = instance; Log.Info("[Cristalix] BanManager enabled"); Database = new Database(this); Database.Open(); Log.Info("[Cristalix] The database is running"); Lang = new LangManager(this); Lang.addLang("eng", new Lang("eng", Config.GetProperty("PluginDirectory", "Plugins") + "\\lang\\AuthME\\eng.ini")); //Lang.addLang("por", new Lang("por", Config.GetProperty ("PluginDirectory", "Plugins") + "\\lang\\AuthME\\por.ini")); Lang.addLang("rus", new Lang("rus", Config.GetProperty("PluginDirectory", "Plugins") + "\\lang\\AuthME\\rus.ini")); Log.Info("[Cristalix] LangManager enabled"); //DynManager = new DynamicManager(core); Log.Info("[Cristalix] DynamicManager enabled"); Log.Info("[Cristalix] AuthME enabled"); }