|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.micasa.lobby.LobbyRegistry
public class LobbyRegistry
The lobby registry is the primary class that coordinates the lobby services on the client. It sets up the necessary invocation services and keeps track of the lobbies in operation on the server. Only one lobby registry should be created on a server.
Presently, the lobby registry is configured with lobbies via the server configuration. An example configuration follows:
lobby_ids = foolobby, barlobby, bazlobby foolobby.mgrclass = com.threerings.micasa.lobby.LobbyManager foolobby.ugi =This information will be loaded from the MiCasa server configuration which means that it should live infoolobby.name = foolobby.config1 = some config value foolobby.config2 = some other config value barlobby.mgrclass = com.threerings.micasa.lobby.LobbyManager barlobby.ugi = barlobby.name = ...
rsrc/config/micasa/server.properties somwhere in the classpath where it
will override the default MiCasa server properties file.
The UGI or universal game identifier is a string that is used to uniquely
identify every type of game and also to classify it according to meaningful keywords. It is best
described with a few examples:
backgammon,board,strategy spades,card,partner yahtzee,diceAs you can see, a UGI should start with an identifier uniquely identifying the type of game and can be followed by a list of keywords that classify it as a member of a particular category of games (eg. board, card, dice, partner game, strategy game). A game can belong to multiple categories.
As long as the UGIs in use by a particular server make some kind of sense, the client will be able to use them to search for lobbies containing games of similar types using the provided facilities.
| Constructor Summary | |
|---|---|
LobbyRegistry(com.threerings.presents.server.InvocationManager invmgr)
|
|
| Method Summary | |
|---|---|
String[] |
getCategories(com.threerings.crowd.data.BodyObject requester)
Returns an array containing the category identifiers of all the categories in which lobbies have been registered with the registry. |
void |
getCategories(com.threerings.presents.data.ClientObject caller,
LobbyService.CategoriesListener listener)
Processes a request by the client to obtain a list of the lobby categories available on this server. |
int |
getDefaultLobbyOid()
Returns the oid of the default lobby. |
void |
getLobbies(com.threerings.crowd.data.BodyObject requester,
String category,
List<Lobby> target)
Returns information about all lobbies hosting games in the specified category. |
void |
getLobbies(com.threerings.presents.data.ClientObject caller,
String category,
LobbyService.LobbiesListener listener)
Processes a request by the client to obtain a list of lobbies matching the supplied category string. |
void |
init()
Initializes the registry, creating our default lobbies. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@Inject public LobbyRegistry(com.threerings.presents.server.InvocationManager invmgr)
| Method Detail |
|---|
public void init()
public int getDefaultLobbyOid()
public void getLobbies(com.threerings.crowd.data.BodyObject requester,
String category,
List<Lobby> target)
requester - the body object of the client requesting the lobby list (which can be used
to filter the list based on their capabilities).category - the category of game for which the lobbies are desired.target - the list into which the matching lobbies will be deposited.public String[] getCategories(com.threerings.crowd.data.BodyObject requester)
requester - the body object of the client requesting the category list (which can be
used to filter the list based on their capabilities).
public void getCategories(com.threerings.presents.data.ClientObject caller,
LobbyService.CategoriesListener listener)
getCategories in interface LobbyProvider
public void getLobbies(com.threerings.presents.data.ClientObject caller,
String category,
LobbyService.LobbiesListener listener)
getLobbies in interface LobbyProvider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||