Regenerated more actionscript service business.

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@103 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Ray Greenwell
2006-10-06 01:40:52 +00:00
parent 77e22d65fc
commit 7e3e8b981d
20 changed files with 742 additions and 412 deletions
@@ -1,89 +1,61 @@
// //
// $Id$ // $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/vilya/
//
// 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.ezgame.client { package com.threerings.ezgame.client {
import flash.utils.ByteArray; import com.threerings.ezgame.client.EZGameService;
import com.threerings.io.TypedArray;
import com.threerings.presents.client.Client; import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.InvocationService;
import com.threerings.presents.client.InvocationService_ConfirmListener; import com.threerings.presents.client.InvocationService_ConfirmListener;
import com.threerings.presents.client.InvocationService_InvocationListener; import com.threerings.presents.client.InvocationService_InvocationListener;
import com.threerings.presents.data.InvocationMarshaller_ConfirmMarshaller;
import com.threerings.presents.data.InvocationMarshaller_InvocationMarshaller;
/** /**
* Provides services for ez games. * An ActionScript version of the Java EZGameService interface.
*/ */
public interface EZGameService extends InvocationService public interface EZGameService extends InvocationService
{ {
/** // from Java interface EZGameService
* Request to set the specified property. function addToCollection (arg1 :Client, arg2 :String, arg3 :Array, arg4 :Boolean, arg5 :InvocationService_InvocationListener) :void;
*/
function setProperty (
client :Client, propName :String, value :Object, index :int,
listener :InvocationService_InvocationListener) :void;
/** // from Java interface EZGameService
* Request to end the turn, possibly futzing the next turn holder unless function endGame (arg1 :Client, arg2 :Array, arg3 :InvocationService_InvocationListener) :void;
* -1 is specified for the nextPlayerIndex.
*/
function endTurn (
client :Client, nextPlayerIndex :int,
listener :InvocationService_InvocationListener) :void;
/** // from Java interface EZGameService
* Request to end the game, with the specified player indices assigned function endTurn (arg1 :Client, arg2 :int, arg3 :InvocationService_InvocationListener) :void;
* as winners.
*/
function endGame (
client :Client, winners :TypedArray /* of int */,
listener :InvocationService_InvocationListener) :void;
/** // from Java interface EZGameService
* Request to send a private message to one other player in function getFromCollection (arg1 :Client, arg2 :String, arg3 :Boolean, arg4 :int, arg5 :String, arg6 :int, arg7 :InvocationService_ConfirmListener) :void;
* the game.
*/
function sendMessage (
client :Client, msgName :String, value :Object, playerIdx :int,
listener :InvocationService_InvocationListener) :void;
/** // from Java interface EZGameService
* Add to the specified named collection. function mergeCollection (arg1 :Client, arg2 :String, arg3 :String, arg4 :InvocationService_InvocationListener) :void;
*
* @param clearExisting if true, wipe the old contents.
*/
function addToCollection (
client :Client, collName :String, data :TypedArray /* of ByteArray */,
clearExisting :Boolean, listener :InvocationService_InvocationListener)
:void;
/** // from Java interface EZGameService
* Merge the specified collection into the other. function sendMessage (arg1 :Client, arg2 :String, arg3 :Object, arg4 :int, arg5 :InvocationService_InvocationListener) :void;
*/
function mergeCollection (
client :Client, srcColl :String, intoColl :String,
listener :InvocationService_InvocationListener) :void;
/** // from Java interface EZGameService
* Pick or deal some number of elements from the specified collection, function setProperty (arg1 :Client, arg2 :String, arg3 :Object, arg4 :int, arg5 :InvocationService_InvocationListener) :void;
* and either set a property in the flash object, or delivery the
* picks to the specified player index via a game message.
*/
function getFromCollection (
client :Client, collName :String, consume :Boolean, count :int,
msgOrPropName :String, playerIndex :int,
listener :InvocationService_ConfirmListener) :void;
/** // from Java interface EZGameService
* Start a ticker that will send out timestamp information at function setTicker (arg1 :Client, arg2 :String, arg3 :int, arg4 :InvocationService_InvocationListener) :void;
* the interval specified.
*
* @param msOfDelay must be at least 50, or 0 may be set to halt
* and clear a previously started ticker.
*/
function setTicker (
client :Client, tickerName :String, msOfDelay :int,
listener :InvocationService_InvocationListener) :void;
} }
} }
@@ -1,24 +1,36 @@
// //
// $Id$ // $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/vilya/
//
// 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.ezgame.data { package com.threerings.ezgame.data {
import flash.utils.ByteArray; import com.threerings.util.*; // for Float, Integer, etc.
import com.threerings.util.langBoolean;
import com.threerings.util.Integer;
import com.threerings.io.TypedArray;
import com.threerings.ezgame.client.EZGameService; import com.threerings.ezgame.client.EZGameService;
import com.threerings.presents.client.Client; import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.client.InvocationService_ConfirmListener; import com.threerings.presents.client.InvocationService_ConfirmListener;
import com.threerings.presents.client.InvocationService_InvocationListener; import com.threerings.presents.client.InvocationService_InvocationListener;
import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.data.InvocationMarshaller_ConfirmMarshaller; import com.threerings.presents.data.InvocationMarshaller_ConfirmMarshaller;
import com.threerings.presents.data.InvocationMarshaller_InvocationMarshaller;
import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller; import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
import com.threerings.presents.dobj.InvocationResponseEvent;
/** /**
* Provides the implementation of the {@link EZGameService} interface * Provides the implementation of the {@link EZGameService} interface
@@ -33,8 +45,8 @@ public class EZGameMarshaller extends InvocationMarshaller
/** The method id used to dispatch {@link #addToCollection} requests. */ /** The method id used to dispatch {@link #addToCollection} requests. */
public static const ADD_TO_COLLECTION :int = 1; public static const ADD_TO_COLLECTION :int = 1;
// documentation inherited from interface // from interface EZGameService
public function addToCollection (arg1 :Client, arg2 :String, arg3 :TypedArray /* of ByteArray */, arg4 :Boolean, arg5 :InvocationService_InvocationListener) :void public function addToCollection (arg1 :Client, arg2 :String, arg3 :Array, arg4 :Boolean, arg5 :InvocationService_InvocationListener) :void
{ {
var listener5 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller(); var listener5 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller();
listener5.listener = arg5; listener5.listener = arg5;
@@ -46,8 +58,8 @@ public class EZGameMarshaller extends InvocationMarshaller
/** The method id used to dispatch {@link #endGame} requests. */ /** The method id used to dispatch {@link #endGame} requests. */
public static const END_GAME :int = 2; public static const END_GAME :int = 2;
// documentation inherited from interface // from interface EZGameService
public function endGame (arg1 :Client, arg2 :TypedArray, arg3 :InvocationService_InvocationListener) :void public function endGame (arg1 :Client, arg2 :Array, arg3 :InvocationService_InvocationListener) :void
{ {
var listener3 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller(); var listener3 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller();
listener3.listener = arg3; listener3.listener = arg3;
@@ -59,7 +71,7 @@ public class EZGameMarshaller extends InvocationMarshaller
/** The method id used to dispatch {@link #endTurn} requests. */ /** The method id used to dispatch {@link #endTurn} requests. */
public static const END_TURN :int = 3; public static const END_TURN :int = 3;
// documentation inherited from interface // from interface EZGameService
public function endTurn (arg1 :Client, arg2 :int, arg3 :InvocationService_InvocationListener) :void public function endTurn (arg1 :Client, arg2 :int, arg3 :InvocationService_InvocationListener) :void
{ {
var listener3 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller(); var listener3 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller();
@@ -72,7 +84,7 @@ public class EZGameMarshaller extends InvocationMarshaller
/** The method id used to dispatch {@link #getFromCollection} requests. */ /** The method id used to dispatch {@link #getFromCollection} requests. */
public static const GET_FROM_COLLECTION :int = 4; public static const GET_FROM_COLLECTION :int = 4;
// documentation inherited from interface // from interface EZGameService
public function getFromCollection (arg1 :Client, arg2 :String, arg3 :Boolean, arg4 :int, arg5 :String, arg6 :int, arg7 :InvocationService_ConfirmListener) :void public function getFromCollection (arg1 :Client, arg2 :String, arg3 :Boolean, arg4 :int, arg5 :String, arg6 :int, arg7 :InvocationService_ConfirmListener) :void
{ {
var listener7 :InvocationMarshaller_ConfirmMarshaller = new InvocationMarshaller_ConfirmMarshaller(); var listener7 :InvocationMarshaller_ConfirmMarshaller = new InvocationMarshaller_ConfirmMarshaller();
@@ -85,7 +97,7 @@ public class EZGameMarshaller extends InvocationMarshaller
/** The method id used to dispatch {@link #mergeCollection} requests. */ /** The method id used to dispatch {@link #mergeCollection} requests. */
public static const MERGE_COLLECTION :int = 5; public static const MERGE_COLLECTION :int = 5;
// documentation inherited from interface // from interface EZGameService
public function mergeCollection (arg1 :Client, arg2 :String, arg3 :String, arg4 :InvocationService_InvocationListener) :void public function mergeCollection (arg1 :Client, arg2 :String, arg3 :String, arg4 :InvocationService_InvocationListener) :void
{ {
var listener4 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller(); var listener4 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller();
@@ -98,7 +110,7 @@ public class EZGameMarshaller extends InvocationMarshaller
/** The method id used to dispatch {@link #sendMessage} requests. */ /** The method id used to dispatch {@link #sendMessage} requests. */
public static const SEND_MESSAGE :int = 6; public static const SEND_MESSAGE :int = 6;
// documentation inherited from interface // from interface EZGameService
public function sendMessage (arg1 :Client, arg2 :String, arg3 :Object, arg4 :int, arg5 :InvocationService_InvocationListener) :void public function sendMessage (arg1 :Client, arg2 :String, arg3 :Object, arg4 :int, arg5 :InvocationService_InvocationListener) :void
{ {
var listener5 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller(); var listener5 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller();
@@ -111,7 +123,7 @@ public class EZGameMarshaller extends InvocationMarshaller
/** The method id used to dispatch {@link #setProperty} requests. */ /** The method id used to dispatch {@link #setProperty} requests. */
public static const SET_PROPERTY :int = 7; public static const SET_PROPERTY :int = 7;
// documentation inherited from interface // from interface EZGameService
public function setProperty (arg1 :Client, arg2 :String, arg3 :Object, arg4 :int, arg5 :InvocationService_InvocationListener) :void public function setProperty (arg1 :Client, arg2 :String, arg3 :Object, arg4 :int, arg5 :InvocationService_InvocationListener) :void
{ {
var listener5 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller(); var listener5 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller();
@@ -124,7 +136,7 @@ public class EZGameMarshaller extends InvocationMarshaller
/** The method id used to dispatch {@link #setTicker} requests. */ /** The method id used to dispatch {@link #setTicker} requests. */
public static const SET_TICKER :int = 8; public static const SET_TICKER :int = 8;
// documentation inherited from interface // from interface EZGameService
public function setTicker (arg1 :Client, arg2 :String, arg3 :int, arg4 :InvocationService_InvocationListener) :void public function setTicker (arg1 :Client, arg2 :String, arg3 :int, arg4 :InvocationService_InvocationListener) :void
{ {
var listener4 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller(); var listener4 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller();
@@ -133,6 +145,5 @@ public class EZGameMarshaller extends InvocationMarshaller
arg2, Integer.valueOf(arg3), listener4 arg2, Integer.valueOf(arg3), listener4
]); ]);
} }
} }
} }
@@ -0,0 +1,44 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/vilya/
//
// 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.parlor.card.trick.client {
import com.threerings.parlor.card.data.Card;
import com.threerings.parlor.card.trick.client.TrickCardGameService;
import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.client.InvocationService_InvocationListener;
/**
* An ActionScript version of the Java TrickCardGameService interface.
*/
public interface TrickCardGameService extends InvocationService
{
// from Java interface TrickCardGameService
function playCard (arg1 :Client, arg2 :Card, arg3 :int) :void;
// from Java interface TrickCardGameService
function requestRematch (arg1 :Client) :void;
// from Java interface TrickCardGameService
function sendCardsToPlayer (arg1 :Client, arg2 :int, arg3 :Array) :void;
}
}
@@ -0,0 +1,75 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/vilya/
//
// 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.parlor.card.trick.data {
import com.threerings.util.*; // for Float, Integer, etc.
import com.threerings.parlor.card.data.Card;
import com.threerings.parlor.card.trick.client.TrickCardGameService;
import com.threerings.presents.client.Client;
import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
/**
* Provides the implementation of the {@link TrickCardGameService} 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 TrickCardGameMarshaller extends InvocationMarshaller
implements TrickCardGameService
{
/** The method id used to dispatch {@link #playCard} requests. */
public static const PLAY_CARD :int = 1;
// from interface TrickCardGameService
public function playCard (arg1 :Client, arg2 :Card, arg3 :int) :void
{
sendRequest(arg1, PLAY_CARD, [
arg2, Integer.valueOf(arg3)
]);
}
/** The method id used to dispatch {@link #requestRematch} requests. */
public static const REQUEST_REMATCH :int = 2;
// from interface TrickCardGameService
public function requestRematch (arg1 :Client) :void
{
sendRequest(arg1, REQUEST_REMATCH, [
]);
}
/** The method id used to dispatch {@link #sendCardsToPlayer} requests. */
public static const SEND_CARDS_TO_PLAYER :int = 3;
// from interface TrickCardGameService
public function sendCardsToPlayer (arg1 :Client, arg2 :int, arg3 :Array) :void
{
sendRequest(arg1, SEND_CARDS_TO_PLAYER, [
Integer.valueOf(arg2), arg3
]);
}
}
}
@@ -1,9 +1,9 @@
// //
// $Id: ParlorService.java 3525 2005-04-26 02:38:42Z ray $ // $Id$
// //
// Narya library - tools for developing networked games // Vilya 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/ // http://www.threerings.net/code/vilya/
// //
// This library is free software; you can redistribute it and/or modify it // 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 // under the terms of the GNU Lesser General Public License as published
@@ -21,134 +21,45 @@
package com.threerings.parlor.client { package com.threerings.parlor.client {
import com.threerings.util.Name; import com.threerings.parlor.client.ParlorService;
import com.threerings.parlor.client.ParlorService_InviteListener;
import com.threerings.parlor.client.ParlorService_TableListener;
import com.threerings.parlor.data.ParlorMarshaller_InviteMarshaller;
import com.threerings.parlor.data.ParlorMarshaller_TableMarshaller;
import com.threerings.parlor.data.TableConfig;
import com.threerings.parlor.game.data.GameConfig;
import com.threerings.presents.client.Client; import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.InvocationService;
import com.threerings.presents.client.InvocationService_InvocationListener;
import com.threerings.presents.client.InvocationService_ConfirmListener; import com.threerings.presents.client.InvocationService_ConfirmListener;
import com.threerings.presents.client.InvocationService_InvocationListener;
import com.threerings.parlor.data.TableConfig; import com.threerings.presents.data.InvocationMarshaller_ConfirmMarshaller;
import com.threerings.presents.data.InvocationMarshaller_InvocationMarshaller;
import com.threerings.parlor.game.data.GameConfig; import com.threerings.util.Name;
/** /**
* Provides an interface to the various parlor invocation services. * An ActionScript version of the Java ParlorService interface.
* Presently these services are limited to the various matchmaking
* mechanisms. It is unlikely that client code will want to make direct
* use of this class, instead they would make use of the programmatic
* interface provided by the {@link ParlorDirector}.
*/ */
public interface ParlorService extends InvocationService public interface ParlorService extends InvocationService
{ {
/** // from Java interface ParlorService
* You probably don't want to call this directly, but want to generate function cancel (arg1 :Client, arg2 :int, arg3 :InvocationService_InvocationListener) :void;
* your invitation request via {@link ParlorDirector#invite}. Requests
* that an invitation be delivered to the named user, requesting that
* they join the inviting user in a game, the details of which are
* specified in the supplied game config object.
*
* @param client a connected, operational client instance.
* @param invitee the username of the user to be invited.
* @param config a game config object detailing the type and
* configuration of the game to be created.
* @param listener will receive and process the response.
*/
function invite (
client :Client, invitee :Name, config :GameConfig,
listener :ParlorService_InviteListener) :void;
/** // from Java interface ParlorService
* You probably don't want to call this directly, but want to call one function createTable (arg1 :Client, arg2 :int, arg3 :TableConfig, arg4 :GameConfig, arg5 :ParlorService_TableListener) :void;
* of {@link Invitation#accept}, {@link Invitation#refuse}, or {@link
* Invitation#counter}. Requests that an invitation response be
* delivered with the specified parameters.
*
* @param client a connected, operational client instance.
* @param inviteId the unique id previously assigned by the server to
* this invitation.
* @param code the response code to use in responding to the
* invitation.
* @param arg the argument associated with the response (a string
* message from the player explaining why the response was refused in
* the case of an invitation refusal or an updated game configuration
* object in the case of a counter-invitation, or null in the case of
* an accepted invitation).
* @param listener will receive and process the response.
*/
function respond (
client :Client, inviteId :int, code :int, arg :Object,
listener :InvocationService_InvocationListener) :void;
/** // from Java interface ParlorService
* You probably don't want to call this directly, but want to call function invite (arg1 :Client, arg2 :Name, arg3 :GameConfig, arg4 :ParlorService_InviteListener) :void;
* {@link Invitation#cancel}. Requests that an outstanding
* invitation be cancelled.
*
* @param client a connected, operational client instance.
* @param inviteId the unique id previously assigned by the server to
* this invitation.
* @param listener will receive and process the response.
*/
function cancel (
client :Client, inviteId :int,
listener :InvocationService_InvocationListener) :void;
/** // from Java interface ParlorService
* You probably don't want to call this directly, but want to call function joinTable (arg1 :Client, arg2 :int, arg3 :int, arg4 :int, arg5 :InvocationService_InvocationListener) :void;
* {@link TableDirector#createTable}. Requests that a new table be
* created.
*
* @param client a connected, operational client instance.
* @param lobbyOid the oid of the lobby that will contain the newly
* created table.
* @param tableConfig the table configuration parameters.
* @param config the game config for the game to be matchmade by the
* table.
* @param listener will receive and process the response.
*/
function createTable (
client :Client, lobbyOid :int, tableConfig :TableConfig,
config :GameConfig, listener :ParlorService_TableListener) :void;
/** // from Java interface ParlorService
* You probably don't want to call this directly, but want to call function leaveTable (arg1 :Client, arg2 :int, arg3 :int, arg4 :InvocationService_InvocationListener) :void;
* {@link TableDirector#joinTable}. Requests that the current user
* be added to the specified table at the specified position.
*
* @param client a connected, operational client instance.
* @param lobbyOid the oid of the lobby that contains the table.
* @param tableId the unique id of the table to which this user wishes
* to be added.
* @param position the position at the table to which this user desires
* to be added.
* @param listener will receive and process the response.
*/
function joinTable (
client :Client, lobbyOid :int, tableId :int, position :int,
listener :InvocationService_InvocationListener) :void;
/** // from Java interface ParlorService
* You probably don't want to call this directly, but want to call function respond (arg1 :Client, arg2 :int, arg3 :int, arg4 :Object, arg5 :InvocationService_InvocationListener) :void;
* {@link TableDirector#leaveTable}. Requests that the current user be
* removed from the specified table.
*
* @param client a connected, operational client instance.
* @param lobbyOid the oid of the lobby that contains the table.
* @param tableId the unique id of the table from which this user
* wishes to be removed.
* @param listener will receive and process the response.
*/
function leaveTable (
client :Client, lobbyOid :int, tableId :int,
listener :InvocationService_InvocationListener) :void;
/** // from Java interface ParlorService
* Requests to start a single player game with the specified game function startSolitaire (arg1 :Client, arg2 :GameConfig, arg3 :InvocationService_ConfirmListener) :void;
* configuration.
*/
function startSolitaire (
client :Client, config :GameConfig,
listener :InvocationService_ConfirmListener) :void;
} }
} }
@@ -1,16 +1,49 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/vilya/
//
// 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.parlor.client { package com.threerings.parlor.client {
import com.threerings.util.*; // for Float, Integer, etc.
import com.threerings.parlor.client.ParlorService;
import com.threerings.parlor.client.ParlorService_InviteListener;
import com.threerings.parlor.client.ParlorService_TableListener;
import com.threerings.parlor.data.ParlorMarshaller_InviteMarshaller;
import com.threerings.parlor.data.ParlorMarshaller_TableMarshaller;
import com.threerings.parlor.data.TableConfig;
import com.threerings.parlor.game.data.GameConfig;
import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService_ConfirmListener;
import com.threerings.presents.client.InvocationService_InvocationListener; import com.threerings.presents.client.InvocationService_InvocationListener;
import com.threerings.presents.data.InvocationMarshaller_ConfirmMarshaller;
import com.threerings.presents.data.InvocationMarshaller_InvocationMarshaller;
import com.threerings.util.Name;
/** /**
* Used to communicate responses to {@link #invite} requests. * An ActionScript version of the Java ParlorService_InviteListener interface.
*/ */
public interface ParlorService_InviteListener public interface ParlorService_InviteListener
extends InvocationService_InvocationListener extends InvocationService_InvocationListener
{ {
/** // from Java ParlorService_InviteListener
* Called in response to a successful {@link #invite} request. function inviteReceived (arg1 :int) :void
*/
function inviteReceived (inviteId :int) :void;
} }
} }
@@ -1,14 +1,49 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/vilya/
//
// 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.parlor.client { package com.threerings.parlor.client {
import com.threerings.util.*; // for Float, Integer, etc.
import com.threerings.parlor.client.ParlorService;
import com.threerings.parlor.client.ParlorService_InviteListener;
import com.threerings.parlor.client.ParlorService_TableListener;
import com.threerings.parlor.data.ParlorMarshaller_InviteMarshaller;
import com.threerings.parlor.data.ParlorMarshaller_TableMarshaller;
import com.threerings.parlor.data.TableConfig;
import com.threerings.parlor.game.data.GameConfig;
import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService_ConfirmListener;
import com.threerings.presents.client.InvocationService_InvocationListener; import com.threerings.presents.client.InvocationService_InvocationListener;
import com.threerings.presents.data.InvocationMarshaller_ConfirmMarshaller;
import com.threerings.presents.data.InvocationMarshaller_InvocationMarshaller;
import com.threerings.util.Name;
/** /**
* Used to communicate responses to {@link #createTable}, {@link * An ActionScript version of the Java ParlorService_TableListener interface.
* #joinTable}, and {@link #leaveTable} requests.
*/ */
public interface ParlorService_TableListener public interface ParlorService_TableListener
extends InvocationService_InvocationListener extends InvocationService_InvocationListener
{ {
function tableCreated (tableId :int) :void; // from Java ParlorService_TableListener
function tableCreated (arg1 :int) :void
} }
} }
@@ -1,9 +1,9 @@
// //
// $Id: ParlorMarshaller.java 4145 2006-05-24 01:24:24Z ray $ // $Id$
// //
// Narya library - tools for developing networked games // Vilya library - tools for developing networked games
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved // Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/narya/ // http://www.threerings.net/code/vilya/
// //
// This library is free software; you can redistribute it and/or modify it // 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 // under the terms of the GNU Lesser General Public License as published
@@ -21,21 +21,22 @@
package com.threerings.parlor.data { package com.threerings.parlor.data {
import com.threerings.util.*; // for Float, Integer, etc.
import com.threerings.parlor.client.ParlorService; import com.threerings.parlor.client.ParlorService;
import com.threerings.parlor.client.ParlorService_InviteListener; import com.threerings.parlor.client.ParlorService_InviteListener;
import com.threerings.parlor.client.ParlorService_TableListener; import com.threerings.parlor.client.ParlorService_TableListener;
import com.threerings.parlor.data.ParlorMarshaller_InviteMarshaller;
import com.threerings.parlor.data.ParlorMarshaller_TableMarshaller;
import com.threerings.parlor.data.TableConfig; import com.threerings.parlor.data.TableConfig;
import com.threerings.parlor.game.data.GameConfig; import com.threerings.parlor.game.data.GameConfig;
import com.threerings.presents.client.Client; import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.client.InvocationService_ConfirmListener; import com.threerings.presents.client.InvocationService_ConfirmListener;
import com.threerings.presents.client.InvocationService_InvocationListener; import com.threerings.presents.client.InvocationService_InvocationListener;
import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.data.InvocationMarshaller_ConfirmMarshaller; import com.threerings.presents.data.InvocationMarshaller_ConfirmMarshaller;
import com.threerings.presents.data.InvocationMarshaller_InvocationMarshaller;
import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller; import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
import com.threerings.presents.dobj.InvocationResponseEvent;
import com.threerings.util.Integer;
import com.threerings.util.Name; import com.threerings.util.Name;
/** /**
@@ -51,11 +52,10 @@ public class ParlorMarshaller extends InvocationMarshaller
/** The method id used to dispatch {@link #cancel} requests. */ /** The method id used to dispatch {@link #cancel} requests. */
public static const CANCEL :int = 1; public static const CANCEL :int = 1;
// documentation inherited from interface // from interface ParlorService
public function cancel (arg1 :Client, arg2 :int, arg3 :InvocationService_InvocationListener) :void public function cancel (arg1 :Client, arg2 :int, arg3 :InvocationService_InvocationListener) :void
{ {
var listener3 :InvocationMarshaller_ListenerMarshaller = var listener3 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller();
new InvocationMarshaller_ListenerMarshaller();
listener3.listener = arg3; listener3.listener = arg3;
sendRequest(arg1, CANCEL, [ sendRequest(arg1, CANCEL, [
Integer.valueOf(arg2), listener3 Integer.valueOf(arg2), listener3
@@ -65,11 +65,10 @@ public class ParlorMarshaller extends InvocationMarshaller
/** The method id used to dispatch {@link #createTable} requests. */ /** The method id used to dispatch {@link #createTable} requests. */
public static const CREATE_TABLE :int = 2; public static const CREATE_TABLE :int = 2;
// documentation inherited from interface // from interface ParlorService
public function createTable (arg1 :Client, arg2 :int, arg3 :TableConfig, arg4 :GameConfig, arg5 :ParlorService_TableListener) :void public function createTable (arg1 :Client, arg2 :int, arg3 :TableConfig, arg4 :GameConfig, arg5 :ParlorService_TableListener) :void
{ {
var listener5 :ParlorMarshaller_TableMarshaller = var listener5 :ParlorMarshaller_TableMarshaller = new ParlorMarshaller_TableMarshaller();
new ParlorMarshaller_TableMarshaller();
listener5.listener = arg5; listener5.listener = arg5;
sendRequest(arg1, CREATE_TABLE, [ sendRequest(arg1, CREATE_TABLE, [
Integer.valueOf(arg2), arg3, arg4, listener5 Integer.valueOf(arg2), arg3, arg4, listener5
@@ -79,11 +78,10 @@ public class ParlorMarshaller extends InvocationMarshaller
/** The method id used to dispatch {@link #invite} requests. */ /** The method id used to dispatch {@link #invite} requests. */
public static const INVITE :int = 3; public static const INVITE :int = 3;
// documentation inherited from interface // from interface ParlorService
public function invite (arg1 :Client, arg2 :Name, arg3 :GameConfig, arg4 :ParlorService_InviteListener) :void public function invite (arg1 :Client, arg2 :Name, arg3 :GameConfig, arg4 :ParlorService_InviteListener) :void
{ {
var listener4 :ParlorMarshaller_InviteMarshaller = var listener4 :ParlorMarshaller_InviteMarshaller = new ParlorMarshaller_InviteMarshaller();
new ParlorMarshaller_InviteMarshaller();
listener4.listener = arg4; listener4.listener = arg4;
sendRequest(arg1, INVITE, [ sendRequest(arg1, INVITE, [
arg2, arg3, listener4 arg2, arg3, listener4
@@ -93,11 +91,10 @@ public class ParlorMarshaller extends InvocationMarshaller
/** The method id used to dispatch {@link #joinTable} requests. */ /** The method id used to dispatch {@link #joinTable} requests. */
public static const JOIN_TABLE :int = 4; public static const JOIN_TABLE :int = 4;
// documentation inherited from interface // from interface ParlorService
public function joinTable (arg1 :Client, arg2 :int, arg3 :int, arg4 :int, arg5 :InvocationService_InvocationListener) :void public function joinTable (arg1 :Client, arg2 :int, arg3 :int, arg4 :int, arg5 :InvocationService_InvocationListener) :void
{ {
var listener5 :InvocationMarshaller_ListenerMarshaller = var listener5 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller();
new InvocationMarshaller_ListenerMarshaller();
listener5.listener = arg5; listener5.listener = arg5;
sendRequest(arg1, JOIN_TABLE, [ sendRequest(arg1, JOIN_TABLE, [
Integer.valueOf(arg2), Integer.valueOf(arg3), Integer.valueOf(arg4), listener5 Integer.valueOf(arg2), Integer.valueOf(arg3), Integer.valueOf(arg4), listener5
@@ -107,11 +104,10 @@ public class ParlorMarshaller extends InvocationMarshaller
/** The method id used to dispatch {@link #leaveTable} requests. */ /** The method id used to dispatch {@link #leaveTable} requests. */
public static const LEAVE_TABLE :int = 5; public static const LEAVE_TABLE :int = 5;
// documentation inherited from interface // from interface ParlorService
public function leaveTable (arg1 :Client, arg2 :int, arg3 :int, arg4 :InvocationService_InvocationListener) :void public function leaveTable (arg1 :Client, arg2 :int, arg3 :int, arg4 :InvocationService_InvocationListener) :void
{ {
var listener4 :InvocationMarshaller_ListenerMarshaller = var listener4 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller();
new InvocationMarshaller_ListenerMarshaller();
listener4.listener = arg4; listener4.listener = arg4;
sendRequest(arg1, LEAVE_TABLE, [ sendRequest(arg1, LEAVE_TABLE, [
Integer.valueOf(arg2), Integer.valueOf(arg3), listener4 Integer.valueOf(arg2), Integer.valueOf(arg3), listener4
@@ -121,11 +117,10 @@ public class ParlorMarshaller extends InvocationMarshaller
/** The method id used to dispatch {@link #respond} requests. */ /** The method id used to dispatch {@link #respond} requests. */
public static const RESPOND :int = 6; public static const RESPOND :int = 6;
// documentation inherited from interface // from interface ParlorService
public function respond (arg1 :Client, arg2 :int, arg3 :int, arg4 :Object, arg5 :InvocationService_InvocationListener) :void public function respond (arg1 :Client, arg2 :int, arg3 :int, arg4 :Object, arg5 :InvocationService_InvocationListener) :void
{ {
var listener5 :InvocationMarshaller_ListenerMarshaller = var listener5 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller();
new InvocationMarshaller_ListenerMarshaller();
listener5.listener = arg5; listener5.listener = arg5;
sendRequest(arg1, RESPOND, [ sendRequest(arg1, RESPOND, [
Integer.valueOf(arg2), Integer.valueOf(arg3), arg4, listener5 Integer.valueOf(arg2), Integer.valueOf(arg3), arg4, listener5
@@ -135,16 +130,14 @@ public class ParlorMarshaller extends InvocationMarshaller
/** The method id used to dispatch {@link #startSolitaire} requests. */ /** The method id used to dispatch {@link #startSolitaire} requests. */
public static const START_SOLITAIRE :int = 7; public static const START_SOLITAIRE :int = 7;
// documentation inherited from interface // from interface ParlorService
public function startSolitaire (arg1 :Client, arg2 :GameConfig, arg3 :InvocationService_ConfirmListener) :void public function startSolitaire (arg1 :Client, arg2 :GameConfig, arg3 :InvocationService_ConfirmListener) :void
{ {
var listener3 :InvocationMarshaller_ConfirmMarshaller = var listener3 :InvocationMarshaller_ConfirmMarshaller = new InvocationMarshaller_ConfirmMarshaller();
new InvocationMarshaller_ConfirmMarshaller();
listener3.listener = arg3; listener3.listener = arg3;
sendRequest(arg1, START_SOLITAIRE, [ sendRequest(arg1, START_SOLITAIRE, [
arg2, listener3 arg2, listener3
]); ]);
} }
} }
} }
@@ -1,21 +1,47 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/vilya/
//
// 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.parlor.data { package com.threerings.parlor.data {
import com.threerings.util.Integer; import com.threerings.util.*; // for Float, Integer, etc.
import com.threerings.presents.dobj.InvocationResponseEvent;
import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
import com.threerings.parlor.client.ParlorService;
import com.threerings.parlor.client.ParlorService_InviteListener; import com.threerings.parlor.client.ParlorService_InviteListener;
import com.threerings.parlor.data.TableConfig;
import com.threerings.parlor.game.data.GameConfig;
import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
import com.threerings.util.Name;
/**
* Marshalls instances of the ParlorService_InviteMarshaller interface.
*/
public class ParlorMarshaller_InviteMarshaller public class ParlorMarshaller_InviteMarshaller
extends InvocationMarshaller_ListenerMarshaller extends InvocationMarshaller_ListenerMarshaller
{ {
/** The method id used to dispatch {@link #inviteReceived} /** The method id used to dispatch {@link #inviteReceived} responses. */
* responses. */
public static const INVITE_RECEIVED :int = 1; public static const INVITE_RECEIVED :int = 1;
// documentation inherited // from InvocationMarshaller_ListenerMarshaller
override public function dispatchResponse (methodId :int, args :Array) :void override public function dispatchResponse (methodId :int, args :Array) :void
{ {
switch (methodId) { switch (methodId) {
@@ -1,21 +1,47 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/vilya/
//
// 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.parlor.data { package com.threerings.parlor.data {
import com.threerings.util.Integer; import com.threerings.util.*; // for Float, Integer, etc.
import com.threerings.presents.dobj.InvocationResponseEvent;
import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
import com.threerings.parlor.client.ParlorService;
import com.threerings.parlor.client.ParlorService_TableListener; import com.threerings.parlor.client.ParlorService_TableListener;
import com.threerings.parlor.data.TableConfig;
import com.threerings.parlor.game.data.GameConfig;
import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
import com.threerings.util.Name;
/**
* Marshalls instances of the ParlorService_TableMarshaller interface.
*/
public class ParlorMarshaller_TableMarshaller public class ParlorMarshaller_TableMarshaller
extends InvocationMarshaller_ListenerMarshaller extends InvocationMarshaller_ListenerMarshaller
{ {
/** The method id used to dispatch {@link #tableCreated} /** The method id used to dispatch {@link #tableCreated} responses. */
* responses. */
public static const TABLE_CREATED :int = 1; public static const TABLE_CREATED :int = 1;
// documentation inherited // from InvocationMarshaller_ListenerMarshaller
override public function dispatchResponse (methodId :int, args :Array) :void override public function dispatchResponse (methodId :int, args :Array) :void
{ {
switch (methodId) { switch (methodId) {
@@ -1,9 +1,9 @@
// //
// $Id: SceneService.java 3099 2004-08-27 02:21:06Z mdb $ // $Id$
// //
// Narya library - tools for developing networked games // Vilya 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/ // http://www.threerings.net/code/vilya/
// //
// This library is free software; you can redistribute it and/or modify it // 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 // under the terms of the GNU Lesser General Public License as published
@@ -21,30 +21,22 @@
package com.threerings.whirled.client { package com.threerings.whirled.client {
import com.threerings.crowd.data.PlaceConfig;
import com.threerings.presents.client.Client; import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.InvocationService;
import com.threerings.presents.client.InvocationService_InvocationListener;
import com.threerings.crowd.data.PlaceConfig; import com.threerings.whirled.client.SceneService;
import com.threerings.whirled.client.SceneService_SceneMoveListener;
import com.threerings.whirled.data.SceneMarshaller_SceneMoveMarshaller;
import com.threerings.whirled.data.SceneModel; import com.threerings.whirled.data.SceneModel;
import com.threerings.whirled.data.SceneUpdate; import com.threerings.whirled.data.SceneUpdate;
/** /**
* The scene service class provides the client interface to the scene * An ActionScript version of the Java SceneService interface.
* related invocation services (e.g. moving from scene to scene).
*/ */
public interface SceneService extends InvocationService public interface SceneService extends InvocationService
{ {
/** // from Java interface SceneService
* Requests that that this client's body be moved to the specified function moveTo (arg1 :Client, arg2 :int, arg3 :int, arg4 :SceneService_SceneMoveListener) :void;
* scene.
*
* @param sceneId the scene id to which we want to move.
* @param version the version number of the scene object that we have
* in our local repository.
*/
function moveTo (
client :Client, sceneId :int, version :int,
listener :SceneService_SceneMoveListener) :void;
} }
} }
@@ -1,51 +1,50 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/vilya/
//
// 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.whirled.client { package com.threerings.whirled.client {
import com.threerings.presents.client.InvocationService_InvocationListener; import com.threerings.util.*; // for Float, Integer, etc.
import com.threerings.io.TypedArray;
import com.threerings.crowd.data.PlaceConfig; import com.threerings.crowd.data.PlaceConfig;
import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService_InvocationListener;
import com.threerings.whirled.client.SceneService;
import com.threerings.whirled.client.SceneService_SceneMoveListener;
import com.threerings.whirled.data.SceneMarshaller_SceneMoveMarshaller;
import com.threerings.whirled.data.SceneModel; import com.threerings.whirled.data.SceneModel;
import com.threerings.whirled.data.SceneUpdate; import com.threerings.whirled.data.SceneUpdate;
/** /**
* Used to communicate the response to a {@link #moveTo} request. * An ActionScript version of the Java SceneService_SceneMoveListener interface.
*/ */
public interface SceneService_SceneMoveListener public interface SceneService_SceneMoveListener
extends InvocationService_InvocationListener extends InvocationService_InvocationListener
{ {
/** // from Java SceneService_SceneMoveListener
* Indicates that a move succeeded. function moveSucceeded (arg1 :int, arg2 :PlaceConfig) :void
*
* @param placeId the place object id of the newly occupied scene.
* @param config metadata related to the newly occupied scene.
*/
function moveSucceeded (placeId :int, config :PlaceConfig) :void;
/** // from Java SceneService_SceneMoveListener
* Indicates that a move succeeded and that the client's cached function moveSucceededWithScene (arg1 :int, arg2 :PlaceConfig, arg3 :SceneModel) :void
* scene information should be updated with the supplied data.
*
* @param placeId the place object id of the newly occupied scene.
* @param config metadata related to the newly occupied scene.
* @param updates updates that must be applied to the client's
* copy of a scene model to bring it up to date.
*/
function moveSucceededWithUpdates (
placeId :int, config :PlaceConfig,
updates :TypedArray /*of SceneUpdate*/) :void;
/** // from Java SceneService_SceneMoveListener
* Indicates that a move succeeded and that the client's cached function moveSucceededWithUpdates (arg1 :int, arg2 :PlaceConfig, arg3 :Array) :void
* scene information should be updated with the supplied data.
*
* @param placeId the place object id of the newly occupied scene.
* @param config metadata related to the newly occupied scene.
* @param model a fresh copy of the most recent scene data for the
* newly occupied scene.
*/
function moveSucceededWithScene (
placeId :int, config :PlaceConfig, model :SceneModel) :void;
} }
} }
@@ -1,9 +1,9 @@
// //
// $Id: SceneMarshaller.java 3793 2005-12-21 02:12:57Z ray $ // $Id$
// //
// Narya library - tools for developing networked games // Vilya 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/ // http://www.threerings.net/code/vilya/
// //
// This library is free software; you can redistribute it and/or modify it // 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 // under the terms of the GNU Lesser General Public License as published
@@ -21,12 +21,17 @@
package com.threerings.whirled.data { package com.threerings.whirled.data {
import com.threerings.util.Integer; import com.threerings.util.*; // for Float, Integer, etc.
import com.threerings.crowd.data.PlaceConfig;
import com.threerings.presents.client.Client; import com.threerings.presents.client.Client;
import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
import com.threerings.whirled.client.SceneService; import com.threerings.whirled.client.SceneService;
import com.threerings.whirled.client.SceneService_SceneMoveListener; import com.threerings.whirled.client.SceneService_SceneMoveListener;
import com.threerings.whirled.data.SceneMarshaller_SceneMoveMarshaller;
import com.threerings.whirled.data.SceneModel;
import com.threerings.whirled.data.SceneUpdate;
/** /**
* Provides the implementation of the {@link SceneService} interface * Provides the implementation of the {@link SceneService} interface
@@ -41,13 +46,14 @@ public class SceneMarshaller extends InvocationMarshaller
/** The method id used to dispatch {@link #moveTo} requests. */ /** The method id used to dispatch {@link #moveTo} requests. */
public static const MOVE_TO :int = 1; public static const MOVE_TO :int = 1;
// documentation inherited from interface // from interface SceneService
public function moveTo (arg1 :Client, arg2 :int, arg3 :int, arg4 :SceneService_SceneMoveListener) :void public function moveTo (arg1 :Client, arg2 :int, arg3 :int, arg4 :SceneService_SceneMoveListener) :void
{ {
var listener4 :SceneMarshaller_SceneMoveMarshaller = new SceneMarshaller_SceneMoveMarshaller(); var listener4 :SceneMarshaller_SceneMoveMarshaller = new SceneMarshaller_SceneMoveMarshaller();
listener4.listener = arg4; listener4.listener = arg4;
sendRequest(arg1, MOVE_TO, [ new Integer(arg2), new Integer(arg3), listener4 ]); sendRequest(arg1, MOVE_TO, [
Integer.valueOf(arg2), Integer.valueOf(arg3), listener4
]);
} }
} }
} }
@@ -1,56 +1,74 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/vilya/
//
// 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.whirled.data { package com.threerings.whirled.data {
import com.threerings.util.Integer; import com.threerings.util.*; // for Float, Integer, etc.
import com.threerings.io.TypedArray;
import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
import com.threerings.crowd.data.PlaceConfig; import com.threerings.crowd.data.PlaceConfig;
import com.threerings.presents.client.Client;
import com.threerings.presents.dobj.InvocationResponseEvent; import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
import com.threerings.whirled.client.SceneService;
import com.threerings.whirled.client.SceneService_SceneMoveListener; import com.threerings.whirled.client.SceneService_SceneMoveListener;
import com.threerings.whirled.data.SceneModel; import com.threerings.whirled.data.SceneModel;
import com.threerings.whirled.data.SceneUpdate; import com.threerings.whirled.data.SceneUpdate;
public class SceneMarshaller_SceneMoveMarshaller extends InvocationMarshaller_ListenerMarshaller /**
* Marshalls instances of the SceneService_SceneMoveMarshaller interface.
*/
public class SceneMarshaller_SceneMoveMarshaller
extends InvocationMarshaller_ListenerMarshaller
{ {
/** The method id used to dispatch {@link #moveSucceeded} /** The method id used to dispatch {@link #moveSucceeded} responses. */
* responses. */
public static const MOVE_SUCCEEDED :int = 1; public static const MOVE_SUCCEEDED :int = 1;
/** The method id used to dispatch {@link #moveSucceededWithScene} /** The method id used to dispatch {@link #moveSucceededWithScene} responses. */
* responses. */
public static const MOVE_SUCCEEDED_WITH_SCENE :int = 2; public static const MOVE_SUCCEEDED_WITH_SCENE :int = 2;
/** The method id used to dispatch {@link #moveSucceededWithUpdates} /** The method id used to dispatch {@link #moveSucceededWithUpdates} responses. */
* responses. */
public static const MOVE_SUCCEEDED_WITH_UPDATES :int = 3; public static const MOVE_SUCCEEDED_WITH_UPDATES :int = 3;
// documentation inherited // from InvocationMarshaller_ListenerMarshaller
override public function dispatchResponse (methodId :int, args :Array) :void override public function dispatchResponse (methodId :int, args :Array) :void
{ {
switch (methodId) { switch (methodId) {
case MOVE_SUCCEEDED: case MOVE_SUCCEEDED:
(listener as SceneService_SceneMoveListener).moveSucceeded( (listener as SceneService_SceneMoveListener).moveSucceeded(
(args[0] as Integer).value, args[1] as PlaceConfig); (args[0] as Integer).value, (args[1] as PlaceConfig));
return; return;
case MOVE_SUCCEEDED_WITH_SCENE: case MOVE_SUCCEEDED_WITH_SCENE:
(listener as SceneService_SceneMoveListener).moveSucceededWithScene( (listener as SceneService_SceneMoveListener).moveSucceededWithScene(
(args[0] as Integer).value, args[1] as PlaceConfig, args[2] as SceneModel); (args[0] as Integer).value, (args[1] as PlaceConfig), (args[2] as SceneModel));
return; return;
case MOVE_SUCCEEDED_WITH_UPDATES: case MOVE_SUCCEEDED_WITH_UPDATES:
(listener as SceneService_SceneMoveListener).moveSucceededWithUpdates( (listener as SceneService_SceneMoveListener).moveSucceededWithUpdates(
(args[0] as Integer).value, args[1] as PlaceConfig, args[2] as TypedArray); (args[0] as Integer).value, (args[1] as PlaceConfig), (args[2] as Array));
return; return;
default: default:
super.dispatchResponse(methodId, args); super.dispatchResponse(methodId, args);
return;
} }
} }
} }
} }
@@ -1,9 +1,9 @@
// //
// $Id: SpotService.java 3363 2005-02-22 18:54:48Z mdb $ // $Id$
// //
// Narya library - tools for developing networked games // Vilya 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/ // http://www.threerings.net/code/vilya/
// //
// This library is free software; you can redistribute it and/or modify it // 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 // under the terms of the GNU Lesser General Public License as published
@@ -24,64 +24,28 @@ package com.threerings.whirled.spot.client {
import com.threerings.presents.client.Client; import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.InvocationService;
import com.threerings.presents.client.InvocationService_ConfirmListener; import com.threerings.presents.client.InvocationService_ConfirmListener;
import com.threerings.presents.client.InvocationService_InvocationListener;
import com.threerings.presents.data.InvocationMarshaller_ConfirmMarshaller;
import com.threerings.whirled.client.SceneService_SceneMoveListener; import com.threerings.whirled.client.SceneService_SceneMoveListener;
import com.threerings.whirled.data.SceneMarshaller_SceneMoveMarshaller;
import com.threerings.whirled.spot.client.SpotService;
import com.threerings.whirled.spot.data.Location; import com.threerings.whirled.spot.data.Location;
/** /**
* Defines the mechanism by which the client can request to move around * An ActionScript version of the Java SpotService interface.
* within a scene and between scenes (taking exit and entry locations into
* account). These services should not be used directly, but instead
* should be accessed via the {@link SpotSceneDirector}.
*/ */
public interface SpotService extends InvocationService public interface SpotService extends InvocationService
{ {
/** // from Java interface SpotService
* Requests to traverse the specified portal. function changeLocation (arg1 :Client, arg2 :int, arg3 :Location, arg4 :InvocationService_ConfirmListener) :void;
*
* @param sceneId the player's current scene which is used to sanity
* check things when the request actually arrives.
* @param portalId the portal to be traversed.
* @param destSceneVer the version of the destination scene data that
* the client has in its local repository.
*/
function traversePortal (
client :Client, sceneId :int, portalId :int, destSceneVer :int,
listener :SceneService_SceneMoveListener) :void;
/** // from Java interface SpotService
* Requests that this client's body be made to move to the specified function clusterSpeak (arg1 :Client, arg2 :String, arg3 :int) :void;
* location. The user will be removed from any cluster from which they
* are an occupant.
*
* @param sceneId the id of the scene in which to change location.
* @param loc the location to which to move.
*/
function changeLocation (
client :Client, sceneId :int, loc :Location,
listener :InvocationService_ConfirmListener) :void;
/** // from Java interface SpotService
* Requests that this client start or join the specified cluster. They function joinCluster (arg1 :Client, arg2 :int, arg3 :InvocationService_ConfirmListener) :void;
* will be relocated appropriately by the scene manager.
*
* @param friendOid the bodyOid of another user or the oid of an
* existing cluster; the calling user will be made to join the cluster
* or target user's cluster, or create a cluster with the target user
* if they are not already in one.
*/
function joinCluster (
client :Client, friendOid :int,
listener :InvocationService_ConfirmListener) :void;
/** // from Java interface SpotService
* Requests that the supplied message be delivered to listeners in the function traversePortal (arg1 :Client, arg2 :int, arg3 :int, arg4 :int, arg5 :SceneService_SceneMoveListener) :void;
* cluster to which the specified location belongs.
*
* @param message the text of the message to be spoken.
* @param mode an associated mode constant that can be used to
* identify different kinds of "speech" (emote, thought bubble, etc.).
*/
function clusterSpeak (client :Client, message :String, mode :int) :void;
} }
} }
@@ -1,9 +1,9 @@
// //
// $Id$ // $Id$
// //
// Narya library - tools for developing networked games // Vilya 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/ // http://www.threerings.net/code/vilya/
// //
// This library is free software; you can redistribute it and/or modify it // 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 // under the terms of the GNU Lesser General Public License as published
@@ -21,16 +21,13 @@
package com.threerings.whirled.spot.data { package com.threerings.whirled.spot.data {
import com.threerings.util.Byte; import com.threerings.util.*; // for Float, Integer, etc.
import com.threerings.util.Integer;
import com.threerings.presents.client.Client; import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.client.InvocationService_ConfirmListener; import com.threerings.presents.client.InvocationService_ConfirmListener;
import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.data.InvocationMarshaller_ConfirmMarshaller; import com.threerings.presents.data.InvocationMarshaller_ConfirmMarshaller;
import com.threerings.presents.dobj.InvocationResponseEvent; import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
import com.threerings.whirled.client.SceneService;
import com.threerings.whirled.client.SceneService_SceneMoveListener; import com.threerings.whirled.client.SceneService_SceneMoveListener;
import com.threerings.whirled.data.SceneMarshaller_SceneMoveMarshaller; import com.threerings.whirled.data.SceneMarshaller_SceneMoveMarshaller;
import com.threerings.whirled.spot.client.SpotService; import com.threerings.whirled.spot.client.SpotService;
@@ -49,52 +46,51 @@ public class SpotMarshaller extends InvocationMarshaller
/** The method id used to dispatch {@link #changeLocation} requests. */ /** The method id used to dispatch {@link #changeLocation} requests. */
public static const CHANGE_LOCATION :int = 1; public static const CHANGE_LOCATION :int = 1;
// documentation inherited from interface // from interface SpotService
public function changeLocation (arg1 :Client, arg2 :int, arg3 :Location, arg4 :InvocationService_ConfirmListener) :void public function changeLocation (arg1 :Client, arg2 :int, arg3 :Location, arg4 :InvocationService_ConfirmListener) :void
{ {
var listener4 :InvocationMarshaller_ConfirmMarshaller = new InvocationMarshaller_ConfirmMarshaller(); var listener4 :InvocationMarshaller_ConfirmMarshaller = new InvocationMarshaller_ConfirmMarshaller();
listener4.listener = arg4; listener4.listener = arg4;
sendRequest(arg1, CHANGE_LOCATION, [ sendRequest(arg1, CHANGE_LOCATION, [
new Integer(arg2), arg3, listener4 Integer.valueOf(arg2), arg3, listener4
]); ]);
} }
/** The method id used to dispatch {@link #clusterSpeak} requests. */ /** The method id used to dispatch {@link #clusterSpeak} requests. */
public static const CLUSTER_SPEAK :int = 2; public static const CLUSTER_SPEAK :int = 2;
// documentation inherited from interface // from interface SpotService
public function clusterSpeak (arg1 :Client, arg2 :String, arg3 :int) :void public function clusterSpeak (arg1 :Client, arg2 :String, arg3 :int) :void
{ {
sendRequest(arg1, CLUSTER_SPEAK, [ sendRequest(arg1, CLUSTER_SPEAK, [
arg2, new Byte(arg3) arg2, Byte.valueOf(arg3)
]); ]);
} }
/** The method id used to dispatch {@link #joinCluster} requests. */ /** The method id used to dispatch {@link #joinCluster} requests. */
public static const JOIN_CLUSTER :int = 3; public static const JOIN_CLUSTER :int = 3;
// documentation inherited from interface // from interface SpotService
public function joinCluster (arg1 :Client, arg2 :int, arg3 :InvocationService_ConfirmListener) :void public function joinCluster (arg1 :Client, arg2 :int, arg3 :InvocationService_ConfirmListener) :void
{ {
var listener3 :InvocationMarshaller_ConfirmMarshaller = new InvocationMarshaller_ConfirmMarshaller(); var listener3 :InvocationMarshaller_ConfirmMarshaller = new InvocationMarshaller_ConfirmMarshaller();
listener3.listener = arg3; listener3.listener = arg3;
sendRequest(arg1, JOIN_CLUSTER, [ sendRequest(arg1, JOIN_CLUSTER, [
new Integer(arg2), listener3 Integer.valueOf(arg2), listener3
]); ]);
} }
/** The method id used to dispatch {@link #traversePortal} requests. */ /** The method id used to dispatch {@link #traversePortal} requests. */
public static const TRAVERSE_PORTAL :int = 4; public static const TRAVERSE_PORTAL :int = 4;
// documentation inherited from interface // from interface SpotService
public function traversePortal (arg1 :Client, arg2 :int, arg3 :int, arg4 :int, arg5 :SceneService_SceneMoveListener) :void public function traversePortal (arg1 :Client, arg2 :int, arg3 :int, arg4 :int, arg5 :SceneService_SceneMoveListener) :void
{ {
var listener5 :SceneMarshaller_SceneMoveMarshaller = new SceneMarshaller_SceneMoveMarshaller(); var listener5 :SceneMarshaller_SceneMoveMarshaller = new SceneMarshaller_SceneMoveMarshaller();
listener5.listener = arg5; listener5.listener = arg5;
sendRequest(arg1, TRAVERSE_PORTAL, [ sendRequest(arg1, TRAVERSE_PORTAL, [
new Integer(arg2), new Integer(arg3), new Integer(arg4), listener5 Integer.valueOf(arg2), Integer.valueOf(arg3), Integer.valueOf(arg4), listener5
]); ]);
} }
} }
} }
@@ -0,0 +1,43 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/vilya/
//
// 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.whirled.zone.client {
import com.threerings.crowd.data.PlaceConfig;
import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.client.InvocationService_InvocationListener;
import com.threerings.whirled.data.SceneModel;
import com.threerings.whirled.data.SceneUpdate;
import com.threerings.whirled.zone.client.ZoneService;
import com.threerings.whirled.zone.client.ZoneService_ZoneMoveListener;
import com.threerings.whirled.zone.data.ZoneMarshaller_ZoneMoveMarshaller;
import com.threerings.whirled.zone.data.ZoneSummary;
/**
* An ActionScript version of the Java ZoneService interface.
*/
public interface ZoneService extends InvocationService
{
// from Java interface ZoneService
function moveTo (arg1 :Client, arg2 :int, arg3 :int, arg4 :int, arg5 :ZoneService_ZoneMoveListener) :void;
}
}
@@ -0,0 +1,51 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/vilya/
//
// 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.whirled.zone.client {
import com.threerings.util.*; // for Float, Integer, etc.
import com.threerings.crowd.data.PlaceConfig;
import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService_InvocationListener;
import com.threerings.whirled.data.SceneModel;
import com.threerings.whirled.data.SceneUpdate;
import com.threerings.whirled.zone.client.ZoneService;
import com.threerings.whirled.zone.client.ZoneService_ZoneMoveListener;
import com.threerings.whirled.zone.data.ZoneMarshaller_ZoneMoveMarshaller;
import com.threerings.whirled.zone.data.ZoneSummary;
/**
* An ActionScript version of the Java ZoneService_ZoneMoveListener interface.
*/
public interface ZoneService_ZoneMoveListener
extends InvocationService_InvocationListener
{
// from Java ZoneService_ZoneMoveListener
function moveSucceeded (arg1 :int, arg2 :PlaceConfig, arg3 :ZoneSummary) :void
// from Java ZoneService_ZoneMoveListener
function moveSucceededWithScene (arg1 :int, arg2 :PlaceConfig, arg3 :ZoneSummary, arg4 :SceneModel) :void
// from Java ZoneService_ZoneMoveListener
function moveSucceededWithUpdates (arg1 :int, arg2 :PlaceConfig, arg3 :ZoneSummary, arg4 :Array) :void
}
}
@@ -0,0 +1,60 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/vilya/
//
// 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.whirled.zone.data {
import com.threerings.util.*; // for Float, Integer, etc.
import com.threerings.crowd.data.PlaceConfig;
import com.threerings.presents.client.Client;
import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
import com.threerings.whirled.data.SceneModel;
import com.threerings.whirled.data.SceneUpdate;
import com.threerings.whirled.zone.client.ZoneService;
import com.threerings.whirled.zone.client.ZoneService_ZoneMoveListener;
import com.threerings.whirled.zone.data.ZoneMarshaller_ZoneMoveMarshaller;
import com.threerings.whirled.zone.data.ZoneSummary;
/**
* Provides the implementation of the {@link ZoneService} 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 ZoneMarshaller extends InvocationMarshaller
implements ZoneService
{
/** The method id used to dispatch {@link #moveTo} requests. */
public static const MOVE_TO :int = 1;
// from interface ZoneService
public function moveTo (arg1 :Client, arg2 :int, arg3 :int, arg4 :int, arg5 :ZoneService_ZoneMoveListener) :void
{
var listener5 :ZoneMarshaller_ZoneMoveMarshaller = new ZoneMarshaller_ZoneMoveMarshaller();
listener5.listener = arg5;
sendRequest(arg1, MOVE_TO, [
Integer.valueOf(arg2), Integer.valueOf(arg3), Integer.valueOf(arg4), listener5
]);
}
}
}
@@ -0,0 +1,75 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/vilya/
//
// 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.whirled.zone.data {
import com.threerings.util.*; // for Float, Integer, etc.
import com.threerings.crowd.data.PlaceConfig;
import com.threerings.presents.client.Client;
import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
import com.threerings.whirled.data.SceneModel;
import com.threerings.whirled.data.SceneUpdate;
import com.threerings.whirled.zone.client.ZoneService;
import com.threerings.whirled.zone.client.ZoneService_ZoneMoveListener;
import com.threerings.whirled.zone.data.ZoneSummary;
/**
* Marshalls instances of the ZoneService_ZoneMoveMarshaller interface.
*/
public class ZoneMarshaller_ZoneMoveMarshaller
extends InvocationMarshaller_ListenerMarshaller
{
/** The method id used to dispatch {@link #moveSucceeded} responses. */
public static const MOVE_SUCCEEDED :int = 1;
/** The method id used to dispatch {@link #moveSucceededWithScene} responses. */
public static const MOVE_SUCCEEDED_WITH_SCENE :int = 2;
/** The method id used to dispatch {@link #moveSucceededWithUpdates} responses. */
public static const MOVE_SUCCEEDED_WITH_UPDATES :int = 3;
// from InvocationMarshaller_ListenerMarshaller
override public function dispatchResponse (methodId :int, args :Array) :void
{
switch (methodId) {
case MOVE_SUCCEEDED:
(listener as ZoneService_ZoneMoveListener).moveSucceeded(
(args[0] as Integer).value, (args[1] as PlaceConfig), (args[2] as ZoneSummary));
return;
case MOVE_SUCCEEDED_WITH_SCENE:
(listener as ZoneService_ZoneMoveListener).moveSucceededWithScene(
(args[0] as Integer).value, (args[1] as PlaceConfig), (args[2] as ZoneSummary), (args[3] as SceneModel));
return;
case MOVE_SUCCEEDED_WITH_UPDATES:
(listener as ZoneService_ZoneMoveListener).moveSucceededWithUpdates(
(args[0] as Integer).value, (args[1] as PlaceConfig), (args[2] as ZoneSummary), (args[3] as Array));
return;
default:
super.dispatchResponse(methodId, args);
return;
}
}
}
}