增加玩家死亡的广播消息

This commit is contained in:
zhl 2021-03-01 15:05:45 +08:00
parent 7dd2c82a50
commit 080badc9cd
2 changed files with 11 additions and 0 deletions

6
src/global.d.ts vendored
View File

@ -162,6 +162,12 @@ declare module 'colyseus' {
*/
sMsgQueue(client: Client, data: IMsg[]): void;
/**
* 广
* @param data
* @param options
*/
bPlayerDead(data: any, options?: any) : void;
/**
* 广

View File

@ -235,6 +235,11 @@ Object.defineProperties(Room.prototype, {
this.send(client, "change_pet_s2c", data);
}
},
bPlayerDead: {
value: function (data: any, options?: any) {
this.broadcast('player_dead_s2c', data, options);
}
},
send: {
value: function (client: Client, type: string, data?: any) {