Преглед изворни кода

modding #1960: Add the username to the onBeforeRegisterAccount and onBeforeLogin events

(cherry picked from commit 9088cc2e80)
tags/v0.11.0.7^0
Shaun пре 1 година
committed by Big Bad Waffle
родитељ
комит
ee67a2105e
1 измењених фајлова са 4 додато и 2 уклоњено
  1. +4
    -2
      src/server/components/auth.js

+ 4
- 2
src/server/components/auth.js Прегледај датотеку

@@ -309,7 +309,8 @@ module.exports = {
const emBeforeLogin = { const emBeforeLogin = {
obj: this.obj, obj: this.obj,
success: true, success: true,
msg: null
msg: null,
username
}; };
await eventEmitter.emit('onBeforeLogin', emBeforeLogin); await eventEmitter.emit('onBeforeLogin', emBeforeLogin);
if (!emBeforeLogin.success) { if (!emBeforeLogin.success) {
@@ -387,7 +388,8 @@ module.exports = {
const emBeforeRegisterAccount = { const emBeforeRegisterAccount = {
obj: this.obj, obj: this.obj,
success: true, success: true,
msg: null
msg: null,
username: msg.data.username
}; };


await eventEmitter.emit('onBeforeRegisterAccount', emBeforeRegisterAccount); await eventEmitter.emit('onBeforeRegisterAccount', emBeforeRegisterAccount);


Loading…
Откажи
Сачувај