/// <summary> /// Initializes a new instance of the <see cref="ClientPacketHandler" /> class. /// </summary> /// <param name="connectServer">The connect server.</param> /// <param name="loggerFactory">The logger factory.</param> public ClientPacketHandler(IConnectServer connectServer, ILoggerFactory loggerFactory) { this.logger = loggerFactory.CreateLogger <ClientPacketHandler>(); this.connectServerSettings = connectServer.Settings; this.packetHandlers.Add(0x05, new FtpRequestHandler(connectServer.Settings, loggerFactory.CreateLogger <FtpRequestHandler>())); this.packetHandlers.Add(0xF4, new ServerListHandler(connectServer, loggerFactory)); }
/// <summary> /// Initializes a new instance of the <see cref="ClientListener"/> class. /// </summary> /// <param name="connectServer">The connect server.</param> public ClientListener(IConnectServer connectServer) { this.connectServerSettings = connectServer.Settings; this.packetHandler = new ClientPacketHandler(connectServer); this.Clients = new List <Client>(); this.ClientSocketAcceptPlugins = new List <IAfterSocketAcceptPlugin>(); this.ClientSocketDisconnectPlugins = new List <IAfterDisconnectPlugin>(); }
/// <summary> /// Initializes a new instance of the <see cref="ServerListHandler"/> class. /// </summary> /// <param name="connectServer">The connect server.</param> public ServerListHandler(IConnectServer connectServer) { this.connectServerSettings = connectServer.Settings; this.packetHandlers.Add(0x03, new ServerInfoRequestHandler(connectServer)); this.packetHandlers.Add(0x06, new ServerListRequestHandler(connectServer)); // old protocol: this.packetHandlers.Add(0x02, new ServerListRequestHandler(connectServer)); }
/// <summary> /// Initializes a new instance of the <see cref="ServerListHandler" /> class. /// </summary> /// <param name="connectServer">The connect server.</param> /// <param name="loggerFactory">The logger factory.</param> public ServerListHandler(IConnectServer connectServer, ILoggerFactory loggerFactory) { this.logger = loggerFactory.CreateLogger <ServerListHandler>(); this.connectServerSettings = connectServer.Settings; this.packetHandlers.Add(0x03, new ServerInfoRequestHandler(connectServer, loggerFactory.CreateLogger <ServerInfoRequestHandler>())); this.packetHandlers.Add(0x06, new ServerListRequestHandler(connectServer, loggerFactory.CreateLogger <ServerListRequestHandler>())); // old protocol: this.packetHandlers.Add(0x02, new ServerListRequestHandler(connectServer, loggerFactory.CreateLogger <ServerListRequestHandler>())); }
/// <summary> /// Initializes a new instance of the <see cref="ClientListener" /> class. /// </summary> /// <param name="connectServer">The connect server.</param> /// <param name="loggerFactory">The logger factory.</param> public ClientListener(IConnectServer connectServer, ILoggerFactory loggerFactory) { this.loggerFactory = loggerFactory; this.connectServerSettings = connectServer.Settings; this.logger = this.loggerFactory.CreateLogger <ClientListener>(); this.packetHandler = new ClientPacketHandler(connectServer, loggerFactory); this.Clients = new List <Client>(); this.ClientSocketAcceptPlugins = new List <IAfterSocketAcceptPlugin>(); this.ClientSocketDisconnectPlugins = new List <IAfterDisconnectPlugin>(); }
/// <summary> /// Initializes a new instance of the <see cref="ConnectServer" /> class. /// </summary> /// <param name="connectServerSettings">The settings.</param> /// <param name="stateObserver">The state observer.</param> public ConnectServer(IConnectServerSettings connectServerSettings, IServerStateObserver stateObserver) { this.stateObserver = stateObserver; this.Settings = connectServerSettings; this.ConnectInfos = new Dictionary <ushort, byte[]>(); this.ServerList = new ServerList(); this.ClientListener = new ClientListener(this); this.ClientListener.ConnectedClientsChanged += (sender, args) => this.stateObserver.PlayerCountChanged(this.Id, this.CurrentConnections); this.CreatePlugins(); }
/// <summary> /// Initializes a new instance of the <see cref="ConnectServer" /> class. /// </summary> /// <param name="connectServerSettings">The settings.</param> /// <param name="clientVersion">The client version.</param> /// <param name="configurationId">The configuration identifier.</param> public ConnectServer(IConnectServerSettings connectServerSettings, ClientVersion clientVersion, Guid configurationId) { this.ClientVersion = clientVersion; this.ConfigurationId = configurationId; this.Settings = connectServerSettings; this.ConnectInfos = new Dictionary <ushort, byte[]>(); this.ServerList = new ServerList(this.ClientVersion); this.ClientListener = new ClientListener(this); this.ClientListener.ConnectedClientsChanged += (sender, args) => { this.RaisePropertyChanged(nameof(this.CurrentConnections)); }; this.CreatePlugins(); }
/// <summary> /// Initializes a new instance of the <see cref="CheckMaximumConnectionsPlugin"/> class. /// </summary> /// <param name="server">The server.</param> public CheckMaximumConnectionsPlugin(ConnectServer server) { this.clientListener = server.ClientListener; this.connectServerSettings = server.Settings; }
/// <summary> /// Creates a new connect server instance. /// </summary> /// <param name="settings">The settings.</param> /// <param name="clientVersion">The client version.</param> /// <param name="configurationId">The configuration identifier.</param> /// <returns> /// The new connect server instance. /// </returns> public static OpenMU.Interfaces.IConnectServer CreateConnectServer(IConnectServerSettings settings, ClientVersion clientVersion, Guid configurationId) { return(new ConnectServer(settings, clientVersion, configurationId)); }
/// <summary> /// Initializes a new instance of the <see cref="FtpRequestHandler"/> class. /// </summary> /// <param name="connectServerSettings">The settings.</param> public FtpRequestHandler(IConnectServerSettings connectServerSettings) { this.connectServerSettings = connectServerSettings; }
/// <summary> /// Initializes a new instance of the <see cref="FtpRequestHandler" /> class. /// </summary> /// <param name="connectServerSettings">The settings.</param> /// <param name="logger">The logger.</param> public FtpRequestHandler(IConnectServerSettings connectServerSettings, ILogger <FtpRequestHandler> logger) { this.connectServerSettings = connectServerSettings; this.logger = logger; }
/// <summary> /// Creates a new connect server instance. /// </summary> /// <param name="settings">The settings.</param> /// <param name="stateObserver">The state observer.</param> /// <param name="clientVersion">The client version.</param> /// <returns> /// The new connect server instance. /// </returns> public static OpenMU.Interfaces.IConnectServer CreateConnectServer(IConnectServerSettings settings, IServerStateObserver stateObserver, ClientVersion clientVersion) { return(new ConnectServer(settings, stateObserver, clientVersion)); }
/// <summary> /// Initializes a new instance of the <see cref="ClientConnectionCountPlugin" /> class. /// </summary> /// <param name="connectServerSettings">The settings.</param> /// <param name="logger">The logger.</param> public ClientConnectionCountPlugin(IConnectServerSettings connectServerSettings, ILogger <ClientConnectionCountPlugin> logger) { this.connectServerSettings = connectServerSettings; this.logger = logger; this.clientCounter = new ClientConnectionCounter(); }
/// <summary> /// Initializes a new instance of the <see cref="ClientConnectionCountPlugin"/> class. /// </summary> /// <param name="connectServerSettings">The settings.</param> public ClientConnectionCountPlugin(IConnectServerSettings connectServerSettings) { this.connectServerSettings = connectServerSettings; this.clientCounter = new ClientConnectionCounter(); }
/// <summary> /// Creates a new connect server instance. /// </summary> /// <param name="settings">The settings.</param> /// <param name="stateObserver">The state observer.</param> /// <returns> /// The new connect server instance. /// </returns> public static OpenMU.Interfaces.IConnectServer CreateConnectServer(IConnectServerSettings settings, IServerStateObserver stateObserver) { return(new ConnectServer(settings, stateObserver)); }
/// <summary> /// Initializes a new instance of the <see cref="ClientPacketHandler"/> class. /// </summary> /// <param name="connectServer">The connect server.</param> public ClientPacketHandler(IConnectServer connectServer) { this.connectServerSettings = connectServer.Settings; this.packetHandlers.Add(0x05, new FtpRequestHandler(connectServer.Settings)); this.packetHandlers.Add(0xF4, new ServerListHandler(connectServer)); }