From e7bc462545c869f0705f6532b9e5177a3000c2ad Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 9 Oct 2001 19:24:11 +0000 Subject: [PATCH] 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 --- .../micasa/lobby/LobbyRegistry.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/micasa/lobby/LobbyRegistry.java b/src/java/com/threerings/micasa/lobby/LobbyRegistry.java index d924071c7..c2b715ac6 100644 --- a/src/java/com/threerings/micasa/lobby/LobbyRegistry.java +++ b/src/java/com/threerings/micasa/lobby/LobbyRegistry.java @@ -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; @@ -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 * creates and initializes the lobby manager. @@ -180,6 +188,12 @@ public class LobbyRegistry implements LobbyCodes // create a lobby record 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 StringTokenizer tok = new StringTokenizer(gameIdent, ","); while (tok.hasMoreTokens()) { @@ -209,6 +223,9 @@ public class LobbyRegistry implements LobbyCodes * form of category lists. */ protected HashMap _lobbies = new HashMap(); + /** The oid of the default lobby. */ + protected int _defLobbyOid = -1; + /** The configuration key for the lobby managers list. */ protected static final String LOBIDS_KEY = MiCasaServer.CONFIG_KEY + ".lobby_ids";