Aw world instance get

From ActiveWiki
Jump to navigation Jump to search


Minimum requirements
Added in version 4.1
SDKbuild 58


int aw_world_instance_get (int citizen)

Description

Query the world instance that a citizen is assigned to.

Callback

AW_CALLBACK_WORLD_INSTANCE

Notes

This method requires that the world instance plugin is installed.

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 world is down.
RC_UNAUTHORIZED (1) (2)
Only world server administration instances or those owned by a caretaker (i.e. aw_bool (AW_WORLD_CARETAKER_CAPABILITY) returns 1) may use this method.
RC_NO_SUCH_CITIZEN (2)
No user with a matching citizen number was found in the world, or citizen number was specified as 0 (i.e. tourists can not be assigned to a world instance).
RC_PLUGIN_NOT_AVAILABLE (2)
World instance plugin is not installed.
RC_WORLD_INSTANCE_INVALID (2)
No instance with a matching id was found for the current world.

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

(2) Returned by the world server.

Returned attributes

AW_AVATAR_CITIZEN
AW_AVATAR_WORLD_INSTANCE

Usage

Get instance of citizen #4711.

if (aw_world_instance_get (4711) == RC_SUCCESS)
  printf ("Citizen 4711 is assigned to world instance %d\n",
    aw_int (AW_AVATAR_WORLD_INSTANCE));

See also