-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -721,7 +721,9 @@ class User { | |
* @param {Connection} connection The connection asking for the rename | ||
*/ | ||
async rename(name, token, newlyRegistered, connection) { | ||
let userid = toId(name); | ||
for (const roomid of this.games) { | ||
if (userid === this.userid) break; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
HoeenCoder
Author
Member
|
||
const game = Rooms(roomid).game; | ||
if (!game || game.ended) continue; // should never happen | ||
if (game.allowRenames || !this.named) continue; | ||
|
@@ -747,7 +749,6 @@ class User { | |
return false; | ||
} | ||
|
||
let userid = toId(name); | ||
if (userid.length > 18) { | ||
this.send(`|nametaken||Your name must be 18 characters or shorter.`); | ||
return false; | ||
|
This should probably be outside the loop.