create message to report

This commit is contained in:
Gregoire Parant 2020-10-12 11:22:41 +02:00
parent 07c17452e7
commit aeced0c648
6 changed files with 77 additions and 27 deletions

View file

@ -601,6 +601,9 @@ export class GameScene extends ResizableScene implements CenterListener {
this.connection.setSilent(true);
}
});
//lisen event to report user
this.onReportUser();
}
private switchLayoutMode(): void {
@ -1181,4 +1184,10 @@ export class GameScene extends ResizableScene implements CenterListener {
public onCenterChange(): void {
this.updateCameraOffset();
}
public onReportUser(){
this.events.on('reportUser', (message: {reportedUserId: number, reportComment: string}) => {
this.connection.emitReportPlayerMessage(message.reportedUserId, message.reportComment);
});
}
}