Aw citizen change

From ActiveWiki
Revision as of 14:01, 1 November 2008 by Macavity (talk | contribs) (Cleanup)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Minimum requirements
Added in version 2.1
SDKbuild 13


int aw_citizen_change (void)

Description

Changes the attributes of an existing citizen.

Callback

AW_CALLBACK_CITIZEN_RESULT

Notes

Since all attributes are changed, all attributes must be set to meaningful values before calling this method. Note that aw_citizen_attributes_by_name, aw_citizen_attributes_by_number, aw_citizen_next, and aw_citizen_previous retrieve and set these attributes automatically.

All citizen attributes are visible to universe administrators from the citizens dialog within the Active Worlds browser.

Arguments

None

Argument attributes

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

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.

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_NOT_AVAILABLE (1)
Instance must be owned by the root account (citizen #1 - universe administrator).
RC_UNAUTHORIZED (2)
Instance must be owned by the root account (citizen #1 - universe administrator).
RC_NO_SUCH_CITIZEN (2)
RC_NAME_ALREADY_USED (2)
RC_EMAIL_TOO_SHORT (2)
RC_EMAIL_TOO_LONG (2)
RC_EMAIL_STARTS_WITH_BLANK (2)
RC_EMAIL_ENDS_WITH_BLANK (2)
RC_EMAIL_MISSING_DOT (2)
RC_EMAIL_CONTAINS_INVALID_CHAR (2)
RC_EMAIL_MISSING_AT (2)
RC_NAME_TOO_SHORT (2)
RC_NAME_TOO_LONG (2)
RC_NAME_CONTAINS_NONALPHANUMERIC_CHAR (2)
RC_NO_SUCH_CITIZEN (2)
Name ended with a " (double-quote).
RC_NAME_ENDS_WITH_BLANK (2)
RC_NAME_CONTAINS_INVALID_BLANK (2)

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

(2) Returned by the universe server.

Returned attributes

AW_CITIZEN_NUMBER

Usage

int password_change (int citizen, char *newpass)
{
  int rc;
  
  rc = aw_citizen_attributes_by_number (citizen);
  if (rc != RC_SUCCESS)
      return rc;
  
  aw_string_set (AW_CITIZEN_PASSWORD, newpass);
  
  return aw_citizen_change ();
}

See also