Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GameLogInHandler"/> class.
        /// </summary>
        /// <param name="logger">A reference to the logger to use in this handler.</param>
        /// <param name="clientsMap">A reference to the clients map.</param>
        public GameLogInHandler(ILogger <GameLogInHandler> logger, IClientsManager clientsMap)
            : base(logger)
        {
            clientsMap.ThrowIfNull(nameof(clientsMap));

            this.clientsManager = clientsMap;
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TcpServer"/> class.
        /// </summary>
        /// <param name="options">The options to intialize the instance with.</param>
        /// <param name="loggerFactory">A reference to the factory of loggers to use.</param>
        /// <param name="handlerSelector">A refrence to the selector of handlers for TCP messages.</param>
        /// <param name="clientsManager">A reference to a manager for clients.</param>
        /// <param name="listeners">A reference to the listeners to bind to the server.</param>
        /// <param name="gameworldAdapter">A reference to an adapter that will act as a client to the game world.</param>
        public TcpServer(
            IOptions <TcpServerOptions> options,
            ILoggerFactory loggerFactory,
            IHandlerSelector handlerSelector,
            IClientsManager clientsManager,
            IEnumerable <IListener> listeners,
            ITcpServerToGameworldAdapter gameworldAdapter)
        {
            options.ThrowIfNull(nameof(options));
            loggerFactory.ThrowIfNull(nameof(loggerFactory));
            handlerSelector.ThrowIfNull(nameof(handlerSelector));
            listeners.ThrowIfNull(nameof(listeners));
            gameworldAdapter.ThrowIfNull(nameof(gameworldAdapter));

            if (!listeners.Any())
            {
                throw new ArgumentException("No listeners found after composition.", nameof(listeners));
            }

            DataAnnotationsValidator.ValidateObjectRecursive(options.Value);

            this.id     = Guid.NewGuid().ToString();
            this.logger = loggerFactory.CreateLogger <TcpServer>();
            this.gameworldClientAdapter = gameworldAdapter;
            this.connectionToClientMap  = new Dictionary <IConnection, IClient>();
            this.clientsManager         = clientsManager;

            this.Options = options.Value;

            this.BindListeners(loggerFactory, handlerSelector, listeners);
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AddCreaturePacketWriter"/> class.
        /// </summary>
        /// <param name="logger">A reference to the logger in use.</param>
        /// <param name="clientsManager">A reference to the manager of clients.</param>
        public AddCreaturePacketWriter(ILogger <AddCreaturePacketWriter> logger, IClientsManager clientsManager)
            : base(logger)
        {
            clientsManager.ThrowIfNull(nameof(clientsManager));

            this.clientsManager = clientsManager;
        }
Example #4
0
 public TokenController(IBearerTokenGenerator generator,
                        IClientsManager clientsManager,
                        IOptions <TokenAuthOptions> options)
 {
     this.generator      = generator;
     this.clientsManager = clientsManager;
     this.options        = options;
 }
Example #5
0
 public ProjectService(IProjectManager projectManager, IBudgetManager budgetManager, UserManager userManager, IClientsManager clientsManager, IMembersManager membersManager, IToDoListManager toDoListManager)
 {
     _projectManager  = projectManager;
     _budgetManager   = budgetManager;
     _userManager     = userManager;
     _clientsManager  = clientsManager;
     _membersManager  = membersManager;
     _toDoListManager = toDoListManager;
 }
        public GameServer(IKernel kernel)
        {
            Debug.WriteLine("GameServer::.ctor");
            _kernel = kernel;

            _clientsManager = _kernel.Get<IClientsManager>();
            _networkServer = _kernel.Get<INetworkServer>();

            _worldManager = new WorldManager();
            Controllers.ControllersRegistration.Register();
        }
		public NetworkServer(IConfigHelper config, ILoggerHelper log, IClientsManager clientsManager)
		{
			_config = config;
			_log = log;
			_clientsManager = clientsManager;

			_ip = _config.Get<IPAddress>("server.ip");
			_port = _config.Get<int>("server.port");

			_listener = new TcpListener(_ip, _port);
			_isPortOpen = false;
		}
        public void ExecuteCore(ReadBuffer request, IClientConnection client, IClientsManager clientsManager)
        {
            Request = request;
            Client = client;
            ClientsManager = clientsManager;

            try
            {
                Execute();
            }
            catch (Exception)
            {

            }
        }
Example #9
0
 public void executeCommand(IClientsManager manager) { }
 public ControllerActivator(IClientConnection client, IClientsManager clientsManager)
 {
     _client = client;
     _clientsManager = clientsManager;
 }
Example #11
0
 public void executeCommand(IClientsManager manager)
 {
 }
Example #12
0
 public ClientsController(IClientsManager clientsManager, IAuthenticator authenticator)
 {
     this._clientsManager = clientsManager;
     this._authenticator  = authenticator;
 }
Example #13
0
 public ClientService(IClientsManager clientsManager, IProjectManager projectManager)
 {
     _clientsManager = clientsManager;
     _projectManager = projectManager;
 }
Example #14
0
 // GET: Crm
 public CrmController(IClientsManager clientManager)
 {
     _clientManager = clientManager;
 }