Aw license change

From ActiveWiki
Jump to navigation Jump to search


Minimum requirements
Added in version 2.1
SDKbuild 13


int aw_license_change (void)

Description

Changes the attributes of an existing world license.

Callback

AW_CALLBACK_LICENSE_RESULT

Notes

Set AW_LICENSE_NAME to specify which license is being changed. Note that aw_license_attributes, aw_license_next, and aw_license_previous will set AW_LICENSE_NAME automatically.

Arguments

None

Argument attributes

AW_LICENSE_ALLOW_TOURISTS
AW_LICENSE_COMMENT
AW_LICENSE_CREATION_TIME
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)
RC_DATABASE_UPDATE_FAILED (2)
Database error.

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

(2) Returned by the universe server.

Returned attributes

None

Usage

Increase the user maximum for "aw" by 10 users.

int rc;

if (aw_license_attributes ("aw") != RC_SUCCESS)
{
  puts ("No such license");
  return;
}

aw_int_set (AW_LICENSE_USERS, aw_int (AW_LICENSE_USERS) + 10);

rc = aw_license_change ();
if (rc != RC_SUCCESS)
  printf ("Unable to change license (reason %d)\n", rc);
else
  puts ("License changed");

See also