Generate receivers and decoders for actionscript
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6507 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
|
||||
package com.threerings.bureau.client {
|
||||
|
||||
import com.threerings.bureau.client.BureauReceiver;
|
||||
import com.threerings.presents.client.InvocationDecoder;
|
||||
|
||||
/**
|
||||
@@ -49,31 +48,28 @@ public class BureauDecoder extends InvocationDecoder
|
||||
this.receiver = receiver;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public override function getReceiverCode () :String
|
||||
{
|
||||
return RECEIVER_CODE;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public override function dispatchNotification (methodId :int, args :Array) :void
|
||||
{
|
||||
switch (methodId) {
|
||||
case CREATE_AGENT:
|
||||
BureauReceiver(receiver).createAgent(
|
||||
args[0] as int
|
||||
(args[0] as int)
|
||||
);
|
||||
return;
|
||||
|
||||
case DESTROY_AGENT:
|
||||
BureauReceiver(receiver).destroyAgent(
|
||||
args[0] as int
|
||||
(args[0] as int)
|
||||
);
|
||||
return;
|
||||
|
||||
default:
|
||||
super.dispatchNotification(methodId, args);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,28 +23,12 @@ package com.threerings.bureau.client {
|
||||
|
||||
import com.threerings.presents.client.InvocationReceiver;
|
||||
|
||||
/**
|
||||
* Hooks for controlling a previously launched bureau client.
|
||||
*/
|
||||
public interface BureauReceiver extends InvocationReceiver
|
||||
{
|
||||
/**
|
||||
* Creates a new agent. Implementors should create a new {@link Agent} and give it access to
|
||||
* the {@link AgentObject} referred to by the <code>agentId</code> 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 <code>AgentObject</code> that needs an <code>Agent</code>
|
||||
*/
|
||||
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 <code>createAgent</code> 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 <code>AgentObject</code> whose <code>Agent</code>
|
||||
* should be destroyed
|
||||
*/
|
||||
function destroyAgent (agentId :int) :void;
|
||||
// from Java interface BureauReceiver
|
||||
function destroyAgent (arg1 :int) :void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user