Binato/server/Packets/UserPresenceBundle.js
2022-09-30 11:34:13 +01:00

16 lines
No EOL
413 B
JavaScript
Executable file

const osu = require("osu-packet");
module.exports = function(currentUser, sendImmidiate = true) {
const osuPacketWriter = new osu.Bancho.Writer;
let userIds = [];
for (let user of global.users.getIterableItems()) {
userIds.push(user.id);
}
osuPacketWriter.UserPresenceBundle(userIds);
if (sendImmidiate) currentUser.addActionToQueue(osuPacketWriter.toBuffer);
else return osuPacketWriter.toBuffer;
}