code: function (onDone) {
  		
  		// make sure lobby port is a number			
  		if (typeof SR.Settings.Project.lobbyPort === 'string')
  			SR.Settings.Project.lobbyPort = parseInt(SR.Settings.Project.lobbyPort);		
  		
  		// for lobby server with assigned port
  		if (SR.Settings.SERVER_INFO.type === 'lobby' && typeof UTIL.userSettings('lobbyPort') === 'number')
  			return UTIL.safeCall(onDone, UTIL.userSettings('lobbyPort'));		
  		
  		// assign specific port for monitor
  		if (SR.Settings.SERVER_INFO.type === 'monitor')
  			return UTIL.safeCall(onDone, SR.Settings.PORT_MONITOR);
  	
  		// for app servers or for unassigned lobby server, we need to get an available port from monitor server	
  
  		// NOTE: we get up to 10 ports per server (lobby, app, entry)
  		var size = (SR.Settings.SERVER_INFO.type === 'entry' ? 1 : SR.Settings.PORT_RESERVED_SIZE);
  		
  		UTIL.getLocalPort(function (port) {
  			if (port === 0) {
  				LOG.error('cannot get valid port, cannot start server', l_name);
  				UTIL.safeCall(onDone, false);
  				return l_dispose();
  			}
  			
  			LOG.sys('get monitor assigned port(s): ' + port, l_name);
  			
  			// return only the first one
  			UTIL.safeCall(onDone, (typeof port === 'number' ? port : port[0]));
  		}, size);
  	}
docs: get main server port the rules are: 1. for lobby with assigned port, use the assigned port in project's settings.js 2. monitor server: port is assigned in SR.Settings.PORT_MONITOR 3. for all else (app servers or unassigned lobby), port is assigned by monitor server (valid for local host) determine server port