The great invocation services rethink of 2002! Rearchitected the remote
method invocation services and converted everything to the new style. Could this be my biggest checkin ever? git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1642 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,57 +1,31 @@
|
||||
//
|
||||
// $Id: LobbyProvider.java,v 1.4 2002/07/23 05:54:52 mdb Exp $
|
||||
// $Id: LobbyProvider.java,v 1.5 2002/08/14 19:07:49 mdb Exp $
|
||||
|
||||
package com.threerings.micasa.lobby;
|
||||
|
||||
import com.threerings.crowd.data.BodyObject;
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
import com.threerings.presents.server.InvocationProvider;
|
||||
import com.threerings.util.StreamableArrayList;
|
||||
|
||||
import com.threerings.micasa.lobby.LobbyService.CategoriesListener;
|
||||
import com.threerings.micasa.lobby.LobbyService.LobbiesListener;
|
||||
|
||||
/**
|
||||
* Handles server side of lobby-related invocation services.
|
||||
* Provides access to the server-side implementation of the lobby
|
||||
* services.
|
||||
*/
|
||||
public class LobbyProvider
|
||||
extends InvocationProvider implements LobbyCodes
|
||||
public interface LobbyProvider extends InvocationProvider
|
||||
{
|
||||
/**
|
||||
* Constructs a lobby provider instance which will be used to handle
|
||||
* all lobby-related invocation service requests. This is
|
||||
* automatically taken care of by the lobby registry, so no other
|
||||
* entity need instantiate and register a lobby provider.
|
||||
*
|
||||
* @param lobreq a reference to the lobby registry active in this
|
||||
* server.
|
||||
*/
|
||||
public LobbyProvider (LobbyRegistry lobreg)
|
||||
{
|
||||
_lobreg = lobreg;
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes a request by the client to obtain a list of the lobby
|
||||
* categories available on this server.
|
||||
*/
|
||||
public void handleGetCategoriesRequest (
|
||||
BodyObject source, int invid)
|
||||
{
|
||||
String[] cats = _lobreg.getCategories(source);
|
||||
// we have to cast the array to an object to avoid having the
|
||||
// compiler pick the version of sendResponse that takes Object[]
|
||||
sendResponse(source, invid, GOT_CATEGORIES_RESPONSE, (Object)cats);
|
||||
}
|
||||
public void getCategories (ClientObject caller,
|
||||
CategoriesListener listener);
|
||||
|
||||
/**
|
||||
* Processes a request by the client to obtain a list of lobbies
|
||||
* matching the supplied category string.
|
||||
*/
|
||||
public void handleGetLobbiesRequest (
|
||||
BodyObject source, int invid, String category)
|
||||
{
|
||||
StreamableArrayList list = new StreamableArrayList();
|
||||
_lobreg.getLobbies(source, category, list);
|
||||
sendResponse(source, invid, GOT_LOBBIES_RESPONSE, list);
|
||||
}
|
||||
|
||||
/** A reference to the lobby registry. */
|
||||
protected LobbyRegistry _lobreg;
|
||||
public void getLobbies (ClientObject caller, String category,
|
||||
LobbiesListener listener);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user