Exemplo n.º 1
0
def getAcceptNotAllowedText(prbType,
                            peripheryID,
                            isInviteActive=True,
                            isAlreadyJoined=False,
                            lobbyContext=None):
    key, kwargs = None, {}
    if lobbyContext is not None:
        isAnotherPeriphery = lobbyContext.isAnotherPeriphery(peripheryID)
    else:
        isAnotherPeriphery = False
    if isInviteActive:
        if isAlreadyJoined:
            key = I18N_INVITES.invites_prebattle_alreadyjoined(
                getPrbName(prbType))
        elif isAnotherPeriphery:
            host = lobbyContext.getPeripheryName(peripheryID)
            if host:
                key = I18N_INVITES.invites_prebattle_acceptnotallowed(
                    'otherPeriphery')
                kwargs = {'host': host}
            else:
                key = I18N_INVITES.invites_prebattle_acceptnotallowed(
                    'undefinedPeriphery')
    if key:
        text = i18n.makeString(key, **kwargs)
    else:
        text = ''
    return text
Exemplo n.º 2
0
def getAcceptNotAllowedText(prbType, peripheryID, isInviteActive = True, isAlreadyJoined = False):
    key, kwargs = None, {}
    isAnotherPeriphery = g_lobbyContext.isAnotherPeriphery(peripheryID)
    if isInviteActive:
        if isAlreadyJoined:
            key = I18N_INVITES.invites_prebattle_alreadyjoined(getPrbName(prbType))
        elif isAnotherPeriphery:
            host = g_lobbyContext.getPeripheryName(peripheryID)
            if host:
                key = I18N_INVITES.invites_prebattle_acceptnotallowed('otherPeriphery')
                kwargs = {'host': host}
            else:
                key = I18N_INVITES.invites_prebattle_acceptnotallowed('undefinedPeriphery')
    if key:
        text = i18n.makeString(key, **kwargs)
    else:
        text = ''
    return text