增加一个广播消息

This commit is contained in:
zhl 2021-02-02 17:01:33 +08:00
parent fca8dbeb56
commit 6e51f44245

View File

@ -102,6 +102,13 @@ export class GeneralRoom extends Room {
msgLog('change pet from ', client.sessionId, JSON.stringify(message));
this.dispatcher.dispatch(new ChangePetCommand(), {client, pos: message.pos, petId: message.petId});
});
/**
* broadcast_c2s的消息, 广
*/
this.onMessage("broadcast_c2s", (client, message) => {
msgLog('broadcast_c2s from ', client.sessionId, JSON.stringify(message));
this.broadcast("broadcast_s2c", message, {except: client});
});
this.onMessage("*", (client, type, message) => {
//