Exemple #1
0
 public override void Initialize()
 {
     base.Initialize();
     base.ConsoleInterface        = new WorldConsole();
     this.VirtualConsoleInterface = new WorldVirtualConsole();
     ConsoleBase.SetTitle("#Stump World Server : " + WorldServer.ServerInformation.Name);
     this.logger.Info("Initializing Database...");
     base.DBAccessor = new DatabaseAccessor(WorldServer.DatabaseConfiguration);
     base.DBAccessor.RegisterMappingAssembly(System.Reflection.Assembly.GetExecutingAssembly());
     base.InitializationManager.Initialize(InitializationPass.Database);
     base.DBAccessor.Initialize();
     this.logger.Info("Opening Database...");
     base.DBAccessor.OpenConnection();
     DataManager.DefaultDatabase   = base.DBAccessor.Database;
     DataManagerAllocator.Assembly = System.Reflection.Assembly.GetExecutingAssembly();
     this.logger.Info("Register Messages...");
     MessageReceiver.Initialize();
     ProtocolTypeManager.Initialize();
     this.logger.Info("Register Packet Handlers...");
     this.HandlerManager = Singleton <WorldPacketHandler> .Instance;
     this.HandlerManager.RegisterAll(System.Reflection.Assembly.GetExecutingAssembly());
     this.logger.Info("Register Commands...");
     base.CommandManager.RegisterAll(System.Reflection.Assembly.GetExecutingAssembly());
     base.InitializationManager.InitializeAll();
     base.IsInitialized = true;
 }
Exemple #2
0
        public override void Initialize()
        {
            try
            {
                base.Initialize();
                ConsoleInterface = new AuthConsole();
                ConsoleBase.SetTitle($"#Stump Authentification Server - {Version}");

                logger.Info("Initializing Database...");
                DBAccessor = new DatabaseAccessor(DatabaseConfiguration);
                DBAccessor.RegisterMappingAssembly(Assembly.GetExecutingAssembly());
                InitializationManager.Initialize(InitializationPass.Database);
                DBAccessor.Initialize();

                logger.Info("Opening Database...");
                DBAccessor.OpenConnection();
                DataManager.DefaultDatabase   = DBAccessor.Database;
                DataManagerAllocator.Assembly = Assembly.GetExecutingAssembly();

                logger.Info("Register Messages...");
                MessageReceiver.Initialize();
                ProtocolTypeManager.Initialize();

                logger.Info("Register Packets Handlers...");
                HandlerManager = AuthPacketHandler.Instance;
                HandlerManager.RegisterAll(Assembly.GetExecutingAssembly());

                logger.Info("Register Commands...");
                CommandManager.RegisterAll(Assembly.GetExecutingAssembly());

                logger.Info("Start World Servers Manager");
                WorldServerManager.Instance.Initialize();

                logger.Info("Initialize Account Manager");
                AccountManager.Instance.Initialize();

                logger.Info("Initialize IPC Server..");
                IpcHost = new IPCHost(IpcAddress, IpcPort);

                InitializationManager.InitializeAll();
                IsInitialized = true;

                if (Environment.GetCommandLineArgs().Contains("-maintenance"))
                {
                    m_maintenanceMode = true;
                }
            }
            catch (Exception ex)
            {
                HandleCrashException(ex);
                Shutdown();
            }
        }
Exemple #3
0
        public override void Initialize()
        {
            base.Initialize();
            ConsoleInterface        = new WorldConsole();
            VirtualConsoleInterface = new WorldVirtualConsole();
            ConsoleBase.SetTitle($"#Stump World Server - {Version} : {ServerInformation.Name}");

            logger.Info("Initializing Database...");
            DBAccessor = new DatabaseAccessor(DatabaseConfiguration);
            DBAccessor.RegisterMappingAssembly(Assembly.GetExecutingAssembly());

            foreach (var plugin in PluginManager.Instance.GetPlugins())
            {
                DBAccessor.RegisterMappingAssembly(plugin.PluginAssembly);
            }

            InitializationManager.Initialize(InitializationPass.Database);
            DBAccessor.Initialize();

            logger.Info("Opening Database...");
            DBAccessor.OpenConnection();
            DataManager.DefaultDatabase           = DBAccessor.Database;
            DataManagerAllocator.Assembly         = Assembly.GetExecutingAssembly();
            DBAccessor.Database.ExecutingCommand += OnExecutingDBCommand;

            logger.Info("Register Messages...");
            MessageReceiver.Initialize();
            ProtocolTypeManager.Initialize();

            logger.Info("Register Packet Handlers...");
            HandlerManager = WorldPacketHandler.Instance;
            HandlerManager.RegisterAll(Assembly.GetExecutingAssembly());

            logger.Info("Register Commands...");
            CommandManager.RegisterAll(Assembly.GetExecutingAssembly());

            InitializationManager.InitializeAll();
            CommandManager.LoadOrCreateCommandsInfo(CommandsInfoFilePath);
            IsInitialized = true;
        }
Exemple #4
0
        public override void Initialize()
        {
            try
            {
                base.Initialize();
                base.ConsoleInterface = new AuthConsole();
                ConsoleBase.SetTitle("#Stump Authentification Server");
                this.logger.Info("Initializing Database...");
                base.DBAccessor = new DatabaseAccessor(AuthServer.DatabaseConfiguration);
                base.DBAccessor.RegisterMappingAssembly(Assembly.GetExecutingAssembly());
                base.DBAccessor.Initialize();
                this.logger.Info("Opening Database...");
                base.DBAccessor.OpenConnection();
                DataManagerAllocator.Assembly = System.Reflection.Assembly.GetExecutingAssembly();
                DataManager.DefaultDatabase   = base.DBAccessor.Database;
                this.logger.Info("Register Messages...");
                MessageReceiver.Initialize();
                ProtocolTypeManager.Initialize();
                this.logger.Info("Register Packets Handlers...");
                this.HandlerManager = Singleton <AuthPacketHandler> .Instance;
                this.HandlerManager.RegisterAll(Assembly.GetExecutingAssembly());
                this.logger.Info("Register Commands...");
                base.CommandManager.RegisterAll(Assembly.GetExecutingAssembly());
                this.logger.Info("Start World Servers Manager");
                Singleton <WorldServerManager> .Instance.Initialize();

                this.logger.Info("Initialize IPC Server..");
                IPCHost.Instance.Initialize();
                base.InitializationManager.InitializeAll();
                base.IsInitialized = true;
            }
            catch (Exception ex)
            {
                base.HandleCrashException(ex);
                base.Shutdown();
            }
        }