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.


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


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.


A8  C 


Very slow (up to 5 seconds)



if (session_connect("office",""))
	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