Aw license add

From ActiveWiki
Jump to: navigation, search


Minimum requirements
Added in version 2.1
SDKbuild 13


int aw_license_add (void)

Description

Creates a new world license.

Callback

AW_CALLBACK_LICENSE_RESULT

Arguments

None

Argument attributes

AW_LICENSE_ALLOW_TOURISTS
AW_LICENSE_COMMENT
(Optional)
AW_LICENSE_EMAIL
AW_LICENSE_EXPIRATION_TIME
AW_LICENSE_HIDDEN
AW_LICENSE_NAME
AW_LICENSE_PASSWORD
AW_LICENSE_PLUGINS
AW_LICENSE_RANGE
AW_LICENSE_USERS
AW_LICENSE_VOIP

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_LICENSE (2)
Name was zero length, contained a space, began with a number, or is already used.
RC_UNABLE_TO_INSERT_NAME (2)
Database error.

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

(2) Returned by the universe server.

Returned attributes

None

Usage

Create a new license for the world "aw".

int rc;

aw_string_set (AW_LICENSE_NAME, "aw");
aw_string_set (AW_LICENSE_PASSWORD, "secret");
aw_int_set (AW_LICENSE_USERS, 50);
aw_int_set (AW_LICENSE_RANGE, 10);
aw_string_set (AW_LICENSE_EMAIL, "aw@activeworlds.com");
aw_string_set (AW_LICENSE_COMMENT, "This is the AW home world");
aw_int_set (AW_LICENSE_EXPIRATION_TIME, 0);
aw_bool_set (AW_LICENSE_HIDDEN, 0);
aw_bool_set (AW_LICENSE_ALLOW_TOURISTS, 1);
aw_bool_set (AW_LICENSE_VOIP, 1;
aw_bool_set (AW_LICENSE_PLUGINS, 0);

rc = aw_license_add ()
if (rc != RC_SUCCESS)
  printf ("Unable to add license (reason %d)\n", rc);
else
  puts ("License added");

See also