public class LobbyRegistry extends Object implements LobbyProvider
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 = <universal game identifier>
foolobby.name = <human readable lobby name>
foolobby.config1 = some config value
foolobby.config2 = some other config value
barlobby.mgrclass = com.threerings.micasa.lobby.LobbyManager
barlobby.ugi = <universal game identifier>
barlobby.name = <human readable lobby name>
...
This information will be loaded from the MiCasa server configuration which means that it should
live in 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,dice
As 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 and Description |
|---|
LobbyRegistry(com.threerings.presents.server.InvocationManager invmgr) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
@Inject public LobbyRegistry(com.threerings.presents.server.InvocationManager invmgr)
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 LobbyProviderpublic void getLobbies(com.threerings.presents.data.ClientObject caller,
String category,
LobbyService.LobbiesListener listener)
getLobbies in interface LobbyProviderCopyright © 2015. All rights reserved.