Binato/server/Packets/MultiplayerInvite.js
2021-01-26 12:24:13 +00:00

17 lines
No EOL
612 B
JavaScript

const osu = require("osu-packet"),
getUserById = require("../util/getUserById.js");
module.exports = function(CurrentUser, InvitedUser) {
let osuPacketWriter = new osu.Bancho.Writer;
const InvitedUserClass = getUserById(InvitedUser);
osuPacketWriter.SendMessage({
sendingClient: CurrentUser.username,
message: `Come join my multiplayer match: [osump://${CurrentUser.currentMatch.matchId}/ ${CurrentUser.currentMatch.gameName}]`,
target: CurrentUser.username,
senderId: CurrentUser.id
});
InvitedUserClass.addActionToQueue(osuPacketWriter.toBuffer);
}