int aw_citizen_add (void)

DESCRIPTION

Adds a new citizen to the universe.

CALLBACK

AW_CALLBACK_CITIZEN_RESULT

NOTES

Only instances owned by the root account (citizen #1) may use aw_citizen_add.

The following attributes are used when creating the new account:

AW_CITIZEN_NUMBER
AW_CITIZEN_NAME
AW_CITIZEN_PASSWORD
AW_CITIZEN_EMAIL
AW_CITIZEN_BETA

It is an error to specify a value for AW_CITIZEN_NUMBER that is greater than the highest citizen number currently assigned in the universe (e.g. you cannot create citizen #456789 if there are only 200 citizens in the universe).  To create a new citizen, set AW_CITIZEN_NUMBER to 0 and the next available citizen number in this universe will be assigned to the account automatically.

The citizen attributes AW_CITIZEN_EXPIRATION_TIME, AW_CITIZEN_PRIVILEGE_PASSWORD, AW_CITIZEN_BOT_LIMIT, AW_CITIZEN_ENABLED, AW_CITIZEN_COMMENT, and AW_CITIZEN_URL are assigned default values when a citizen is first created. To set custom values for these attributes, use aw_citizen_change after calling aw_citizen_add. Also, the AW_CITIZEN_IMMIGRATION_TIME, AW_CITIZEN_LAST_LOGIN, and AW_CITIZEN_TOTAL_TIME attributes are calculated by the universe server and cannot be modified by SDK applications.

EXAMPLE

int		rc;

aw_int_set (AW_CITIZEN_NUMBER, 0);
aw_string_set (AW_CITIZEN_NAME, "George");
aw_string_set (AW_CITIZEN_PASSWORD, "secret");
aw_string_set (AW_CITIZEN_EMAIL, "george@xyz.com");
aw_bool_set (AW_CITIZEN_BETA, FALSE);
if (rc = aw_citizen_add ())
  printf ("Unable to add citizen (reason %d)\n", rc);
else
  printf ("Citizen #%d added\n", aw_int (AW_CITIZEN_NUMBER));

SEE ALSO

aw_citizen_attributes_by_name
aw_citizen_attributes_by_number
aw_citizen_change
aw_citizen_delete
aw_citizen_next
aw_citizen_previous