context: function initMPHost (parentWindow, gameName, welcomeMessage, profileName){	// Set up the server	var server = createServer();	// Welcome message	server.welcomeMessage = welcomeMessage;	// Server Name	server.serverName = gameName;	// Host Name	server.serverPlayerName = profileName;                              		// start listening	var success = server.open();	if (!success)	{		messageBox(400, 200, "Failed to start server. Please review the logfile for more information on the problem.", "Problem", 2, new Array(), new Array());		return 1;	}	else	{		console.write ("Host has started listening for client connections.");		// Switch to Session Setup screen.		sessionType = "Host";		openSessionSetup (parentWindow);	}	// -------------------------	// INCOMING CONNECTIONS	// -------------------------	server.onClientConnect = function (event) 	{		console.write ("Client connected.");		console.write("A new client has successfully connected! ID: " + event.id + ", Name: " + event.name + ", Session: " + event.session);		// Assign newly connected client to next available slot.			var playerSlot = g_GameAttributes.getOpenSlot();		playerSlot.assignToSession (event.session);console.write (event.id);		// Set player slot to new player's name.		pushItem ("pgSessionSetupP" + (event.id), event.name);	}		server.onClientDisconnect = function (event) 	{		// Client has disconnected; free their slot.		g_GameAttributes.slots[event.id].assignOpen();		var result = setCurrItemValue ("pgSessionSetupP" + event.id, "Open");		messageBox(400, 200, "Client " + event.name + "(" + event.id + ") disconnected from " + event.session + ".", "Client Disconnected", 2, new Array(), new Array());	}	        	server.onChat = function (event) 	{		messageBox(400, 200, "(" + event.sender + ")" + event.message, "Host Chat Message", 2, new Array(), new Array());	}	// Need "waiting for more players to join and start game" code here}
meta: 1070	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1070/43323342db248d6227b69129e134b6eea35acbfa/functions_page_pregame_multiplayer.js/clean/binaries/data/mods/official/gui/test/functions_page_pregame_multiplayer.js