public EzServer(EzServerSettings settings) { Settings = settings; LogProvider <EzLogger> .Provider.Configure(Settings); _logger = LogProvider <EzLogger> .GetLogger(this); _handlers = new Dictionary <int, IHandler>(); _server = new AsyncEventServer(Settings.ListenIpAddress, Settings.Port, this, Settings.ServerSettings); Clients = new ClientLookup(); Database = new SQLiteDb(settings.DatabaseSettings.SQLitePath); SessionManager = new SessionManager(); }
public NecServer(NecSetting setting) { _running = false; Setting = new NecSetting(setting); NecromancyBot = new NecromancyBot(setting); NecromancyBot.AddSingleton(this); Instances = new InstanceGenerator(); Instances64 = new InstanceGenerator64(); Clients = new ClientLookup(); Characters = new CharacterLookup(); Maps = new MapLookup(); Chat = new ChatManager(this); Router = new PacketRouter(); Database = new NecDatabaseBuilder().Build(Setting.DatabaseSettings); SettingRepository = new SettingRepository(Setting.RepositoryFolder).Initialize(); _authConsumer = new NecQueueConsumer(ServerType.Auth, Setting, Setting.AuthSocketSettings); _authConsumer.ClientDisconnected += AuthClientDisconnected; _msgConsumer = new NecQueueConsumer(ServerType.Msg, Setting, Setting.MsgSocketSettings); _msgConsumer.ClientDisconnected += MsgClientDisconnected; _areaConsumer = new NecQueueConsumer(ServerType.Area, Setting, Setting.AreaSocketSettings); _areaConsumer.ClientDisconnected += AreaClientDisconnected; _authServer = new AsyncEventServer( Setting.ListenIpAddress, Setting.AuthPort, _authConsumer, Setting.AuthSocketSettings ); _msgServer = new AsyncEventServer( Setting.ListenIpAddress, Setting.MsgPort, _msgConsumer, Setting.MsgSocketSettings ); _areaServer = new AsyncEventServer( Setting.ListenIpAddress, Setting.AreaPort, _areaConsumer, Setting.AreaSocketSettings ); LoadChatCommands(); LoadSettingRepository(); LoadHandler(); LoadCharacterRepository(); }
public NecServer(NecSetting setting) { _running = false; this.setting = new NecSetting(setting); necromancyBot = new NecromancyBot(this.setting); necromancyBot.AddSingleton(this); instances = new InstanceGenerator(this); clients = new ClientLookup(); maps = new MapLookup(); chat = new ChatManager(this); router = new PacketRouter(); settingRepository = new SettingRepository(this.setting.repositoryFolder).Initialize(); database = new NecDatabaseBuilder(this.setting, settingRepository).Build(); _authConsumer = new NecQueueConsumer(ServerType.Auth, this.setting, this.setting.authSocketSettings); _authConsumer.clientDisconnected += AuthClientDisconnected; _msgConsumer = new NecQueueConsumer(ServerType.Msg, this.setting, this.setting.msgSocketSettings); _msgConsumer.clientDisconnected += MsgClientDisconnected; _areaConsumer = new NecQueueConsumer(ServerType.Area, this.setting, this.setting.areaSocketSettings); _areaConsumer.clientDisconnected += AreaClientDisconnected; _authServer = new AsyncEventServer( this.setting.listenIpAddress, this.setting.authPort, _authConsumer, this.setting.authSocketSettings ); _msgServer = new AsyncEventServer( this.setting.listenIpAddress, this.setting.msgPort, _msgConsumer, this.setting.msgSocketSettings ); _areaServer = new AsyncEventServer( this.setting.listenIpAddress, this.setting.areaPort, _areaConsumer, this.setting.areaSocketSettings ); LoadChatCommands(); LoadDatabaseObjects(); LoadHandler(); }
public MhfServer(MhfSetting setting) { Setting = new MhfSetting(setting); LogProvider.Configure <MhfLogger>(Setting); _logger = LogProvider.Logger <MhfLogger>(this); Instances = new InstanceGenerator(); Clients = new ClientLookup(); Router = new PacketRouter(); Database = new MhfDatabaseBuilder().Build(Setting.DatabaseSetting); _authConsumer = new QueueConsumer(Setting, Setting.ServerSocketSettings); _authConsumer.ClientDisconnected += AuthClientDisconnected; _authServer = new AsyncEventServer( Setting.ListenIpAddress, Setting.AuthServerPort, _authConsumer, Setting.ServerSocketSettings ); _lobbyConsumer = new QueueConsumer(Setting, Setting.ServerSocketSettings); _lobbyConsumer.ClientDisconnected += LobbyClientDisconnected; _lobbyServer = new AsyncEventServer( Setting.ListenIpAddress, Setting.LobbyServerPort, _lobbyConsumer, Setting.ServerSocketSettings ); _webServer = new WebServer(Setting, new KestrelWebServer(Setting)); WebFileProvider = new PhysicalFileProvider(Setting.WebSetting.WebFolder); LoadPacketHandler(); LoadWebRoutes(); }
public NecServer(NecSetting setting) { ClientLookup = new ClientLookup(); MapLookup = new MapLookup(); Setting = setting; Router = new PacketRouter(); _authConsumer = new NecQueueConsumer(Setting); _authConsumer.SetIdentity("Auth"); _authConsumer.ClientDisconnected += AuthClientDisconnected; _msgConsumer = new NecQueueConsumer(Setting); _msgConsumer.SetIdentity("Msg"); _msgConsumer.ClientDisconnected += MsgClientDisconnected; _areaConsumer = new NecQueueConsumer(Setting); _areaConsumer.SetIdentity("Area"); _areaConsumer.ClientDisconnected += AreaClientDisconnected; _authServer = new AsyncEventServer( Setting.ListenIpAddress, Setting.AuthPort, _authConsumer ); _msgServer = new AsyncEventServer( Setting.ListenIpAddress, Setting.MsgPort, _msgConsumer ); _areaServer = new AsyncEventServer( Setting.ListenIpAddress, Setting.AreaPort, _areaConsumer ); LoadHandler(); }