2021-02-01 03:01:37 +00:00
|
|
|
const osu = require("osu-packet"),
|
2021-02-05 03:15:39 +00:00
|
|
|
UserPresence = require("./UserPresence.js"),
|
|
|
|
StatusUpdate = require("./StatusUpdate.js"),
|
2021-02-01 03:01:37 +00:00
|
|
|
ActionBuffer = require("../ActionBuffer.js");
|
|
|
|
|
|
|
|
module.exports = function(CurrentUser, MatchID) {
|
|
|
|
const matchData = global.MultiplayerManager.getMatchInfoForTourneyClient(MatchID);
|
|
|
|
|
|
|
|
if (matchData != null) {
|
|
|
|
const osuPacketWriter = new osu.Bancho.Writer();
|
|
|
|
|
|
|
|
osuPacketWriter.MatchUpdate(matchData);
|
|
|
|
|
|
|
|
let actions = new ActionBuffer(osuPacketWriter.toBuffer);
|
|
|
|
|
2021-02-05 03:15:39 +00:00
|
|
|
for (let slot in matchData.slots) {
|
2021-02-01 03:01:37 +00:00
|
|
|
actions.bufferAction(UserPresence(CurrentUser, slot.playerId, false));
|
|
|
|
actions.bufferAction(StatusUpdate(CurrentUser, slot.playerId, false));
|
|
|
|
}
|
|
|
|
|
|
|
|
CurrentUser.addActionToQueue(actions.toBuffer());
|
|
|
|
}
|
|
|
|
}
|