2020-09-07 17:35:37 +01:00
|
|
|
const osu = require("osu-packet");
|
2020-08-27 13:09:35 +01:00
|
|
|
|
2021-01-26 12:26:46 +00:00
|
|
|
module.exports = function(currentUser, sendImmidiate = true) {
|
2020-08-27 13:09:35 +01:00
|
|
|
const osuPacketWriter = new osu.Bancho.Writer;
|
|
|
|
|
|
|
|
let userIds = [];
|
|
|
|
|
|
|
|
for (let i = 0; i < global.users.length; i++) {
|
|
|
|
userIds.push(global.users[i].id);
|
|
|
|
}
|
|
|
|
|
|
|
|
osuPacketWriter.UserPresenceBundle(userIds);
|
|
|
|
|
2021-01-26 12:26:46 +00:00
|
|
|
if (sendImmidiate) currentUser.addActionToQueue(osuPacketWriter.toBuffer);
|
|
|
|
else return osuPacketWriter.toBuffer;
|
2020-08-27 13:09:35 +01:00
|
|
|
}
|