/// <summary>Initializes a new instance of the <see cref="GameServerListRequestHandler"/> class.</summary> public GameServerListRequestHandler(IGameServerController gameServerController) { this.gameServerController = gameServerController; this.gameServerController.GameServerRegistered += (_, ev) => this.OnGameServerChange(); this.gameServerController.GameServerDeregistered += (_, ev) => this.OnGameServerChange(); this.gameServerController.GameServerUpdated += (_, ev) => this.OnGameServerChange(); }
/// <summary>Initializes a new instance of the <see cref="ClientProtocolHandler" /> class.</summary> public ClientProtocolHandler( IGameServerController gameServerController, IClientController clientsController) { clientsController.ClientSessionStarted += this.OnClientSessionStarted; this.RegisterPacketHandlers(gameServerController); }
/// <summary>Initializes a new instance of the <see cref="ConnectServer"/> class.</summary> internal ConnectServer( Configuration config, IGameServerController gameServerController, IClientController clientController) { this.Config = config; this.gameServerController = gameServerController; this.clientController = clientController; }
/// <summary>Initializes a new instance of the <see cref="GameServerInfoRequestHandler"/> class.</summary> public GameServerInfoRequestHandler(IGameServerController gameServerController) => this.gameServerController = gameServerController;
private void RegisterPacketHandlers(IGameServerController gameServerController) { this.RegisterHandler <GameServerInfoRequest>(new GameServerInfoRequestHandler(gameServerController)); this.RegisterHandler <GameServerListRequest>(new GameServerListRequestHandler(gameServerController)); this.RegisterHandler <ClientUpdateRequest>(new ClientUpdateRequestHandler()); }