If we're going to do this, I guess we're going to do it properly. Nixed the
notion of a global group (though we implicitly define one in InvocationCodes) added a mechanism for directors (which generally handle the client side of invocation services) to register their interest in bootstrap service groups so that the whole goddamned complex business can happen magically behind the scenes. If you instantiate a director, it will automatically register interest in the service group it needs and everything will work. If you don't use the director code, you don't get the services and you can safely exclude all of that code from your client even though the services are still in use on the server (and presumably used by some other types of clients). This is going to break all the builds, which I'll soon fix. Then I'll go write all this in ActionScript. Yay! git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4552 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -34,17 +34,16 @@ import com.threerings.presents.data.TimeBaseObject;
|
||||
import com.threerings.presents.dobj.RootDObjectManager;
|
||||
|
||||
/**
|
||||
* Provides the server-side of the time base services. The time base
|
||||
* services provide a means by which delta times can be sent over the
|
||||
* network which are expanded based on a shared base time into full time
|
||||
* stamps.
|
||||
* Provides the server-side of the time base services. The time base services provide a means by
|
||||
* which delta times can be sent over the network which are expanded based on a shared base time
|
||||
* into full time stamps.
|
||||
*/
|
||||
public class TimeBaseProvider
|
||||
implements InvocationProvider, TimeBaseCodes
|
||||
{
|
||||
/**
|
||||
* Registers the time provider with the appropriate managers. Called
|
||||
* by the presents server at startup.
|
||||
* Registers the time provider with the appropriate managers. Called by the presents server at
|
||||
* startup.
|
||||
*/
|
||||
public static void init (InvocationManager invmgr, RootDObjectManager omgr)
|
||||
{
|
||||
@@ -53,13 +52,12 @@ public class TimeBaseProvider
|
||||
_omgr = omgr;
|
||||
|
||||
// register a provider instance
|
||||
invmgr.registerDispatcher(
|
||||
new TimeBaseDispatcher(new TimeBaseProvider()), true);
|
||||
invmgr.registerDispatcher(new TimeBaseDispatcher(new TimeBaseProvider()), GLOBAL_GROUP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a time base object which can subsequently be fetched by the
|
||||
* client and used to send delta times.
|
||||
* Creates a time base object which can subsequently be fetched by the client and used to send
|
||||
* delta times.
|
||||
*
|
||||
* @param timeBase the name of the time base to create.
|
||||
*
|
||||
@@ -73,8 +71,8 @@ public class TimeBaseProvider
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the named timebase object, or null if no time base object
|
||||
* has been created with that name.
|
||||
* Returns the named timebase object, or null if no time base object has been created with that
|
||||
* name.
|
||||
*/
|
||||
public static TimeBaseObject getTimeBase (String timeBase)
|
||||
{
|
||||
@@ -82,11 +80,9 @@ public class TimeBaseProvider
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes a request from a client to fetch the oid of the specified
|
||||
* time object.
|
||||
* Processes a request from a client to fetch the oid of the specified time object.
|
||||
*/
|
||||
public void getTimeOid (
|
||||
ClientObject source, String timeBase, GotTimeBaseListener listener)
|
||||
public void getTimeOid (ClientObject source, String timeBase, GotTimeBaseListener listener)
|
||||
throws InvocationException
|
||||
{
|
||||
// look up the time base object in question
|
||||
|
||||
Reference in New Issue
Block a user