Aw citizen attributes by number

From ActiveWiki
Jump to navigation Jump to search


Minimum requirements
Added in version 2.1
SDKbuild 13


int aw_citizen_attributes_by_number (int citizen)

Description

Returns attributes associated with a citizen number.

Callback

AW_CALLBACK_CITIZEN_ATTRIBUTES

Notes

If you are using this method in asynchronous mode then you should check the value of AW_CITIZEN_NUMBER within the callback to verify that it is the same number that you queried.

If the specified number does not exist then RC_NO_SUCH_CITIZEN will be returned and AW_CITIZEN_NAME is set to "".

Arguments

citizen
Citizen number.

Argument attributes

None

Return values

RC_SUCCESS (1) (2)
RC_NOT_INITIALIZED (1)
RC_NO_INSTANCE (1)
RC_NO_CONNECTION (1)
The connection to the universe is down.
RC_NO_SUCH_CITIZEN (2)
RC_CALL_LIMIT_EXCEEDED (2)
Only applies to bots that are not owned by the root account (citizen #1 - universe administrator).

(1) Possible return values when a callback is installed.

(2) Returned by the universe server.

Returned attributes

AW_CITIZEN_NUMBER
AW_CITIZEN_NAME
AW_CITIZEN_PASSWORD
AW_CITIZEN_EMAIL
AW_CITIZEN_ENABLED
AW_CITIZEN_BETA
AW_CITIZEN_TRIAL
AW_CITIZEN_CAV_ENABLED
AW_CITIZEN_PAV_ENABLED
AW_CITIZEN_BOT_LIMIT
AW_CITIZEN_COMMENT
AW_CITIZEN_EXPIRATION_TIME
AW_CITIZEN_IMMIGRATION_TIME
AW_CITIZEN_LAST_LOGIN
AW_CITIZEN_PRIVILEGE_PASSWORD
AW_CITIZEN_PRIVACY
AW_CITIZEN_TOTAL_TIME
AW_CITIZEN_URL

Note that all attributes are returned only if this instance is owned by the universe root account (citizen #1 - universe administrator). Otherwise, only AW_CITIZEN_NUMBER, AW_CITIZEN_URL, AW_CITIZEN_TRIAL and AW_CITIZEN_CAV_ENABLED are returned.

The attributes AW_CITIZEN_COMMENT, AW_CITIZEN_ENABLED, AW_CITIZEN_TOTAL_TIME, and AW_CITIZEN_URL are new in version 3.1 and require at least build 18 of the SDK and version 3.1 of the uniserver.

The attributes AW_CITIZEN_PRIVACY, AW_CITIZEN_TRIAL and AW_CITIZEN_CAV_ENABLED are new in version 4.1 and require at least build 55 of the SDK and build 82 of the uniserver.

Usage

if (aw_citizen_attributes_by_number (4711) != RC_SUCCESS) 
    puts ("No such citizen");
else
    printf ("Citizen #4711's name is %s\n", aw_string (AW_CITIZEN_NAME));

See also