session_connect(STRING* session,STRING* hostname)

Connects a client to a running multiplayer session. The first parameter contains the name of the session, the second parameter gives the name, domain or IP address of the server. This way, level or zone changing in a multiplayer environment can easily be performed.

Returns:

0 if the new connection could not be established, otherwise nonzero.

Parameters:

session Name of the session (STRING* or char*).
hostname Domain or IP Address (STRING* or char*) , or NULL for a session on the same machine.

Edition

A8  C 

Speed:

Very slow (up to 5 seconds)

Remarks:

Example:

if (session_connect("office","127.0.0.1"))
{
	level_load("office.wmb"); // load level anew
	while (dplay_status < 6) wait(1); // wait until the level state is received from the server
	player_create(); // user function to place the player into the level
}

See also:

session_open, session_close, connection, dplay_status, ftp, http

► latest version online