btnClick(event, data) { if(data=="start_game"){ //开始游戏 global.eventlistener.fire("start_game", global.roomId); } if(data=="lookcard"){ //看牌 global.eventlistener.fire("look_card", global.roomId); } } });
global.eventlistener.on("start_game", function (roomId) { console.log("开始 游戏的 数据roomId:" + roomId); let data = {}; data.roomId = roomId; data.clientId = global.client.id; data.type = "start_game"; global.webSocket.send(JSON.stringify(data)); });
后台接受,开始游戏,消息,后开始发牌。
站长微信:xiaomao0055
站长QQ:14496453