From e99ac5762d32d71e752eefce3ea377a05c8310fc Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 4 Oct 2006 20:41:51 +0000 Subject: [PATCH] Regenerated all of the ActionScript services using the new code generation tool. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4401 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- build.xml | 3 +- .../crowd/chat/client/ChatService.as | 49 +++++-------------- .../chat/client/ChatService_TellListener.as | 42 ++++++++++++++++ .../crowd/chat/client/SpeakService.as | 23 +++------ .../crowd/chat/client/TellAdapter.as | 2 +- .../crowd/chat/client/TellListener.as | 11 ----- .../crowd/chat/data/ChatMarshaller.as | 32 +++++++----- .../data/ChatMarshaller_TellMarshaller.as | 44 ++++++++++++++--- .../crowd/chat/data/SpeakMarshaller.as | 12 +++-- .../threerings/crowd/client/BodyService.as | 15 +++--- .../crowd/client/LocationService.as | 37 +++++--------- .../client/LocationService_MoveListener.as | 42 ++++++++++++++++ .../threerings/crowd/client/MoveAdapter.as | 2 +- .../threerings/crowd/client/MoveListener.as | 12 ----- .../threerings/crowd/data/BodyMarshaller.as | 13 +++-- .../crowd/data/LocationMarshaller.as | 25 ++++++---- .../data/LocationMarshaller_MoveMarshaller.as | 43 +++++++++++++--- .../presents/client/GotTimeBaseListener.as | 8 --- .../presents/client/TimeBaseService.as | 18 +++---- .../TimeBaseService_GotTimeBaseListener.as | 41 ++++++++++++++++ .../presents/data/TimeBaseMarshaller.as | 48 ++++++++++++++---- ...imeBaseMarshaller_GotTimeBaseMarshaller.as | 36 ++++++++++++-- 22 files changed, 369 insertions(+), 189 deletions(-) create mode 100644 src/as/com/threerings/crowd/chat/client/ChatService_TellListener.as delete mode 100644 src/as/com/threerings/crowd/chat/client/TellListener.as create mode 100644 src/as/com/threerings/crowd/client/LocationService_MoveListener.as delete mode 100644 src/as/com/threerings/crowd/client/MoveListener.as delete mode 100644 src/as/com/threerings/presents/client/GotTimeBaseListener.as create mode 100644 src/as/com/threerings/presents/client/TimeBaseService_GotTimeBaseListener.as diff --git a/build.xml b/build.xml index 9ebb5da2a..bd4917338 100644 --- a/build.xml +++ b/build.xml @@ -52,7 +52,8 @@ - + diff --git a/src/as/com/threerings/crowd/chat/client/ChatService.as b/src/as/com/threerings/crowd/chat/client/ChatService.as index b1c362725..730fae736 100644 --- a/src/as/com/threerings/crowd/chat/client/ChatService.as +++ b/src/as/com/threerings/crowd/chat/client/ChatService.as @@ -1,8 +1,8 @@ // -// $Id: ChatService.java 3310 2005-01-24 23:08:21Z mdb $ +// $Id$ // // Narya library - tools for developing networked games -// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved +// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved // http://www.threerings.net/code/narya/ // // This library is free software; you can redistribute it and/or modify it @@ -21,49 +21,26 @@ package com.threerings.crowd.chat.client { -import com.threerings.util.Name; - +import com.threerings.crowd.chat.client.ChatService; +import com.threerings.crowd.chat.client.ChatService_TellListener; +import com.threerings.crowd.chat.data.ChatMarshaller_TellMarshaller; import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.InvocationService_InvocationListener; +import com.threerings.util.Name; /** - * The chat services provide a mechanism by which the client can broadcast - * chat messages to all clients that are subscribed to a particular place - * object or directly to a particular client. These services should not be - * used directly, but instead should be accessed via the {@link - * ChatDirector}. + * An ActionScript version of the Java ChatService interface. */ public interface ChatService extends InvocationService { - /** - * Requests that a tell message be delivered to the user with username - * equal to target. - * - * @param client a connected, operational client instance. - * @param target the username of the user to which the tell message - * should be delivered. - * @param message the contents of the message. - * @param listener the reference that will receive the tell response. - */ - function tell ( - client :Client, target :Name, message :String, listener :TellListener) - :void; + // from Java interface ChatService + function away (arg1 :Client, arg2 :String) :void; - /** - * Requests that a message be broadcast to all users in the system. - * - * @param client a connected, operational client instance. - * @param message the contents of the message. - * @param listener the reference that will receive a failure response. - */ - function broadcast ( - client :Client, message :String, listener :InvocationService_InvocationListener) :void; + // from Java interface ChatService + function broadcast (arg1 :Client, arg2 :String, arg3 :InvocationService_InvocationListener) :void; - /** - * Sets this client's away message. If the message is null or the - * empty string, the away message will be cleared. - */ - function away (client :Client, message :String) :void; + // from Java interface ChatService + function tell (arg1 :Client, arg2 :Name, arg3 :String, arg4 :ChatService_TellListener) :void; } } diff --git a/src/as/com/threerings/crowd/chat/client/ChatService_TellListener.as b/src/as/com/threerings/crowd/chat/client/ChatService_TellListener.as new file mode 100644 index 000000000..90796de00 --- /dev/null +++ b/src/as/com/threerings/crowd/chat/client/ChatService_TellListener.as @@ -0,0 +1,42 @@ +// +// $Id$ +// +// Narya library - tools for developing networked games +// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved +// http://www.threerings.net/code/narya/ +// +// This library is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published +// by the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +package com.threerings.crowd.chat.client { + +import com.threerings.util.*; // for Float, Integer, etc. + +import com.threerings.crowd.chat.client.ChatService; +import com.threerings.crowd.chat.client.ChatService_TellListener; +import com.threerings.crowd.chat.data.ChatMarshaller_TellMarshaller; +import com.threerings.presents.client.Client; +import com.threerings.presents.client.InvocationService_InvocationListener; +import com.threerings.util.Name; + +/** + * An ActionScript version of the Java ChatService_TellListener interface. + */ +public interface ChatService_TellListener + extends InvocationService_InvocationListener +{ + // from Java ChatService_TellListener + function tellSucceeded (arg1 :Long, arg2 :String) :void +} +} diff --git a/src/as/com/threerings/crowd/chat/client/SpeakService.as b/src/as/com/threerings/crowd/chat/client/SpeakService.as index 78154d35b..2de78aa46 100644 --- a/src/as/com/threerings/crowd/chat/client/SpeakService.as +++ b/src/as/com/threerings/crowd/chat/client/SpeakService.as @@ -1,8 +1,8 @@ // -// $Id: SpeakService.java 3098 2004-08-27 02:12:55Z mdb $ +// $Id$ // // Narya library - tools for developing networked games -// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved +// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved // http://www.threerings.net/code/narya/ // // This library is free software; you can redistribute it and/or modify it @@ -21,26 +21,17 @@ package com.threerings.crowd.chat.client { +import com.threerings.crowd.chat.client.SpeakService; import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; +import com.threerings.presents.client.InvocationService_InvocationListener; /** - * Provides a means by which "speaking" can be allowed among subscribers - * of a particular distributed object. + * An ActionScript version of the Java SpeakService interface. */ public interface SpeakService extends InvocationService { - /** - * Issues a request to speak "on" the distributed object via which - * this speak service was provided. - * - * @param message the message to be spoken. - * @param mode the "mode" of the message. This is an opaque value that - * will be passed back down via the {@link ChatDirector} to the {@link - * ChatDisplay} implementations which can interpret it in an - * application specific manner. It's useful for differentiating - * between regular speech, emotes, etc. - */ - function speak (client :Client, message :String, mode :int) :void; + // from Java interface SpeakService + function speak (arg1 :Client, arg2 :String, arg3 :int) :void; } } diff --git a/src/as/com/threerings/crowd/chat/client/TellAdapter.as b/src/as/com/threerings/crowd/chat/client/TellAdapter.as index 41e47dbea..69811f6f6 100644 --- a/src/as/com/threerings/crowd/chat/client/TellAdapter.as +++ b/src/as/com/threerings/crowd/chat/client/TellAdapter.as @@ -5,7 +5,7 @@ import com.threerings.util.Long; import com.threerings.presents.client.InvocationAdapter; public class TellAdapter extends InvocationAdapter - implements TellListener + implements ChatService_TellListener { public function TellAdapter (failedFunc :Function, successFunc :Function) { diff --git a/src/as/com/threerings/crowd/chat/client/TellListener.as b/src/as/com/threerings/crowd/chat/client/TellListener.as deleted file mode 100644 index 03d9d21f9..000000000 --- a/src/as/com/threerings/crowd/chat/client/TellListener.as +++ /dev/null @@ -1,11 +0,0 @@ -package com.threerings.crowd.chat.client { - -import com.threerings.util.Long; - -import com.threerings.presents.client.InvocationService_InvocationListener - -public interface TellListener extends InvocationService_InvocationListener -{ - function tellSucceeded (idleTime :Long, awayMessage :String) :void; -} -} diff --git a/src/as/com/threerings/crowd/chat/data/ChatMarshaller.as b/src/as/com/threerings/crowd/chat/data/ChatMarshaller.as index 0c5be7a6b..dc778069e 100644 --- a/src/as/com/threerings/crowd/chat/data/ChatMarshaller.as +++ b/src/as/com/threerings/crowd/chat/data/ChatMarshaller.as @@ -1,8 +1,8 @@ // -// $Id: ChatMarshaller.java 3793 2005-12-21 02:12:57Z ray $ +// $Id$ // // Narya library - tools for developing networked games -// Copyright (C) 2002-2005 Three Rings Design, Inc., All Rights Reserved +// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved // http://www.threerings.net/code/narya/ // // This library is free software; you can redistribute it and/or modify it @@ -21,14 +21,15 @@ package com.threerings.crowd.chat.data { +import com.threerings.util.*; // for Float, Integer, etc. + import com.threerings.crowd.chat.client.ChatService; -import com.threerings.crowd.chat.client.TellListener; +import com.threerings.crowd.chat.client.ChatService_TellListener; +import com.threerings.crowd.chat.data.ChatMarshaller_TellMarshaller; import com.threerings.presents.client.Client; -import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.InvocationService_InvocationListener; import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller; -import com.threerings.presents.dobj.InvocationResponseEvent; import com.threerings.util.Name; /** @@ -44,33 +45,38 @@ public class ChatMarshaller extends InvocationMarshaller /** The method id used to dispatch {@link #away} requests. */ public static const AWAY :int = 1; - // documentation inherited from interface + // from interface ChatService public function away (arg1 :Client, arg2 :String) :void { - sendRequest(arg1, AWAY, [ arg2 ]); + sendRequest(arg1, AWAY, [ + arg2 + ]); } /** The method id used to dispatch {@link #broadcast} requests. */ public static const BROADCAST :int = 2; - // documentation inherited from interface + // from interface ChatService public function broadcast (arg1 :Client, arg2 :String, arg3 :InvocationService_InvocationListener) :void { var listener3 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller(); listener3.listener = arg3; - sendRequest(arg1, BROADCAST, [ arg2, listener3 ]); + sendRequest(arg1, BROADCAST, [ + arg2, listener3 + ]); } /** The method id used to dispatch {@link #tell} requests. */ public static const TELL :int = 3; - // documentation inherited from interface - public function tell (arg1 :Client, arg2 :Name, arg3 :String, arg4 :TellListener) :void + // from interface ChatService + public function tell (arg1 :Client, arg2 :Name, arg3 :String, arg4 :ChatService_TellListener) :void { var listener4 :ChatMarshaller_TellMarshaller = new ChatMarshaller_TellMarshaller(); listener4.listener = arg4; - sendRequest(arg1, TELL, [ arg2, arg3, listener4 ]); + sendRequest(arg1, TELL, [ + arg2, arg3, listener4 + ]); } - } } diff --git a/src/as/com/threerings/crowd/chat/data/ChatMarshaller_TellMarshaller.as b/src/as/com/threerings/crowd/chat/data/ChatMarshaller_TellMarshaller.as index 19062d8ad..cb09dae9c 100644 --- a/src/as/com/threerings/crowd/chat/data/ChatMarshaller_TellMarshaller.as +++ b/src/as/com/threerings/crowd/chat/data/ChatMarshaller_TellMarshaller.as @@ -1,28 +1,56 @@ +// +// $Id$ +// +// Narya library - tools for developing networked games +// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved +// http://www.threerings.net/code/narya/ +// +// This library is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published +// by the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + package com.threerings.crowd.chat.data { -import com.threerings.util.Long; +import com.threerings.util.*; // for Float, Integer, etc. +import com.threerings.crowd.chat.client.ChatService; +import com.threerings.crowd.chat.client.ChatService_TellListener; +import com.threerings.presents.client.Client; +import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller; +import com.threerings.util.Name; -import com.threerings.crowd.chat.client.TellListener; - -public class ChatMarshaller_TellMarshaller extends InvocationMarshaller_ListenerMarshaller +/** + * Marshalls instances of the ChatService_TellMarshaller interface. + */ +public class ChatMarshaller_TellMarshaller + extends InvocationMarshaller_ListenerMarshaller { - /** The method id used to dispatch {@link #tellSucceeded} - * responses. */ + /** The method id used to dispatch {@link #tellSucceeded} responses. */ public static const TELL_SUCCEEDED :int = 1; - // documentation inherited + // from InvocationMarshaller_ListenerMarshaller override public function dispatchResponse (methodId :int, args :Array) :void { switch (methodId) { case TELL_SUCCEEDED: - (listener as TellListener).tellSucceeded( + (listener as ChatService_TellListener).tellSucceeded( (args[0] as Long), (args[1] as String)); return; default: super.dispatchResponse(methodId, args); + return; } } } diff --git a/src/as/com/threerings/crowd/chat/data/SpeakMarshaller.as b/src/as/com/threerings/crowd/chat/data/SpeakMarshaller.as index 4bde4b9ee..6ac0f2475 100644 --- a/src/as/com/threerings/crowd/chat/data/SpeakMarshaller.as +++ b/src/as/com/threerings/crowd/chat/data/SpeakMarshaller.as @@ -2,7 +2,7 @@ // $Id$ // // Narya library - tools for developing networked games -// Copyright (C) 2002-2005 Three Rings Design, Inc., All Rights Reserved +// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved // http://www.threerings.net/code/narya/ // // This library is free software; you can redistribute it and/or modify it @@ -21,12 +21,12 @@ package com.threerings.crowd.chat.data { -import com.threerings.util.Byte; +import com.threerings.util.*; // for Float, Integer, etc. import com.threerings.crowd.chat.client.SpeakService; import com.threerings.presents.client.Client; import com.threerings.presents.data.InvocationMarshaller; -import com.threerings.presents.dobj.InvocationResponseEvent; +import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller; /** * Provides the implementation of the {@link SpeakService} interface @@ -41,10 +41,12 @@ public class SpeakMarshaller extends InvocationMarshaller /** The method id used to dispatch {@link #speak} requests. */ public static const SPEAK :int = 1; - // documentation inherited from interface + // from interface SpeakService public function speak (arg1 :Client, arg2 :String, arg3 :int) :void { - sendRequest(arg1, SPEAK, [ arg2, Byte.valueOf(arg3) ]); + sendRequest(arg1, SPEAK, [ + arg2, Byte.valueOf(arg3) + ]); } } } diff --git a/src/as/com/threerings/crowd/client/BodyService.as b/src/as/com/threerings/crowd/client/BodyService.as index a1b7895e9..eb7b86752 100644 --- a/src/as/com/threerings/crowd/client/BodyService.as +++ b/src/as/com/threerings/crowd/client/BodyService.as @@ -1,8 +1,8 @@ // -// $Id: BodyService.java 3098 2004-08-27 02:12:55Z mdb $ +// $Id$ // // Narya library - tools for developing networked games -// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved +// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved // http://www.threerings.net/code/narya/ // // This library is free software; you can redistribute it and/or modify it @@ -21,18 +21,17 @@ package com.threerings.crowd.client { +import com.threerings.crowd.client.BodyService; import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; +import com.threerings.presents.client.InvocationService_InvocationListener; /** - * The client side of the body-related invocation services. + * An ActionScript version of the Java BodyService interface. */ public interface BodyService extends InvocationService { - /** - * Requests to set the idle state of the client to the specified - * value. - */ - function setIdle (client :Client, idle :Boolean) :void; + // from Java interface BodyService + function setIdle (arg1 :Client, arg2 :Boolean) :void; } } diff --git a/src/as/com/threerings/crowd/client/LocationService.as b/src/as/com/threerings/crowd/client/LocationService.as index 0979be56f..2d702db6b 100644 --- a/src/as/com/threerings/crowd/client/LocationService.as +++ b/src/as/com/threerings/crowd/client/LocationService.as @@ -1,8 +1,8 @@ // -// $Id: LocationService.java 3638 2005-06-30 00:02:13Z mdb $ +// $Id$ // // Narya library - tools for developing networked games -// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved +// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved // http://www.threerings.net/code/narya/ // // This library is free software; you can redistribute it and/or modify it @@ -21,36 +21,23 @@ package com.threerings.crowd.client { +import com.threerings.crowd.client.LocationService; +import com.threerings.crowd.client.LocationService_MoveListener; +import com.threerings.crowd.data.LocationMarshaller_MoveMarshaller; +import com.threerings.crowd.data.PlaceConfig; import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; - -import com.threerings.crowd.data.PlaceConfig; +import com.threerings.presents.client.InvocationService_InvocationListener; /** - * The location services provide a mechanism by which the client can - * request to move from place to place in the server. These services - * should not be used directly, but instead should be accessed via the - * {@link LocationDirector}. + * An ActionScript version of the Java LocationService interface. */ public interface LocationService extends InvocationService { - /** - * Requests that this client's body be moved to the specified - * location. - * - * @param client a reference to the client object that defines the - * context in which this invocation service should be executed. - * @param placeId the object id of the place object to which the body - * should be moved. - * @param listener the listener that will be informed of success or - * failure. - */ - function moveTo ( - client :Client, placeId :int, listener :MoveListener) :void; + // from Java interface LocationService + function leavePlace (arg1 :Client) :void; - /** - * Requests that we leave our current place and move to nowhere land. - */ - function leavePlace (client :Client) :void; + // from Java interface LocationService + function moveTo (arg1 :Client, arg2 :int, arg3 :LocationService_MoveListener) :void; } } diff --git a/src/as/com/threerings/crowd/client/LocationService_MoveListener.as b/src/as/com/threerings/crowd/client/LocationService_MoveListener.as new file mode 100644 index 000000000..56d51b07f --- /dev/null +++ b/src/as/com/threerings/crowd/client/LocationService_MoveListener.as @@ -0,0 +1,42 @@ +// +// $Id$ +// +// Narya library - tools for developing networked games +// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved +// http://www.threerings.net/code/narya/ +// +// This library is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published +// by the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +package com.threerings.crowd.client { + +import com.threerings.util.*; // for Float, Integer, etc. + +import com.threerings.crowd.client.LocationService; +import com.threerings.crowd.client.LocationService_MoveListener; +import com.threerings.crowd.data.LocationMarshaller_MoveMarshaller; +import com.threerings.crowd.data.PlaceConfig; +import com.threerings.presents.client.Client; +import com.threerings.presents.client.InvocationService_InvocationListener; + +/** + * An ActionScript version of the Java LocationService_MoveListener interface. + */ +public interface LocationService_MoveListener + extends InvocationService_InvocationListener +{ + // from Java LocationService_MoveListener + function moveSucceeded (arg1 :PlaceConfig) :void +} +} diff --git a/src/as/com/threerings/crowd/client/MoveAdapter.as b/src/as/com/threerings/crowd/client/MoveAdapter.as index 586c128e3..96ac6951c 100644 --- a/src/as/com/threerings/crowd/client/MoveAdapter.as +++ b/src/as/com/threerings/crowd/client/MoveAdapter.as @@ -5,7 +5,7 @@ import com.threerings.presents.client.InvocationAdapter; import com.threerings.crowd.data.PlaceConfig; public class MoveAdapter extends InvocationAdapter - implements MoveListener + implements LocationService_MoveListener { public function MoveAdapter (success :Function, failure :Function) { diff --git a/src/as/com/threerings/crowd/client/MoveListener.as b/src/as/com/threerings/crowd/client/MoveListener.as deleted file mode 100644 index c3d0791f6..000000000 --- a/src/as/com/threerings/crowd/client/MoveListener.as +++ /dev/null @@ -1,12 +0,0 @@ -package com.threerings.crowd.client { - -import com.threerings.presents.client.ClientEvent; -import com.threerings.presents.client.InvocationService_InvocationListener; - -import com.threerings.crowd.data.PlaceConfig; - -public interface MoveListener extends InvocationService_InvocationListener -{ - function moveSucceeded (config :PlaceConfig) :void; -} -} diff --git a/src/as/com/threerings/crowd/data/BodyMarshaller.as b/src/as/com/threerings/crowd/data/BodyMarshaller.as index 019b4556a..af8e9e0c6 100644 --- a/src/as/com/threerings/crowd/data/BodyMarshaller.as +++ b/src/as/com/threerings/crowd/data/BodyMarshaller.as @@ -2,7 +2,7 @@ // $Id$ // // Narya library - tools for developing networked games -// Copyright (C) 2002-2005 Three Rings Design, Inc., All Rights Reserved +// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved // http://www.threerings.net/code/narya/ // // This library is free software; you can redistribute it and/or modify it @@ -21,10 +21,12 @@ package com.threerings.crowd.data { +import com.threerings.util.*; // for Float, Integer, etc. + import com.threerings.crowd.client.BodyService; import com.threerings.presents.client.Client; import com.threerings.presents.data.InvocationMarshaller; -import com.threerings.presents.dobj.InvocationResponseEvent; +import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller; /** * Provides the implementation of the {@link BodyService} interface @@ -39,11 +41,12 @@ public class BodyMarshaller extends InvocationMarshaller /** The method id used to dispatch {@link #setIdle} requests. */ public static const SET_IDLE :int = 1; - // documentation inherited from interface + // from interface BodyService public function setIdle (arg1 :Client, arg2 :Boolean) :void { - sendRequest(arg1, SET_IDLE, [ arg2 ]); + sendRequest(arg1, SET_IDLE, [ + langBoolean.valueOf(arg2) + ]); } - } } diff --git a/src/as/com/threerings/crowd/data/LocationMarshaller.as b/src/as/com/threerings/crowd/data/LocationMarshaller.as index d91a1f388..2f06e82cf 100644 --- a/src/as/com/threerings/crowd/data/LocationMarshaller.as +++ b/src/as/com/threerings/crowd/data/LocationMarshaller.as @@ -1,8 +1,8 @@ // -// $Id: LocationMarshaller.java 3793 2005-12-21 02:12:57Z ray $ +// $Id$ // // Narya library - tools for developing networked games -// Copyright (C) 2002-2005 Three Rings Design, Inc., All Rights Reserved +// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved // http://www.threerings.net/code/narya/ // // This library is free software; you can redistribute it and/or modify it @@ -21,14 +21,15 @@ package com.threerings.crowd.data { -import com.threerings.util.Integer; +import com.threerings.util.*; // for Float, Integer, etc. import com.threerings.crowd.client.LocationService; -import com.threerings.crowd.client.MoveListener; +import com.threerings.crowd.client.LocationService_MoveListener; +import com.threerings.crowd.data.LocationMarshaller_MoveMarshaller; import com.threerings.crowd.data.PlaceConfig; import com.threerings.presents.client.Client; import com.threerings.presents.data.InvocationMarshaller; -import com.threerings.presents.dobj.InvocationResponseEvent; +import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller; /** * Provides the implementation of the {@link LocationService} interface @@ -43,21 +44,25 @@ public class LocationMarshaller extends InvocationMarshaller /** The method id used to dispatch {@link #leavePlace} requests. */ public static const LEAVE_PLACE :int = 1; - // documentation inherited from interface + // from interface LocationService public function leavePlace (arg1 :Client) :void { - sendRequest(arg1, LEAVE_PLACE, new Array()); + sendRequest(arg1, LEAVE_PLACE, [ + + ]); } /** The method id used to dispatch {@link #moveTo} requests. */ public static const MOVE_TO :int = 2; - // documentation inherited from interface - public function moveTo (arg1 :Client, arg2 :int, arg3 :MoveListener) :void + // from interface LocationService + public function moveTo (arg1 :Client, arg2 :int, arg3 :LocationService_MoveListener) :void { var listener3 :LocationMarshaller_MoveMarshaller = new LocationMarshaller_MoveMarshaller(); listener3.listener = arg3; - sendRequest(arg1, MOVE_TO, [ Integer.valueOf(arg2), listener3 ]); + sendRequest(arg1, MOVE_TO, [ + Integer.valueOf(arg2), listener3 + ]); } } } diff --git a/src/as/com/threerings/crowd/data/LocationMarshaller_MoveMarshaller.as b/src/as/com/threerings/crowd/data/LocationMarshaller_MoveMarshaller.as index 35f0345bd..60c4c7732 100644 --- a/src/as/com/threerings/crowd/data/LocationMarshaller_MoveMarshaller.as +++ b/src/as/com/threerings/crowd/data/LocationMarshaller_MoveMarshaller.as @@ -1,26 +1,55 @@ +// +// $Id$ +// +// Narya library - tools for developing networked games +// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved +// http://www.threerings.net/code/narya/ +// +// This library is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published +// by the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + package com.threerings.crowd.data { +import com.threerings.util.*; // for Float, Integer, etc. + +import com.threerings.crowd.client.LocationService; +import com.threerings.crowd.client.LocationService_MoveListener; +import com.threerings.crowd.data.PlaceConfig; +import com.threerings.presents.client.Client; import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller; -import com.threerings.crowd.client.MoveListener - -public class LocationMarshaller_MoveMarshaller extends InvocationMarshaller_ListenerMarshaller +/** + * Marshalls instances of the LocationService_MoveMarshaller interface. + */ +public class LocationMarshaller_MoveMarshaller + extends InvocationMarshaller_ListenerMarshaller { - /** The method id used to dispatch {@link #moveSucceeded} - * responses. */ + /** The method id used to dispatch {@link #moveSucceeded} responses. */ public static const MOVE_SUCCEEDED :int = 1; - // documentation inherited + // from InvocationMarshaller_ListenerMarshaller override public function dispatchResponse (methodId :int, args :Array) :void { switch (methodId) { case MOVE_SUCCEEDED: - (listener as MoveListener).moveSucceeded( + (listener as LocationService_MoveListener).moveSucceeded( (args[0] as PlaceConfig)); return; default: super.dispatchResponse(methodId, args); + return; } } } diff --git a/src/as/com/threerings/presents/client/GotTimeBaseListener.as b/src/as/com/threerings/presents/client/GotTimeBaseListener.as deleted file mode 100644 index 6c759ce8b..000000000 --- a/src/as/com/threerings/presents/client/GotTimeBaseListener.as +++ /dev/null @@ -1,8 +0,0 @@ -package com.threerings.presents.client { - -public interface GotTimeBaseListener - extends InvocationService_InvocationListener -{ - function gotTimeOid (timeOid :int) :void; -} -} diff --git a/src/as/com/threerings/presents/client/TimeBaseService.as b/src/as/com/threerings/presents/client/TimeBaseService.as index 0e4d87fcc..51065a403 100644 --- a/src/as/com/threerings/presents/client/TimeBaseService.as +++ b/src/as/com/threerings/presents/client/TimeBaseService.as @@ -1,8 +1,8 @@ // -// $Id: TimeBaseService.java 3099 2004-08-27 02:21:06Z mdb $ +// $Id$ // // Narya library - tools for developing networked games -// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved +// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved // http://www.threerings.net/code/narya/ // // This library is free software; you can redistribute it and/or modify it @@ -23,17 +23,17 @@ package com.threerings.presents.client { import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; +import com.threerings.presents.client.InvocationService_InvocationListener; +import com.threerings.presents.client.TimeBaseService; +import com.threerings.presents.client.TimeBaseService_GotTimeBaseListener; +import com.threerings.presents.data.TimeBaseMarshaller_GotTimeBaseMarshaller; /** - * Provides a means by which to obtain access to a time base object which - * can be used to convert delta times into absolute times. + * An ActionScript version of the Java TimeBaseService interface. */ public interface TimeBaseService extends InvocationService { - /** - * Requests the oid of the specified time base object be fetched. - */ - function getTimeOid ( - client :Client, timeBase :String, listener :GotTimeBaseListener) :void; + // from Java interface TimeBaseService + function getTimeOid (arg1 :Client, arg2 :String, arg3 :TimeBaseService_GotTimeBaseListener) :void; } } diff --git a/src/as/com/threerings/presents/client/TimeBaseService_GotTimeBaseListener.as b/src/as/com/threerings/presents/client/TimeBaseService_GotTimeBaseListener.as new file mode 100644 index 000000000..9a9b4c57a --- /dev/null +++ b/src/as/com/threerings/presents/client/TimeBaseService_GotTimeBaseListener.as @@ -0,0 +1,41 @@ +// +// $Id$ +// +// Narya library - tools for developing networked games +// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved +// http://www.threerings.net/code/narya/ +// +// This library is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published +// by the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +package com.threerings.presents.client { + +import com.threerings.util.*; // for Float, Integer, etc. + +import com.threerings.presents.client.Client; +import com.threerings.presents.client.InvocationService_InvocationListener; +import com.threerings.presents.client.TimeBaseService; +import com.threerings.presents.client.TimeBaseService_GotTimeBaseListener; +import com.threerings.presents.data.TimeBaseMarshaller_GotTimeBaseMarshaller; + +/** + * An ActionScript version of the Java TimeBaseService_GotTimeBaseListener interface. + */ +public interface TimeBaseService_GotTimeBaseListener + extends InvocationService_InvocationListener +{ + // from Java TimeBaseService_GotTimeBaseListener + function gotTimeOid (arg1 :int) :void +} +} diff --git a/src/as/com/threerings/presents/data/TimeBaseMarshaller.as b/src/as/com/threerings/presents/data/TimeBaseMarshaller.as index 3609e7418..64b866f55 100644 --- a/src/as/com/threerings/presents/data/TimeBaseMarshaller.as +++ b/src/as/com/threerings/presents/data/TimeBaseMarshaller.as @@ -1,26 +1,56 @@ +// +// $Id$ +// +// Narya library - tools for developing networked games +// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved +// http://www.threerings.net/code/narya/ +// +// This library is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published +// by the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + package com.threerings.presents.data { +import com.threerings.util.*; // for Float, Integer, etc. + import com.threerings.presents.client.Client; -import com.threerings.presents.client.GotTimeBaseListener; import com.threerings.presents.client.TimeBaseService; - +import com.threerings.presents.client.TimeBaseService_GotTimeBaseListener; import com.threerings.presents.data.InvocationMarshaller; +import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller; +import com.threerings.presents.data.TimeBaseMarshaller_GotTimeBaseMarshaller; -import com.threerings.presents.dobj.InvocationResponseEvent; - -// TODO -// This will be auto-generated soon from the service definition +/** + * Provides the implementation of the {@link TimeBaseService} interface + * that marshalls the arguments and delivers the request to the provider + * on the server. Also provides an implementation of the response listener + * interfaces that marshall the response arguments and deliver them back + * to the requesting client. + */ public class TimeBaseMarshaller extends InvocationMarshaller implements TimeBaseService { + /** The method id used to dispatch {@link #getTimeOid} requests. */ public static const GET_TIME_OID :int = 1; - public function getTimeOid ( - arg1 :Client, arg2 :String, arg3 :GotTimeBaseListener) :void + // from interface TimeBaseService + public function getTimeOid (arg1 :Client, arg2 :String, arg3 :TimeBaseService_GotTimeBaseListener) :void { var listener3 :TimeBaseMarshaller_GotTimeBaseMarshaller = new TimeBaseMarshaller_GotTimeBaseMarshaller(); listener3.listener = arg3; - sendRequest(arg1, GET_TIME_OID, [arg2, listener3]); + sendRequest(arg1, GET_TIME_OID, [ + arg2, listener3 + ]); } } } diff --git a/src/as/com/threerings/presents/data/TimeBaseMarshaller_GotTimeBaseMarshaller.as b/src/as/com/threerings/presents/data/TimeBaseMarshaller_GotTimeBaseMarshaller.as index 72a488d3a..e0a836b71 100644 --- a/src/as/com/threerings/presents/data/TimeBaseMarshaller_GotTimeBaseMarshaller.as +++ b/src/as/com/threerings/presents/data/TimeBaseMarshaller_GotTimeBaseMarshaller.as @@ -1,20 +1,48 @@ +// +// $Id$ +// +// Narya library - tools for developing networked games +// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved +// http://www.threerings.net/code/narya/ +// +// This library is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published +// by the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + package com.threerings.presents.data { -import com.threerings.presents.client.GotTimeBaseListener; +import com.threerings.util.*; // for Float, Integer, etc. -import com.threerings.presents.dobj.InvocationResponseEvent; +import com.threerings.presents.client.TimeBaseService; +import com.threerings.presents.client.TimeBaseService_GotTimeBaseListener; +import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller; -// TODO: this will be autogenerated +/** + * Marshalls instances of the TimeBaseService_GotTimeBaseMarshaller interface. + */ public class TimeBaseMarshaller_GotTimeBaseMarshaller extends InvocationMarshaller_ListenerMarshaller { + /** The method id used to dispatch {@link #gotTimeOid} responses. */ public static const GOT_TIME_OID :int = 1; + // from InvocationMarshaller_ListenerMarshaller override public function dispatchResponse (methodId :int, args :Array) :void { switch (methodId) { case GOT_TIME_OID: - (listener as GotTimeBaseListener).gotTimeOid(args[0] as int); + (listener as TimeBaseService_GotTimeBaseListener).gotTimeOid( + (args[0] as Integer).value); return; default: