Aw citizen attributes by name

From ActiveWiki
Jump to: navigation, search


Minimum requirements
Added in version 2.1
SDKbuild 13


int aw_citizen_attributes_by_name (char *name)

Description

Returns attributes associated with a citizen name.

Callback

AW_CALLBACK_CITIZEN_ATTRIBUTES

Notes

If you are using this method in asynchronous mode, you should check the value of AW_CITIZEN_NAME within the callback to verify that it is the same name that you queried. Note that this comparison should take into account that the name returned in AW_CITIZEN_NAME will reflect the actual case of the citizen name, which may be different from the case of the name you queried. For example, you may have specified the name "bob" in the original query, but in the callback AW_CITIZEN_NAME could be "Bob".

If the specified name does not exist then RC_NO_SUCH_CITIZEN will be returned and AW_CITIZEN_NUMBER is set to 0.

Argument

name
Citizen name.

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_name ("Bob") != RC_SUCCESS) 
  puts ("No such citizen");
else
  printf ("Bob's email address is %s\n", aw_string (AW_CITIZEN_EMAIL));

See also