Esempio n. 1
0
        public ClientConnectEvents(IStar star, StarDbContext db, IStarEventManager evtManager)
        {
            _star = star;
            _db = db;

            evtManager.RegisterPacketEvent<IClientConnectPacket>(OnClientConnect);
        }
Esempio n. 2
0
        public AccountsPlugin(
            ILogger<AccountsPlugin> logger,
            IStarEventManager evtManager,
            StarCommandManager cmdManager,
            ClientConnectEvents connectEvents,
            AccountCommands accountCommands,
            AdminAccountCommands adminCommands
            )
        {
            _logger = logger;
            _eventManager = evtManager;

            _commandManager = cmdManager;
            _connectEvents = connectEvents;
            _accountCommands = accountCommands;
            _adminCommands = adminCommands;
        }
Esempio n. 3
0
        public StarProxy(IStarServer server, IConfiguration config, IPacketTypeCollection packetTypes, ILogger<StarProxy> logger,
            IStarEventManager evtManager, SocketAsyncEventArgsPool socketPool, Socket clientSocket)
        {
            if (clientSocket == null)
                throw new ArgumentNullException(nameof(clientSocket));

            Server = server;
            ClientPacketProcessor = new PacketProcessor(packetTypes);
            ServerPacketProcessor = new PacketProcessor(packetTypes);
            ClientSocket = clientSocket;
            _logger = logger;
            _eventManager = evtManager;
            _isDisposed = false;
            _isAlive = 0;
            _socketArgsPool = socketPool;
            _cancelToken = new CancellationTokenSource();
            _clientSem = new SemaphoreSlim(1);
            _serverSem = new SemaphoreSlim(1);
            _packetBacklog = new BlockingCollection<PacketBacklogItem>(new ConcurrentQueue<PacketBacklogItem>());
            _remoteEndPoint = new IPEndPoint(Dns.GetHostAddressesAsync(config["SBHost"]).Result.First(), int.Parse(config["SBPort"]));
        }
Esempio n. 4
0
 public CommandsPlugin(IStar star, ILogger<CommandsPlugin> logger, IStarEventManager evtManager)
 {
     _star = star;
     _logger = logger;
     _eventManager = evtManager;
 }