Aw server admin

From ActiveWiki
Jump to navigation Jump to search


Minimum requirements
Added in version 3.1
SDKbuild 18
Worldbuild 28


int aw_server_admin (const char *domain, int port, char *password, void **instance)

Description

Creates an instance in world server administration mode.

Callback

AW_CALLBACK_ADMIN

Notes

If connecting to a world server running on the same host as the SDK application then the password is not required and may be set to NULL. If connecting to another host then the password is required.

This is how the password is specified in world.ini:

[server]
password=myadminpw

Note that if no password has been specified then it will only accept connections from the same host.

Arguments

domain
Domain name of the server ("server.someplace.com") or an IP address in dotted quad form ("192.168.0.1"). If set to NULL then it will use the domain name "localhost".
port
Port number of the world server. If set to 0 then it will use port 7777.
password
Password for administration mode. May be set to NULL or an empty string for connections to the same host.
instance
Pointer to where an instance pointer is returned. May be set to NULL if not needed.

Argument attributes

None

Return values

RC_SUCCESS (1)
RC_NOT_INITIALIZED (1)
RC_CANT_RESOLVE_UNIVERSE_HOST (1)
WSAECONNRESET (1)
Connection was reset by world.
RC_TIMEOUT
Handshake timed out.
RC_INVALID_PASSWORD
Invalid administration mode password.

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

Returned attributes

AW_SERVER_BUILD
AW_WORLD_BUILD_NUMBER
Only set after a successful login.

Usage

int rc;
void *instance;

rc = aw_server_admin (NULL, 0, NULL, &instance);
if (rc != RC_SUCCESS)
  printf ("Unable to connect to local server (reason %d)\n", rc);

See also