programing sendcard

This commit is contained in:
wzdwc
2020-04-20 23:25:57 +08:00
parent b3682878ad
commit 47f3225e29
19 changed files with 578 additions and 412 deletions
+4 -2
View File
@@ -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;
}
}