Move friends list logic
This commit is contained in:
parent
0848c0b1e4
commit
02cf151134
1 changed files with 9 additions and 8 deletions
|
@ -91,14 +91,6 @@ module.exports = function(req, res, loginInfo) {
|
|||
// Permission level 4 is osu!supporter
|
||||
osuPacketWriter.LoginPermissions(4);
|
||||
|
||||
// Construct user's friends list
|
||||
const userFriends = global.DatabaseHelper.getFromDB(`SELECT friendsWith FROM friends WHERE user = ${NewUser.id}`);
|
||||
let friendsArray = [];
|
||||
for (let i = 0; i < userFriends.length; i++) {
|
||||
friendsArray.push(userFriends[i].friendsWith);
|
||||
}
|
||||
// Send user's friends list
|
||||
osuPacketWriter.FriendsList(friendsArray);
|
||||
// After sending the user their friends list send them the online users
|
||||
UserPresenceBundle(NewUser);
|
||||
|
||||
|
@ -130,6 +122,15 @@ module.exports = function(req, res, loginInfo) {
|
|||
});
|
||||
}
|
||||
|
||||
// Construct user's friends list
|
||||
const userFriends = global.DatabaseHelper.getFromDB(`SELECT friendsWith FROM friends WHERE user = ${NewUser.id}`);
|
||||
let friendsArray = [];
|
||||
for (let i = 0; i < userFriends.length; i++) {
|
||||
friendsArray.push(userFriends[i].friendsWith);
|
||||
}
|
||||
// Send user's friends list
|
||||
osuPacketWriter.FriendsList(friendsArray);
|
||||
|
||||
osuPacketWriter.Announce(`Welcome back ${loginInfo.username}!`);
|
||||
|
||||
// Complete login
|
||||
|
|
Loading…
Reference in a new issue