예제 #1
0
            public WebSocketConnection(
                ILogger logger,
                IRavenBotApiClient ravenBotApi,
                IIntegrityChecker integrityChecker,
                IPlayerInventoryProvider inventoryProvider,
                IGameData gameData,
                IGameManager gameManager,
                IGamePacketManager packetManager,
                IGamePacketSerializer packetSerializer,
                ISessionManager sessionManager,
                IExtensionWebSocketConnectionProvider extWsProvider,
                GameWebSocketConnectionProvider sessionProvider,
                WebSocket ws,
                SessionToken sessionToken)
            {
                this.receiveLoop      = new Thread(ReceiveLoop);
                this.sendLoop         = new Thread(SendLoop);
                this.gameLoop         = new Thread(GameUpdateLoop);
                this.logger           = logger;
                this.sessionToken     = sessionToken;
                this.packetManager    = packetManager;
                this.packetSerializer = packetSerializer;
                this.sessionManager   = sessionManager;
                this.sessionProvider  = sessionProvider;
                this.ws = ws;

                this.killTask      = new TaskCompletionSource <object>();
                this.gameProcessor = new GameProcessor(
                    ravenBotApi, integrityChecker, this, extWsProvider, sessionManager, inventoryProvider, gameData, gameManager, sessionToken);
            }
예제 #2
0
 public WSGameServerConnection(
     ILogger logger,
     IAppSettings settings,
     ITokenProvider tokenProvider,
     IGamePacketSerializer packetSerializer)
 {
     this.logger           = logger;
     this.settings         = settings;
     this.tokenProvider    = tokenProvider;
     this.packetSerializer = packetSerializer;
 }
예제 #3
0
 public GameTcpConnectionProvider(
     ILogger <GameTcpConnectionProvider> logger,
     IGameData gameData,
     IGamePacketManager packetManager,
     IGamePacketSerializer packetSerializer,
     ISessionManager sessionManager)
 {
     this.logger           = logger;
     this.gameData         = gameData;
     this.packetManager    = packetManager;
     this.packetSerializer = packetSerializer;
     this.sessionManager   = sessionManager;
 }
예제 #4
0
 public WebSocketConnectionProvider(
     ILogger logger,
     IGameManager gameManager,
     IGamePacketManager packetManager,
     IGamePacketSerializer packetSerializer,
     ISessionManager sessionManager)
 {
     this.logger           = logger;
     this.gameManager      = gameManager;
     this.packetManager    = packetManager;
     this.packetSerializer = packetSerializer;
     this.sessionManager   = sessionManager;
 }
예제 #5
0
        public WebSocketEndpoint(
            GameManager gameManager,
            ILogger logger,
            IAppSettings settings,
            ITokenProvider tokenProvider,
            IGamePacketSerializer packetSerializer)
        {
            connection = new WSGameServerConnection(
                logger,
                settings,
                tokenProvider,
                packetSerializer);

            connection.Register("game_event", new GameEventPacketHandler(gameManager));
            this.gameManager = gameManager;
        }
 public WebSocketConnectionProvider(
     ILogger <WebSocketConnectionProvider> logger,
     IIntegrityChecker integrityChecker,
     IGameData gameData,
     IGameManager gameManager,
     IGamePacketManager packetManager,
     IGamePacketSerializer packetSerializer,
     ISessionManager sessionManager)
 {
     this.logger           = logger;
     this.integrityChecker = integrityChecker;
     this.gameData         = gameData;
     this.gameManager      = gameManager;
     this.packetManager    = packetManager;
     this.packetSerializer = packetSerializer;
     this.sessionManager   = sessionManager;
 }
예제 #7
0
 public WebSocketConnection(
     ILogger logger,
     IGameManager gameManager,
     IGamePacketManager packetManager,
     IGamePacketSerializer packetSerializer,
     WebSocketConnectionProvider sessionProvider,
     WebSocket ws,
     SessionToken sessionToken)
 {
     this.receiveLoop      = new Thread(ReceiveLoop);
     this.gameLoop         = new Thread(GameUpdateLoop);
     this.logger           = logger;
     this.gameManager      = gameManager;
     this.packetManager    = packetManager;
     this.packetSerializer = packetSerializer;
     this.sessionProvider  = sessionProvider;
     this.sessionToken     = sessionToken;
     this.ws       = ws;
     this.killTask = new TaskCompletionSource <object>();
 }
예제 #8
0
        public WebSocketEndpoint(
            IRavenNestClient client,
            IGameManager gameManager,
            ILogger logger,
            IAppSettings settings,
            ITokenProvider tokenProvider,
            IGamePacketSerializer packetSerializer,
            IGameCache gameCache)
        {
            connection = new WSGameServerConnection(
                logger,
                settings,
                tokenProvider,
                packetSerializer,
                gameCache);

            connection.Register("game_event", new GameEventPacketHandler(gameManager));
            connection.OnReconnected += OnReconnected;
            this.client      = client;
            this.gameManager = gameManager;
        }
예제 #9
0
 public GameWebSocketConnectionProvider(
     ILogger <GameWebSocketConnectionProvider> logger,
     IRavenBotApiClient ravenBotApi,
     IIntegrityChecker integrityChecker,
     IPlayerInventoryProvider inventoryProvider,
     IExtensionWebSocketConnectionProvider extWsProvider,
     IGameData gameData,
     IGameManager gameManager,
     IGamePacketManager packetManager,
     IGamePacketSerializer packetSerializer,
     ISessionManager sessionManager)
 {
     this.logger            = logger;
     this.ravenBotApi       = ravenBotApi;
     this.integrityChecker  = integrityChecker;
     this.inventoryProvider = inventoryProvider;
     this.extWsProvider     = extWsProvider;
     this.gameData          = gameData;
     this.gameManager       = gameManager;
     this.packetManager     = packetManager;
     this.packetSerializer  = packetSerializer;
     this.sessionManager    = sessionManager;
 }
예제 #10
0
 public PartialGamePacket(IGamePacketSerializer packetSerializer, byte[] array, int count)
 {
     this.packetSerializer = packetSerializer;
     this.array            = array;
     this.count            = count;
 }