增加一个广播消息
This commit is contained in:
parent
fca8dbeb56
commit
6e51f44245
@ -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) => {
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user