Aw enter

From ActiveWiki
Revision as of 17:35, 9 September 2009 by PehJota (talk | contribs) (→‎Return values: Added RC_NO_SUCH_SESSION)
(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_enter (char *world)

Description

Enters a world. The current world, if any, is automatically exited.

Callback

AW_CALLBACK_ENTER

Notes

The event AW_EVENT_WORLD_ATTRIBUTES will be triggered by a successful call to this method. In a synchronous call to aw_enter, all the world attributes will be available after the successful completion of the call.

For version 3.1 and later: The prototype for this function has changed. Previous versions had a second avatars argument which is now obsolete. Existing SDK applications that call aw_enter will need to be changed to remove this second argument.

Arguments

world
Name of world to enter.

Argument attributes

AW_ENTER_GLOBAL

Return values

RC_SUCCESS (1) (3)
RC_NOT_INITIALIZED (1)
RC_NO_INSTANCE (1)
RC_NO_CONNECTION (1)
RC_NO_SUCH_WORLD (2)
If the world lookup failed.
RC_NO_SUCH_WORLD (3)
If no world with a matching name is running on the world server.
RC_EJECTED (3)
RC_NOT_WELCOME (3)
The calling instance must be owned by a citizen who has bot rights in the world.
RC_NO_SUCH_SESSION (1)
If you have multiple network interface cards (NIC) or a single NIC with multiple IP addresses and aw_init was called instead of aw_init_bind.

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

(2) Returned by the universe server.

(3) Returned by the world server.

Returned attributes

AW_WORLD_NAME

Usage

int rc;

rc = aw_enter ("aw");
if (rc != RC_SUCCESS)
{
  printf ("Unable to enter world (reason %d)\n", rc);
  return;
}

puts (aw_string (AW_WORLD_WELCOME_MESSAGE));

See also