forked from Hri7566/mpp-server-dev2
wtf
This commit is contained in:
parent
bef6dbecf6
commit
9fd2a80167
|
@ -121,18 +121,22 @@ class Client extends EventEmitter {
|
||||||
*/
|
*/
|
||||||
userset(name, admin) {
|
userset(name, admin) {
|
||||||
if (name.length > 40 && !admin) return;
|
if (name.length > 40 && !admin) return;
|
||||||
if (!this.quotas.userset.attempt()) return;
|
if (this.quotas.userset) {
|
||||||
|
if (!this.quotas.userset.attempt()) return;
|
||||||
|
}
|
||||||
if (!this.user.hasFlag('freeze_name', true) || admin) {
|
if (!this.user.hasFlag('freeze_name', true) || admin) {
|
||||||
this.user.name = name;
|
this.user.name = name;
|
||||||
Database.getUserData(this, this.server).then((usr) => {
|
if (!this.user.hasFlag('freeze_name', true)) {
|
||||||
Database.updateUser(this.user._id, this.user);
|
Database.getUserData(this, this.server).then((usr) => {
|
||||||
|
Database.updateUser(this.user._id, this.user);
|
||||||
this.server.rooms.forEach((room) => {
|
|
||||||
room.updateParticipant(this.user._id, {
|
this.server.rooms.forEach((room) => {
|
||||||
name: name
|
room.updateParticipant(this.user._id, {
|
||||||
|
name: name
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue