programing sendcard
This commit is contained in:
@@ -6,10 +6,12 @@ export default class BaseSocketController extends Controller {
|
||||
|
||||
public app = this.ctx.app as any;
|
||||
public nsp = this.app.io.of('/socket');
|
||||
public gameRoom = this.nsp.gameRoom;
|
||||
public gameRooms = this.nsp.gameRooms;
|
||||
public socket = this.ctx.socket as any;
|
||||
public query = this.socket.handshake.query;
|
||||
public roomNumber = this.query.room;
|
||||
public jwt: any = this.app.jwt;
|
||||
public message = this.ctx.args[0] || {};
|
||||
|
||||
async getUserInfo() {
|
||||
const { token } = this.query;
|
||||
@@ -19,7 +21,7 @@ export default class BaseSocketController extends Controller {
|
||||
|
||||
async getRoomInfo(): Promise<IRoomInfo> {
|
||||
const { room } = this.query;
|
||||
const roomInfo = this.gameRoom.find((gr: IGameRoom) => gr.number === room);
|
||||
const roomInfo = this.gameRooms.find((gr: IGameRoom) => gr.number === room);
|
||||
return roomInfo.roomInfo;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user