Esempio n. 1
0
        public void Start()
        {
            Config.Config.Instance.Initialize();

            PreReqValidation.Instance.Initialize();

            CharTemplateTable.Instance.Initialize();

            NetworkBlock.Instance.Initialize();
            GameTime.Instance.Initialize();

            IdFactory.Instance.Initialize();

            L2World.Instance.Initialize();

            MapRegionTable.Instance.Initialize();
            ZoneTable.Instance.Initialize();

            ItemTable.Instance.Initialize();
            ItemHandler.Instance.Initialize();

            NpcTable.Instance.Initialize();
            MultiSell.Instance.Initialize();
            Capsule.Instance.Initialize();
            RecipeTable.Instance.Initialize();

            BlowFishKeygen.GenerateKeys();

            AdminCommandHandler.Instance.Initialize();

            AnnouncementManager.Instance.Initialize();

            StaticObjTable.Instance.Initialize();
            SpawnTable.Instance.Initialize();

            HtmCache.Instance.Initialize();

            // PluginManager.Instance.Initialize(this);

            AuthThread.Instance.Initialize();

            _listener = new TcpListener(IPAddress.Any, Config.Config.Instance.ServerConfig.Port);

            try
            {
                _listener.Start();
            }
            catch (SocketException ex)
            {
                Log.Error($"Socket Error: '{ex.SocketErrorCode}'. Message: '{ex.Message}' (Error Code: '{ex.NativeErrorCode}')");
                Log.Info("Press ENTER to exit...");
                Console.Read();
                Environment.Exit(0);
            }

            Log.Info($"Listening Gameservers on port {Config.Config.Instance.ServerConfig.Port}");

            WaitForClients();
        }
Esempio n. 2
0
        public async void Start()
        {
            Config.Config config = ServiceProvider.GetService <Config.Config>();
            await config.Initialise();

            await ServiceProvider.GetService <PreReqValidation>().Initialise();

            CharTemplateTable.Initialize();

            // TODO: refactor NetworkBlock
            NetworkBlock.Instance.Initialize();
            GameTime.Initialize();

            await ServiceProvider.GetService <IdFactory>().Initialise();

            L2World.Initialize();

            MapRegionTable.Initialize();
            ZoneTable.Initialize();

            await ServiceProvider.GetService <ItemTable>().Initialise();

            ItemHandler.Initialize();

            NpcTable.Initialize();
            Capsule.Initialize();
            AttackStanceManager.Initialize();
            BlowFishKeygen.GenerateKeys();

            await ServiceProvider.GetService <IAdminCommandHandler>().Initialise();

            await ServiceProvider.GetService <AnnouncementManager>().Initialise();

            StaticObjTable.Initialize();
            await ServiceProvider.GetService <SpawnTable>().Initialise();

            await ServiceProvider.GetService <HtmCache>().Initialise();

            // TODO: review plugin system
            //PluginManager.Instance.Initialize(this);

            ServiceProvider.GetService <AuthThread>().Initialise();

            _listener = new TcpListener(IPAddress.Any, config.ServerConfig.Port);

            try
            {
                _listener.Start();
            }
            catch (SocketException ex)
            {
                Log.Halt($"Socket Error: '{ex.SocketErrorCode}'. Message: '{ex.Message}' (Error Code: '{ex.NativeErrorCode}')");
            }

            Log.Info($"Listening Gameservers on port {config.ServerConfig.Port}");

            Task.Factory.StartNew(WaitForClients);
        }
Esempio n. 3
0
        public void Start()
        {
            var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());

            XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));

            var config = ServiceProvider.GetService <Config.Config>();

            config.Initialise();

            ServiceProvider.GetService <PreReqValidation>().Initialise();

            CharTemplateTable.Instance.Initialize();

            NetworkBlock.Instance.Initialize();
            GameTime.Instance.Initialize();

            ServiceProvider.GetService <IdFactory>().Initialise();

            L2World.Instance.Initialize();

            MapRegionTable.Instance.Initialize();
            ZoneTable.Instance.Initialize();

            ServiceProvider.GetService <ItemTable>().Initialise();
            ItemHandler.Instance.Initialize();

            NpcTable.Instance.Initialize();
            Capsule.Instance.Initialize();

            BlowFishKeygen.GenerateKeys();

            ServiceProvider.GetService <IAdminCommandHandler>().Initialise();

            ServiceProvider.GetService <AnnouncementManager>().Initialise();

            StaticObjTable.Instance.Initialize();
            ServiceProvider.GetService <SpawnTable>().Initialise();

            ServiceProvider.GetService <HtmCache>().Initialise();

            // PluginManager.Instance.Initialize(this);

            ServiceProvider.GetService <AuthThread>().Initialise();

            _listener = new TcpListener(IPAddress.Any, config.ServerConfig.Port);

            try
            {
                _listener.Start();
            }
            catch (SocketException ex)
            {
                Log.Error($"Socket Error: '{ex.SocketErrorCode}'. Message: '{ex.Message}' (Error Code: '{ex.NativeErrorCode}')");
                Log.Info("Press ENTER to exit...");
                Console.Read();
                Environment.Exit(0);
            }

            Log.Info($"Listening Gameservers on port {config.ServerConfig.Port}");

            WaitForClients();
        }
Esempio n. 4
0
        public void Start()
        {
            Console.Title = "L2dotNET Gameserver";

            CLogger.form();
            Cfg.init("all");

            CharTemplateTable.Instance.Initialize();

            NetworkBlock.Instance.Initialize();
            GameTime.Instance.Initialize();

            IdFactory.Instance.Initialize();

            L2World.Instance.Initialize();

            MapRegionTable.Instance.Initialize();
            ZoneTable.Instance.Initialize();

            NpcTable.Instance.Initialize();
            NpcData.getInstance();
            //  SpawnTable.getInstance();

            //  TSkillTable.getInstance();
            ItemTable.getInstance();
            ItemHandler.getInstance();
            MultiSell.getInstance();
            Capsule.getInstance();
            RecipeTable.getInstance();

            AIManager.getInstance();

            BlowFishKeygen.GenerateKeys();
            CLogger.info("Generated 20 Blowfish Keys");

            AdminAccess.Instance.Initialize();;

            QuestManager.getInstance();

            AnnouncementManager.Instance.Initialize();

            AllianceTable.getInstance();
            ClanTable.getInstance();

            CLogger.info("NpcServer: ");
            StaticObjTable.Instance.Initialize();
            MonsterRace.Instance.Initialize();
            //  SpawnTable.getInstance().Spawn();
            StructureTable.Instance.Initialize();

            HtmCache.Instance.Initialize();

            AuthThread.Instance.Initialize();

            //   GeoData.getInstance();

            CLogger.extra_info("Listening Gameservers on port " + Cfg.SERVER_PORT);
            _listener = new TcpListener(IPAddress.Any, Cfg.SERVER_PORT);
            _listener.Start();

            TcpClient clientSocket = default(TcpClient);

            while (true)
            {
                clientSocket = _listener.AcceptTcpClient();
                Accept(clientSocket);
            }
        }