diff --git a/src/rooms/MSender.ts b/src/rooms/MSender.ts index bff69f3..ce25426 100644 --- a/src/rooms/MSender.ts +++ b/src/rooms/MSender.ts @@ -36,7 +36,7 @@ Object.defineProperties(Room.prototype, { */ sSelectHero: { value: function (client: Client, data?: any) { - client && client.send('select_hero_s2c', data); + this.send(client, 'select_hero_s2c', data); }, writable: true }, @@ -56,7 +56,7 @@ Object.defineProperties(Room.prototype, { */ sDrawCard: { value: function (client: Client, data?: any) { - client && client.send('draw_card_s2c', data); + this.send(client, 'draw_card_s2c', data); } }, /** @@ -108,7 +108,7 @@ Object.defineProperties(Room.prototype, { */ sMsgQueue: { value: function (client:Client, datas?: IMsg) { - client && client.send("msg_queue_s2c", datas); + this.send(client, "msg_queue_s2c", datas); } }, /** @@ -151,7 +151,7 @@ Object.defineProperties(Room.prototype, { */ sStealCard: { value: function (client: Client, data?: any) { - client && client.send("steal_card_s2c", data, {afterNextPatch: true}); + this.send(client, "steal_card_s2c", data, {afterNextPatch: true}); } }, /** @@ -161,7 +161,7 @@ Object.defineProperties(Room.prototype, { */ bRemoveCard: { value: function (client: Client, data?: any) { - client && client.send("remove_card_s2c", data); + this.send(client, "remove_card_s2c", data); } }, /** @@ -213,7 +213,7 @@ Object.defineProperties(Room.prototype, { sChangeCard: { value: function (client: Client, data?: any) { - client && client.send("change_card_s2c", data); + this.send(client, "change_card_s2c", data); } },