Exemple #1
0
async def logout(p: Player, pr: PacketReader) -> None:
    pr.ignore(4)  # osu client sends \x00\x00\x00\x00 every time lol

    if (time.time() - p.login_time) < 2:
        # osu! has a weird tendency to log out immediately when
        # it logs in, then reconnects? not sure why..?
        return

    await p.logout()
    await plog(f'{p} logged out.', Ansi.LIGHT_YELLOW)
Exemple #2
0
def matchInvite(p: Player, pr: PacketReader) -> None:
    if not p.match:
        printlog(f"{p} tried to invite someone to a match but isn't in one!")
        pr.ignore(4)
        return

    userID = pr.read(osuTypes.i32)[0]
    if not (t := glob.players.get_by_id(userID)):
        printlog(f'{t} tried to invite a user who is not online! ({userID})')
        return
Exemple #3
0
async def matchInvite(p: Player, pr: PacketReader) -> None:
    if not p.match:
        await plog(f"{p} tried to invite someone to a match but isn't in one!")
        pr.ignore(4)
        return

    user_id, = await pr.read(osuTypes.i32)
    if not (t := await glob.players.get_by_id(user_id)):
        await plog(f'{t} tried to invite a user who is not online! ({user_id})'
                   )
        return
Exemple #4
0
async def setAwayMessage(p: Player, pr: PacketReader) -> None:
    pr.ignore(3)  # why does first string send \x0b\x00?
    p.away_msg, = await pr.read(osuTypes.string)
    pr.ignore(4)