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,69 +1,53 @@
|
||||
//
|
||||
// $Id: SpotService.java,v 1.10 2002/07/22 22:54:04 ray Exp $
|
||||
// $Id: SpotService.java,v 1.11 2002/08/14 19:07:57 mdb Exp $
|
||||
|
||||
package com.threerings.whirled.spot.client;
|
||||
|
||||
import com.threerings.presents.client.Client;
|
||||
import com.threerings.presents.client.InvocationDirector;
|
||||
import com.threerings.presents.client.InvocationService;
|
||||
|
||||
import com.threerings.whirled.client.SceneDirector;
|
||||
|
||||
import com.threerings.whirled.spot.Log;
|
||||
import com.threerings.whirled.spot.data.SpotCodes;
|
||||
import com.threerings.whirled.client.SceneService.SceneMoveListener;
|
||||
|
||||
/**
|
||||
* Provides a mechanism by which the client can request to move between
|
||||
* Defines the mechanism by which the client can request to move between
|
||||
* locations within a scene and between scenes (taking exit and entry
|
||||
* locations into account). These services should not be used directly,
|
||||
* but instead should be accessed via the {@link SpotSceneDirector}.
|
||||
*/
|
||||
public class SpotService implements SpotCodes
|
||||
public interface SpotService extends InvocationService
|
||||
{
|
||||
/**
|
||||
* Requests to traverse the specified portal.
|
||||
*/
|
||||
public static void traversePortal (
|
||||
public void traversePortal (
|
||||
Client client, int sceneId, int portalId, int sceneVer,
|
||||
Object rsptarget)
|
||||
SceneMoveListener listener);
|
||||
|
||||
/**
|
||||
* Used to communicate responses to a {@link #changeLoc} request.
|
||||
*/
|
||||
public static interface ChangeLocListener extends InvocationListener
|
||||
{
|
||||
InvocationDirector invdir = client.getInvocationDirector();
|
||||
Object[] args = new Object[] {
|
||||
new Integer(sceneId), new Integer(portalId),
|
||||
new Integer(sceneVer) };
|
||||
invdir.invoke(MODULE_NAME, TRAVERSE_PORTAL_REQUEST, args, rsptarget);
|
||||
Log.debug("Sent traversePortal request [sceneId=" + sceneId +
|
||||
", portalId=" + portalId + ", sceneVer=" + sceneVer + "].");
|
||||
/**
|
||||
* Called when the change location request succeeded.
|
||||
*
|
||||
* @param clusterOid the object id of the cluster object
|
||||
* associated with the new location.
|
||||
*/
|
||||
public void changeLocSucceeded (int clusterOid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests that this client's body be made to occupy the specified
|
||||
* location.
|
||||
*/
|
||||
public static void changeLoc (Client client, int sceneId, int locationId,
|
||||
Object rsptarget)
|
||||
{
|
||||
InvocationDirector invdir = client.getInvocationDirector();
|
||||
Object[] args = new Object[] { new Integer(sceneId),
|
||||
new Integer(locationId) };
|
||||
invdir.invoke(MODULE_NAME, CHANGE_LOC_REQUEST, args, rsptarget);
|
||||
Log.debug("Sent changeLoc request [sceneId=" + sceneId +
|
||||
", locId=" + locationId + "].");
|
||||
}
|
||||
public void changeLoc (Client client, int sceneId, int locationId,
|
||||
ChangeLocListener listener);
|
||||
|
||||
/**
|
||||
* Requests that the supplied message be delivered to listeners in the
|
||||
* cluster to which the specified location belongs.
|
||||
*/
|
||||
public static void clusterSpeak (
|
||||
Client client, int sceneId, int locationId, String message,
|
||||
byte mode, SpotSceneDirector rsptarget)
|
||||
{
|
||||
InvocationDirector invdir = client.getInvocationDirector();
|
||||
Object[] args = new Object[] {
|
||||
new Integer(sceneId), new Integer(locationId), message,
|
||||
new Byte(mode) };
|
||||
invdir.invoke(MODULE_NAME, CLUSTER_SPEAK_REQUEST, args, rsptarget);
|
||||
Log.debug("Sent clusterSpeak request [sceneId=" + sceneId +
|
||||
", locId=" + locationId + ", message=" + message + "].");
|
||||
}
|
||||
public void clusterSpeak (Client client, int sceneId, int locationId,
|
||||
String message, byte mode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user