This commit is contained in:
y.x 2020-12-08 20:56:40 +08:00
commit 3ec1883d29
4 changed files with 4 additions and 5 deletions

View File

@ -8,7 +8,7 @@
"start": "ts-node-dev --inspect --files src/index.ts",
"debug": "node --require ts-node/register --inspect src/index.ts",
"dev": "DEBUG=colyseus:*,jc:* node --require ts-node/register --inspect src/index.ts",
"dev:less": "DEBUG=colyseus:command,jc:* node --require ts-node/register --inspect src/index.ts",
"dev:less": "DEBUG=colyseus:command,jc:* node --require ts-node/register --inspect=0.0.0.0:9229 src/index.ts",
"loadtest": "colyseus-loadtest loadtest/example.ts --room my_room --numClients 3",
"test": "echo \"Error: no test specified\" && exit 1"
},

View File

@ -65,7 +65,8 @@ Object.defineProperties(Room.prototype, {
let client = this.getClient(dstplayer);
let sData = {
player: dstplayer,
cards: cards
cards: cards,
source: source
};
this.sDrawCard(client, sData);
let cardIds = cards.map(card => card.id);

View File

@ -47,8 +47,7 @@ export class EatConfirmCommand extends Command<CardGameState, { timeUp: boolean
if (tmpActionMap.has(pid)) {
if (typeof tmpActionMap.get(pid) != 'number') {
player = this.state.players.get(pid);
// @ts-ignore
cards = tmpActionMap.get(pid);
cards = tmpActionMap.get(pid) as string[];
break;
}
} else {

View File

@ -11,7 +11,6 @@ import {NextTurnCommand} from "./NextTurnCommand";
export class TurnEndCommand extends Command<CardGameState, {}> {
execute() : Array<Command> | void{
// @ts-ignore
const sessionIds = [...this.state.players.keys()];
if (this.state.currentTurn) {
let player = this.state.players.get(this.state.currentTurn);