If you want to start a new multiplayer game you need to create a new session. For this you can use the following routine:
mplay_session_create(sesname,playnumb,playername) creates a new session on the current connection. sesname is a string indicating the name of the session. playnumb is a number that indicates the maximal number of players allowed in this game (use 0 for an arbitrary number). playname is your name as player. Returns whether successful.
One instance of the game must create the session. The other instance(s) of the game should join this session. This is slightly more complicated. You first need to look at what sessions are available and then choose the one to join. There are three important routines for this:
mplay_session_find() searches for all sessions that still accept players and returns the number of sessions found.
mplay_session_name(numb) returns the name of session number numb (0 is the first session). This routine can only be called after calling the previous routine.
mplay_session_join(numb,playername) makes you join session number numb (0 is the first session). playername is your name as a player. Returns whether successful.
There is one more routine that can change the session mode. It should be called before creating a session:
mplay_session_mode(move) sets whether or not to move the session host to another computer when the host ends. move should either be true or false (the default).
To check the status of the current session you can use the following function
mplay_session_status() returns the status of the current session. 0 = no session, 1 = created session, 2 = joined session.
A player can stop a session using the following routine:
mplay_session_end() ends the session for this player.