mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-14 18:53:08 +02:00
✌️
This commit is contained in:
parent
bf0ef17e23
commit
4b08677839
1 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
import autobind from 'autobind-decorator';
|
import autobind from 'autobind-decorator';
|
||||||
import * as CRC32 from 'crc-32';
|
import * as CRC32 from 'crc-32';
|
||||||
|
import * as mongo from 'mongodb';
|
||||||
import ReversiGame, { pack } from '../../../../../models/games/reversi/game';
|
import ReversiGame, { pack } from '../../../../../models/games/reversi/game';
|
||||||
import { publishReversiGameStream } from '../../../../../stream';
|
import { publishReversiGameStream } from '../../../../../stream';
|
||||||
import Reversi from '../../../../../games/reversi/core';
|
import Reversi from '../../../../../games/reversi/core';
|
||||||
|
@ -7,11 +8,11 @@ import * as maps from '../../../../../games/reversi/maps';
|
||||||
import Channel from '../../channel';
|
import Channel from '../../channel';
|
||||||
|
|
||||||
export default class extends Channel {
|
export default class extends Channel {
|
||||||
private gameId: string;
|
private gameId: mongo.ObjectID;
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
public async init(params: any) {
|
public async init(params: any) {
|
||||||
this.gameId = params.gameId as string;
|
this.gameId = new mongo.ObjectID(params.gameId as string);
|
||||||
|
|
||||||
// Subscribe game stream
|
// Subscribe game stream
|
||||||
this.subscriber.on(`reversiGameStream:${this.gameId}`, data => {
|
this.subscriber.on(`reversiGameStream:${this.gameId}`, data => {
|
||||||
|
|
Loading…
Reference in a new issue