session_connect(STRING* session,STRING* hostname)

Switches to a different session on another server. The first string parameter contains the name of the new session, the second parameter gives the name, domain or IP address of the new 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
hostname Domain or IP Address, or NULL for a session on the same machine

Edition

 P 

Speed:

Slow

Remarks:

Example:

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

See also:

send_string, session_open