Binato/server/Packets/MultiplayerInvite.js

17 lines
570 B
JavaScript
Raw Permalink Normal View History

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