Esempio n. 1
0
File: cho.py Progetto: Mxnuuel/gulag
            'WHERE id = %s', [country, user_info['id']])

    # get clan & clan rank if we're in a clan
    if user_info['clan_id'] != 0:
        clan = glob.clans.get(id=user_info.pop('clan_id'))
        clan_rank = ClanRank(user_info.pop('clan_rank'))
    else:
        del user_info['clan_id']
        del user_info['clan_rank']
        clan = clan_rank = None

    # user_info: {id, name, priv, pw_bcrypt, silence_end}
    p = Player.login(user_info,
                     utc_offset=utc_offset,
                     osu_ver=s[0],
                     pm_private=pm_private,
                     login_time=login_time,
                     clan=clan,
                     clan_rank=clan_rank)

    data = bytearray(packets.userID(p.id))
    data += packets.protocolVersion(19)
    data += packets.banchoPrivileges(p.bancho_priv
                                     | ClientPrivileges.Supporter)
    if first_login:
        data += packets.sendMessage(
            'Ruji',
            'Welcome to Iteki!\n\nIteki has a relatively unique experience from other servers as it is based on different source code and has many unique features.'
            '\n\nTo get started, you may be interested in knowing some useful commands:\n\n!req <rank/love> <set/map> - this is our request system:'
            '\nTo use this command you must first /np a map to Ruji (our bot) and you will then be able to request maps.'
            '\nThe choice between rank/love depends on whether you would like to request the map to be ranked or loved.\nThe map/set choices are depending on whether you want the entire set to be requested, or just the difficulty you did /np to.'
Esempio n. 2
0
            pass

    if not user_info['priv'] & Privileges.Verified:
        # verify the account if it's made it this far
        user_info['priv'] |= int(Privileges.Verified)

        await glob.db.execute(
            'UPDATE users '
            'SET priv = %s '
            'WHERE id = %s',
            [user_info['priv'], user_info['id']]
        )

    # user_info: {id, name, priv, pw_bcrypt, silence_end}
    p = Player.login(user_info, utc_offset=utc_offset,
                     osu_ver=osu_ver, pm_private=pm_private,
                     login_time=login_time)

    data = bytearray(packets.userID(p.id))
    data += packets.protocolVersion(19)
    data += packets.banchoPrivileges(p.bancho_priv)
    data += packets.notification('Welcome back to the gulag!\n'
                                f'Current build: {glob.version}')

    # tells osu! to load channels from config, i believe?
    data += packets.channelInfoEnd()

    # channels
    for c in glob.channels:
        if not p.priv & c.read_priv:
            continue # no priv to read