Beispiel #1
0
def getDescription(command, acl):
    if command not in commands:
        command=getRealCommand(command)
    acl=int(acl)
    paramstr=""
    desc=commandvalues[command][4]
    brief=desc[0]
    params=desc[1]
    ident_param=2
    ident_param_desc=10
    for param in params:
        acl_needed=float("inf")
        if AccessLevel.accessLevelSet(command.lower()+"_param_"+param[0].lower()):
            acl_needed=AccessLevel.getAccessLevel(command.lower()+"_param_"+param[0].lower())
        if not acl_needed>=acl:
            continue
        paramstr=paramstr+"\n"+" "*ident_param
        paramstr=paramstr+"0x0088ff"+param[0]+":"
        paramdesc=textwrap.wrap(param[1], width=80-ident_param_desc)
        paramstr=paramstr+(ident_param_desc-ident_param-len(param[0]))*" "+" 0xffffff"
        paramstr=paramstr+paramdesc[0]
        paramdesc=paramdesc[1:]
        for desc in paramdesc:
            paramstr=paramstr+"\n"+" "+" "*ident_param_desc+" 0xffffff"+desc+"\n"
    if len(paramstr)==0: paramstr="None"
    return brief, paramstr
Beispiel #2
0
def acl(acl, player, command, access=None):
    if access is None:
        Armagetronad.PrintPlayerMessage(player, "0x00ff00The minimal access level needed for "+command+" is "+str(AccessLevel.getAccessLevel(command)))
        return
    try:
        access=int(access)
    except:
        return
    AccessLevel.setAccessLevel(command, access)
    Armagetronad.PrintPlayerMessage(player, Messages.AccessLevelChanged.format(command=command, access=access) )