Files
narya/src/java/com/threerings/whirled/zone/client/ZoneService.java
T
Michael Bayne fb74c17fd7 Modified moveTo() so that other entities than the ZoneDirector can call it
and receive the callback (like the NPPirate).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1258 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-16 17:36:17 +00:00

40 lines
1.5 KiB
Java

//
// $Id: ZoneService.java,v 1.4 2002/04/16 17:36:17 mdb Exp $
package com.threerings.whirled.zone.client;
import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationDirector;
import com.threerings.whirled.zone.Log;
import com.threerings.whirled.zone.data.ZoneCodes;
/**
* The zone service class provides the client interface to the zone
* related invocation services (e.g. moving between zones).
*/
public class ZoneService implements ZoneCodes
{
/**
* Requests that that this client's body be moved to the specified
* scene in the specified zone.
*
* @param zoneId the zone id to which we want to move.
* @param sceneId the scene id to which we want to move.
* @param sceneVers the version number of the scene object that we
* have in our local repository.
* @param rsptarget the object that will receive the callback when the
* request succeeds or fails.
*/
public static void moveTo (Client client, int zoneId, int sceneId,
int sceneVers, Object rsptarget)
{
InvocationDirector invdir = client.getInvocationDirector();
Object[] args = new Object[] {
new Integer(zoneId), new Integer(sceneId), new Integer(sceneVers) };
invdir.invoke(MODULE_NAME, MOVE_TO_REQUEST, args, rsptarget);
Log.info("Sent moveTo request [zone=" + zoneId +
", scene=" + sceneId + ", version=" + sceneVers + "].");
}
}