Esempio n. 1
0
        public void LoadTables()
        {
            npcTable = LoadData <NpcTable>("Tables/NpcTable.bytes");
            npcTable.Initialize();
            objectPoolTable = LoadData <ObjectPoolTable>("Tables/ObjectPoolTable.bytes");
            objectPoolTable.Initialize();
///[APPEND_TABLE]
        }
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 LoadTables()
        {
            globalConfigTable = LoadData <GlobalConfigTable>("Tables/GlobalConfigTable.bytes");
            globalConfigTable.Initialize();
            itemTable = LoadData <ItemTable>("Tables/ItemTable.bytes");
            itemTable.Initialize();
            npcTable = LoadData <NpcTable>("Tables/NpcTable.bytes");
            npcTable.Initialize();
            objectPoolTable = LoadData <ObjectPoolTable>("Tables/ObjectPoolTable.bytes");
            objectPoolTable.Initialize();
            qualityTable = LoadData <QualityTable>("Tables/QualityTable.bytes");
            qualityTable.Initialize();
///[APPEND_TABLE]
        }
Esempio n. 4
0
 static int Initialize(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         NpcTable obj = (NpcTable)ToLua.CheckObject <NpcTable>(L, 1);
         obj.Initialize();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }