Add method of obtaining a user's class by their username
This commit is contained in:
parent
781a6cc3de
commit
cec774fc28
1 changed files with 10 additions and 0 deletions
10
server/util/getUserByUsername.js
Normal file
10
server/util/getUserByUsername.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
module.exports = function(username) {
|
||||
let user = null;
|
||||
for (let i = 0; i < global.users.length; i++) {
|
||||
if (global.users[i].username == username) {
|
||||
user = global.users[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return user;
|
||||
}
|
Loading…
Reference in a new issue