Created services for distributing delta times over the network which are
interpreted according to a globally established base time. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1404 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// $Id: TimeBaseService.java,v 1.1 2002/05/28 23:14:06 mdb Exp $
|
||||
|
||||
package com.threerings.presents.client;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.client.Client;
|
||||
import com.threerings.presents.client.InvocationDirector;
|
||||
import com.threerings.presents.data.TimeBaseCodes;
|
||||
|
||||
/**
|
||||
* Provides a means by which to obtain access to a time base object which
|
||||
* can be used to convert delta times into absolute times.
|
||||
*/
|
||||
public class TimeBaseService
|
||||
implements TimeBaseCodes
|
||||
{
|
||||
/**
|
||||
* Requests the oid of the specified time base object be returned. The
|
||||
* supplied response target must provide two methods to handle the
|
||||
* responses generated by this request:
|
||||
*
|
||||
* <pre>
|
||||
* public void handleTimdOidResponse (int invid, int timeOid);
|
||||
* public void handleGetTimeOidFailed (int invid, String reason);
|
||||
* </pre>
|
||||
*/
|
||||
public static void getTimeOid (
|
||||
Client client, String timeBase, Object rsptarget)
|
||||
{
|
||||
InvocationDirector invdir = client.getInvocationDirector();
|
||||
invdir.invoke(MODULE_NAME, GET_TIME_OID_REQUEST,
|
||||
new Object[] { timeBase }, rsptarget);
|
||||
Log.debug("Sent getTimeOid request [timeBase=" + timeBase + "].");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user