Aw server world add
Minimum requirements | ||
---|---|---|
Added in version 3.1 | ||
SDK | build 18 | |
World | build 28 |
int aw_server_world_add (void)
Description
Adds a new world configuration to a world server.
Callback
AW_CALLBACK_ADMIN_WORLD_RESULT
Notes
If successful then an AW_EVENT_ADMIN_WORLD_INFO with information about the world configuration is sent to all the admin instances.
For world build 96, or later: The world server will automatically reset world attributes and build a "street1.rwx" object at ground zero after adding the configuration.
Arguments
None
Argument attributes
Return values
- RC_SUCCESS (1) (2)
- RC_NOT_INITIALIZED (1)
- RC_NO_INSTANCE (1)
- RC_NO_CONNECTION (1)
- Network connection to the world is down.
- RC_UNAUTHORIZED (2)
- Only world server administration instances are allowed to use this method.
- RC_WORLD_ALREADY_EXISTS (2) (3)
- Name already exists.
- RC_DATABASE_ERROR (2)
- Unable to add world configuration to the database.
(1) Possible return values when a callback is installed.
(2) Returned from the world server; and is passed to any installed callback handler.
(3) Not used in version 4.1 and later.
Returned attributes
- AW_SERVER_ID
- If aw_server_world_add completes with RC_SUCCESS then this attribute will contain the id of the new world configuration.
- AW_SERVER_INSTANCE
- AW_SERVER_NAME
Usage
Add a new world configuration to the world server.
aw_bool_set (AW_SERVER_ENABLED, 1); aw_string_set (AW_SERVER_NAME, "myworld"); aw_string_set (AW_SERVER_PASSWORD, "mypass"); aw_string_set (AW_SERVER_REGISTRY, "registry.txt"); aw_string_set (AW_SERVER_CARETAKERS, "123456"); rc = aw_server_world_add (); if (rc != RC_SUCCESS) printf ("Unable to add new world (reason %d)\n", rc); else printf ("World added successfully.\n");