agentId parameter and must notify
- * the service that the agent has been created using {@link BureauService#agentCreated}.
- * @param client the client receiving the request
- * @param agentId the id of the AgentObject that needs an Agent
- */
- function createAgent (agentId :int) :void;
+ // from Java interface BureauReceiver
+ function createAgent (arg1 :int) :void;
- /**
- * Destroys a previously created agent. Implementors should destroy the agent that was created
- * by the call to createAgent with the same agent id and must notify
- * the service that the agent has been created using {@link BureauService#agentDestroyed}.
- * @param client the client receiving the request
- * @param agentId the id of the AgentObject whose Agent
- * should be destroyed
- */
- function destroyAgent (agentId :int) :void;
+ // from Java interface BureauReceiver
+ function destroyAgent (arg1 :int) :void;
}
}
diff --git a/src/main/as/com/threerings/crowd/client/LocationDecoder.as b/src/main/as/com/threerings/crowd/client/LocationDecoder.as
index 487c7cf1a..b0f7dda34 100644
--- a/src/main/as/com/threerings/crowd/client/LocationDecoder.as
+++ b/src/main/as/com/threerings/crowd/client/LocationDecoder.as
@@ -21,7 +21,6 @@
package com.threerings.crowd.client {
-import com.threerings.crowd.client.LocationReceiver;
import com.threerings.presents.client.InvocationDecoder;
/**
@@ -45,19 +44,16 @@ public class LocationDecoder extends InvocationDecoder
this.receiver = receiver;
}
- // documentation inherited
- override public function getReceiverCode () :String
+ public override function getReceiverCode () :String
{
return RECEIVER_CODE;
}
- // documentation inherited
- override public function dispatchNotification (
- methodId :int, args :Array) :void
+ public override function dispatchNotification (methodId :int, args :Array) :void
{
switch (methodId) {
case FORCED_MOVE:
- (receiver as LocationReceiver).forcedMove(
+ LocationReceiver(receiver).forcedMove(
(args[0] as int)
);
return;
diff --git a/src/main/as/com/threerings/crowd/client/LocationReceiver.as b/src/main/as/com/threerings/crowd/client/LocationReceiver.as
index c3a8c93b9..e735756d5 100644
--- a/src/main/as/com/threerings/crowd/client/LocationReceiver.as
+++ b/src/main/as/com/threerings/crowd/client/LocationReceiver.as
@@ -23,18 +23,9 @@ package com.threerings.crowd.client {
import com.threerings.presents.client.InvocationReceiver;
-/**
- * Defines, for the location services, a set of notifications delivered
- * asynchronously by the server to the client.
- */
public interface LocationReceiver extends InvocationReceiver
{
- /**
- * Used to communicate a required move notification to the client. The
- * server will have removed the client from their existing location
- * and the client is then responsible for generating a {@link
- * LocationService#moveTo} request to move to the new location.
- */
- function forcedMove (placeId :int) :void;
+ // from Java interface LocationReceiver
+ function forcedMove (arg1 :int) :void;
}
}
diff --git a/src/main/java/com/threerings/presents/peer/server/PeerManager.java b/src/main/java/com/threerings/presents/peer/server/PeerManager.java
index 1490480ba..770d2d96c 100644
--- a/src/main/java/com/threerings/presents/peer/server/PeerManager.java
+++ b/src/main/java/com/threerings/presents/peer/server/PeerManager.java
@@ -569,7 +569,6 @@ public abstract class PeerManager
final DObjectAddress remote, final ResultListenerA few methods also use a "pattern" string parameter that is used to match a class name. * This is a dumbed down regular expression (to avoid many \.) where "*" means .* and no other * characters have special meaning. The pattern is also implicitly enclosed with ^$ so that the - * pattern must match the class name in its entirity. Callers will mostly use this to specify a + * pattern must match the class name in its entirety. Callers will mostly use this to specify a * prefix like "something*" or a suffix like "*something". */ public class ImportSet diff --git a/src/main/resources/com/threerings/presents/tools/decoder_as.tmpl b/src/main/resources/com/threerings/presents/tools/decoder_as.tmpl new file mode 100644 index 000000000..56ed55e5e --- /dev/null +++ b/src/main/resources/com/threerings/presents/tools/decoder_as.tmpl @@ -0,0 +1,51 @@ +package {{package}} { + +{{#imports}} +import {{this}}; +{{/imports}} + +/** + * Dispatches calls to a {@link {{name}}Receiver} instance. + */ +public class {{name}}Decoder extends InvocationDecoder +{ + /** The generated hash code used to identify this receiver class. */ + public static const RECEIVER_CODE :String = "{{receiver_code}}"; + +{{#methods}} + /** The method id used to dispatch {@link {{name}}Receiver#{{method.name}}} + * notifications. */ + public static const {{code}} :int = {{-index}}; + +{{/methods}} + /** + * Creates a decoder that may be registered to dispatch invocation + * service notifications to the specified receiver. + */ + public function {{name}}Decoder (receiver :{{name}}Receiver) + { + this.receiver = receiver; + } + + public override function getReceiverCode () :String + { + return RECEIVER_CODE; + } + + public override function dispatchNotification (methodId :int, args :Array) :void + { + switch (methodId) { +{{#methods}} + case {{code}}: + {{name}}Receiver(receiver).{{method.name}}( + {{getASUnwrappedArgList}} + ); + return; + +{{/methods}} + default: + super.dispatchNotification(methodId, args); + } + } +} +} diff --git a/src/main/resources/com/threerings/presents/tools/receiver_as.tmpl b/src/main/resources/com/threerings/presents/tools/receiver_as.tmpl new file mode 100644 index 000000000..e06e41074 --- /dev/null +++ b/src/main/resources/com/threerings/presents/tools/receiver_as.tmpl @@ -0,0 +1,17 @@ +package {{package}} { + +{{#imports}} +import {{this}}; +{{/imports}} + +public interface {{name}}Receiver extends InvocationReceiver +{ +{{#methods}} +{{^-first}} + +{{/-first}} + // from Java interface {{name}}Receiver + function {{method.name}} ({{getASArgList}}) :void; +{{/methods}} +} +}