Keep track of a "default" lobby which is presently the first one created.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@420 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-10-09 19:24:11 +00:00
parent 758bac6f28
commit e7bc462545
@@ -1,5 +1,5 @@
// //
// $Id: LobbyRegistry.java,v 1.3 2001/10/09 00:48:34 mdb Exp $ // $Id: LobbyRegistry.java,v 1.4 2001/10/09 19:24:11 mdb Exp $
package com.threerings.micasa.lobby; package com.threerings.micasa.lobby;
@@ -93,6 +93,14 @@ public class LobbyRegistry implements LobbyCodes
} }
} }
/**
* Returns the oid of the default lobby.
*/
public int getDefaultLobbyOid ()
{
return _defLobbyOid;
}
/** /**
* Extracts the properties for a lobby from the server config and * Extracts the properties for a lobby from the server config and
* creates and initializes the lobby manager. * creates and initializes the lobby manager.
@@ -180,6 +188,12 @@ public class LobbyRegistry implements LobbyCodes
// create a lobby record // create a lobby record
Lobby record = new Lobby(placeOid, gameIdent, name); Lobby record = new Lobby(placeOid, gameIdent, name);
// if we don't already have a default lobby, this one is the big
// winner
if (_defLobbyOid == -1) {
_defLobbyOid = placeOid;
}
// and register it in all the right lobby tables // and register it in all the right lobby tables
StringTokenizer tok = new StringTokenizer(gameIdent, ","); StringTokenizer tok = new StringTokenizer(gameIdent, ",");
while (tok.hasMoreTokens()) { while (tok.hasMoreTokens()) {
@@ -209,6 +223,9 @@ public class LobbyRegistry implements LobbyCodes
* form of category lists. */ * form of category lists. */
protected HashMap _lobbies = new HashMap(); protected HashMap _lobbies = new HashMap();
/** The oid of the default lobby. */
protected int _defLobbyOid = -1;
/** The configuration key for the lobby managers list. */ /** The configuration key for the lobby managers list. */
protected static final String LOBIDS_KEY = protected static final String LOBIDS_KEY =
MiCasaServer.CONFIG_KEY + ".lobby_ids"; MiCasaServer.CONFIG_KEY + ".lobby_ids";