diff options
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/stream/othello-game.ts | 2 | ||||
| -rw-r--r-- | src/api/streaming.ts | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/api/stream/othello-game.ts b/src/api/stream/othello-game.ts index ba0f11252f..1c846f27ae 100644 --- a/src/api/stream/othello-game.ts +++ b/src/api/stream/othello-game.ts @@ -6,7 +6,7 @@ import { publishOthelloGameStream } from '../event'; import Othello from '../../common/othello/core'; import * as maps from '../../common/othello/maps'; -export default function(request: websocket.request, connection: websocket.connection, subscriber: redis.RedisClient, user: any): void { +export default function(request: websocket.request, connection: websocket.connection, subscriber: redis.RedisClient, user?: any): void { const gameId = request.resourceURL.query.game; // Subscribe game stream diff --git a/src/api/streaming.ts b/src/api/streaming.ts index 7d67ba9574..f56c08092c 100644 --- a/src/api/streaming.ts +++ b/src/api/streaming.ts @@ -53,6 +53,11 @@ module.exports = (server: http.Server) => { const user = await authenticate(request.resourceURL.query.i); + if (request.resourceURL.pathname === '/othello-game') { + othelloGameStream(request, connection, subscriber, user); + return; + } + if (user == null) { connection.send('authentication-failed'); connection.close(); @@ -64,7 +69,6 @@ module.exports = (server: http.Server) => { request.resourceURL.pathname === '/drive' ? driveStream : request.resourceURL.pathname === '/messaging' ? messagingStream : request.resourceURL.pathname === '/messaging-index' ? messagingIndexStream : - request.resourceURL.pathname === '/othello-game' ? othelloGameStream : request.resourceURL.pathname === '/othello' ? othelloStream : null; |