From 9a822fe561908e5e8e85f55cd72234219a11542e Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Wed, 6 Aug 2008 00:41:46 +0000 Subject: [PATCH] - Adding support for booting players from a table - Apparently genservice hasn't been run in a while, so half of vilya just got poked git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@709 c613c5cb-e716-0410-b11b-feb51c14d237 --- .../trick/data/TrickCardGameMarshaller.as | 8 ++-- .../threerings/parlor/client/TableService.as | 3 ++ .../parlor/data/ParlorMarshaller.as | 10 ++-- .../data/ParlorMarshaller_InviteMarshaller.as | 2 +- .../threerings/parlor/data/TableMarshaller.as | 31 ++++++++---- .../whirled/data/SceneMarshaller.as | 4 +- .../SceneMarshaller_SceneMoveMarshaller.as | 8 ++-- .../whirled/spot/data/SpotMarshaller.as | 10 ++-- .../whirled/zone/data/ZoneMarshaller.as | 4 +- .../data/ZoneMarshaller_ZoneMoveMarshaller.as | 6 +-- .../micasa/lobby/LobbyDispatcher.java | 8 +++- .../micasa/lobby/LobbyMarshaller.java | 10 ++-- .../micasa/lobby/LobbyProvider.java | 4 +- .../simulator/data/SimulatorMarshaller.java | 1 + .../simulator/server/SimulatorDispatcher.java | 5 +- .../trick/data/TrickCardGameMarshaller.java | 5 +- .../trick/server/TrickCardGameDispatcher.java | 10 ++-- .../trick/server/TrickCardGameProvider.java | 7 ++- .../parlor/client/TableService.java | 5 ++ .../parlor/data/ParlorMarshaller.java | 3 +- .../parlor/data/TableMarshaller.java | 22 +++++++-- .../parlor/server/ParlorDispatcher.java | 14 ++++-- .../parlor/server/ParlorProvider.java | 8 ++-- .../parlor/server/TableDispatcher.java | 21 +++++++-- .../parlor/server/TableManager.java | 47 +++++++++++++++++-- .../parlor/server/TableProvider.java | 15 ++++-- .../tourney/data/TourneyMarshaller.java | 1 + .../tourney/data/TourniesMarshaller.java | 1 + .../tourney/server/TourneyDispatcher.java | 11 +++-- .../tourney/server/TourneyProvider.java | 7 ++- .../tourney/server/TourniesDispatcher.java | 5 +- .../tourney/server/TourniesProvider.java | 3 +- .../puzzle/data/PuzzleGameMarshaller.java | 1 + .../puzzle/server/PuzzleGameDispatcher.java | 8 +++- .../puzzle/server/PuzzleGameProvider.java | 5 +- .../stage/data/StageSceneMarshaller.java | 1 + .../stage/server/StageSceneDispatcher.java | 8 +++- .../stage/server/StageSceneProvider.java | 5 +- .../whirled/data/SceneMarshaller.java | 3 +- .../whirled/server/SceneDispatcher.java | 5 +- .../whirled/server/SceneProvider.java | 2 +- .../whirled/spot/data/SpotMarshaller.java | 1 + .../whirled/spot/server/SpotDispatcher.java | 14 ++++-- .../whirled/spot/server/SpotProvider.java | 9 ++-- .../whirled/zone/data/ZoneMarshaller.java | 3 +- .../whirled/zone/server/ZoneDispatcher.java | 5 +- .../whirled/zone/server/ZoneProvider.java | 2 +- 47 files changed, 256 insertions(+), 115 deletions(-) diff --git a/src/as/com/threerings/parlor/card/trick/data/TrickCardGameMarshaller.as b/src/as/com/threerings/parlor/card/trick/data/TrickCardGameMarshaller.as index 27f9c373..a4bcecc9 100644 --- a/src/as/com/threerings/parlor/card/trick/data/TrickCardGameMarshaller.as +++ b/src/as/com/threerings/parlor/card/trick/data/TrickCardGameMarshaller.as @@ -29,7 +29,7 @@ import com.threerings.presents.data.InvocationMarshaller; import com.threerings.util.Integer; /** - * Provides the implementation of the TrickCardGameService interface + * 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 @@ -38,7 +38,7 @@ import com.threerings.util.Integer; public class TrickCardGameMarshaller extends InvocationMarshaller implements TrickCardGameService { - /** The method id used to dispatch playCard requests. */ + /** The method id used to dispatch {@link #playCard} requests. */ public static const PLAY_CARD :int = 1; // from interface TrickCardGameService @@ -49,7 +49,7 @@ public class TrickCardGameMarshaller extends InvocationMarshaller ]); } - /** The method id used to dispatch requestRematch requests. */ + /** The method id used to dispatch {@link #requestRematch} requests. */ public static const REQUEST_REMATCH :int = 2; // from interface TrickCardGameService @@ -60,7 +60,7 @@ public class TrickCardGameMarshaller extends InvocationMarshaller ]); } - /** The method id used to dispatch sendCardsToPlayer requests. */ + /** The method id used to dispatch {@link #sendCardsToPlayer} requests. */ public static const SEND_CARDS_TO_PLAYER :int = 3; // from interface TrickCardGameService diff --git a/src/as/com/threerings/parlor/client/TableService.as b/src/as/com/threerings/parlor/client/TableService.as index 34eac82d..33726f8a 100644 --- a/src/as/com/threerings/parlor/client/TableService.as +++ b/src/as/com/threerings/parlor/client/TableService.as @@ -33,6 +33,9 @@ import com.threerings.presents.client.InvocationService_ResultListener; */ public interface TableService extends InvocationService { + // from Java interface TableService + function bootPlayer (arg1 :Client, arg2 :int, arg3 :int, arg4 :InvocationService_InvocationListener) :void; + // from Java interface TableService function createTable (arg1 :Client, arg2 :TableConfig, arg3 :GameConfig, arg4 :InvocationService_ResultListener) :void; diff --git a/src/as/com/threerings/parlor/data/ParlorMarshaller.as b/src/as/com/threerings/parlor/data/ParlorMarshaller.as index 56384ab1..a1b9e00b 100644 --- a/src/as/com/threerings/parlor/data/ParlorMarshaller.as +++ b/src/as/com/threerings/parlor/data/ParlorMarshaller.as @@ -34,7 +34,7 @@ import com.threerings.util.Integer; import com.threerings.util.Name; /** - * Provides the implementation of the ParlorService interface + * Provides the implementation of the {@link ParlorService} 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 @@ -43,7 +43,7 @@ import com.threerings.util.Name; public class ParlorMarshaller extends InvocationMarshaller implements ParlorService { - /** The method id used to dispatch cancel requests. */ + /** The method id used to dispatch {@link #cancel} requests. */ public static const CANCEL :int = 1; // from interface ParlorService @@ -56,7 +56,7 @@ public class ParlorMarshaller extends InvocationMarshaller ]); } - /** The method id used to dispatch invite requests. */ + /** The method id used to dispatch {@link #invite} requests. */ public static const INVITE :int = 2; // from interface ParlorService @@ -69,7 +69,7 @@ public class ParlorMarshaller extends InvocationMarshaller ]); } - /** The method id used to dispatch respond requests. */ + /** The method id used to dispatch {@link #respond} requests. */ public static const RESPOND :int = 3; // from interface ParlorService @@ -82,7 +82,7 @@ public class ParlorMarshaller extends InvocationMarshaller ]); } - /** The method id used to dispatch startSolitaire requests. */ + /** The method id used to dispatch {@link #startSolitaire} requests. */ public static const START_SOLITAIRE :int = 4; // from interface ParlorService diff --git a/src/as/com/threerings/parlor/data/ParlorMarshaller_InviteMarshaller.as b/src/as/com/threerings/parlor/data/ParlorMarshaller_InviteMarshaller.as index b69f5053..35a135cf 100644 --- a/src/as/com/threerings/parlor/data/ParlorMarshaller_InviteMarshaller.as +++ b/src/as/com/threerings/parlor/data/ParlorMarshaller_InviteMarshaller.as @@ -30,7 +30,7 @@ import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller; public class ParlorMarshaller_InviteMarshaller extends InvocationMarshaller_ListenerMarshaller { - /** The method id used to dispatch inviteReceived responses. */ + /** The method id used to dispatch {@link #inviteReceived} responses. */ public static const INVITE_RECEIVED :int = 1; // from InvocationMarshaller_ListenerMarshaller diff --git a/src/as/com/threerings/parlor/data/TableMarshaller.as b/src/as/com/threerings/parlor/data/TableMarshaller.as index dea743b1..997d1220 100644 --- a/src/as/com/threerings/parlor/data/TableMarshaller.as +++ b/src/as/com/threerings/parlor/data/TableMarshaller.as @@ -32,7 +32,7 @@ import com.threerings.presents.data.InvocationMarshaller_ResultMarshaller; import com.threerings.util.Integer; /** - * Provides the implementation of the TableService interface + * Provides the implementation of the {@link TableService} 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 @@ -41,8 +41,21 @@ import com.threerings.util.Integer; public class TableMarshaller extends InvocationMarshaller implements TableService { - /** The method id used to dispatch createTable requests. */ - public static const CREATE_TABLE :int = 1; + /** The method id used to dispatch {@link #bootPlayer} requests. */ + public static const BOOT_PLAYER :int = 1; + + // from interface TableService + public function bootPlayer (arg1 :Client, arg2 :int, arg3 :int, arg4 :InvocationService_InvocationListener) :void + { + var listener4 :InvocationMarshaller_ListenerMarshaller = new InvocationMarshaller_ListenerMarshaller(); + listener4.listener = arg4; + sendRequest(arg1, BOOT_PLAYER, [ + Integer.valueOf(arg2), Integer.valueOf(arg3), listener4 + ]); + } + + /** The method id used to dispatch {@link #createTable} requests. */ + public static const CREATE_TABLE :int = 2; // from interface TableService public function createTable (arg1 :Client, arg2 :TableConfig, arg3 :GameConfig, arg4 :InvocationService_ResultListener) :void @@ -54,8 +67,8 @@ public class TableMarshaller extends InvocationMarshaller ]); } - /** The method id used to dispatch joinTable requests. */ - public static const JOIN_TABLE :int = 2; + /** The method id used to dispatch {@link #joinTable} requests. */ + public static const JOIN_TABLE :int = 3; // from interface TableService public function joinTable (arg1 :Client, arg2 :int, arg3 :int, arg4 :InvocationService_InvocationListener) :void @@ -67,8 +80,8 @@ public class TableMarshaller extends InvocationMarshaller ]); } - /** The method id used to dispatch leaveTable requests. */ - public static const LEAVE_TABLE :int = 3; + /** The method id used to dispatch {@link #leaveTable} requests. */ + public static const LEAVE_TABLE :int = 4; // from interface TableService public function leaveTable (arg1 :Client, arg2 :int, arg3 :InvocationService_InvocationListener) :void @@ -80,8 +93,8 @@ public class TableMarshaller extends InvocationMarshaller ]); } - /** The method id used to dispatch startTableNow requests. */ - public static const START_TABLE_NOW :int = 4; + /** The method id used to dispatch {@link #startTableNow} requests. */ + public static const START_TABLE_NOW :int = 5; // from interface TableService public function startTableNow (arg1 :Client, arg2 :int, arg3 :InvocationService_InvocationListener) :void diff --git a/src/as/com/threerings/whirled/data/SceneMarshaller.as b/src/as/com/threerings/whirled/data/SceneMarshaller.as index 9ce3a8d6..1bab7169 100644 --- a/src/as/com/threerings/whirled/data/SceneMarshaller.as +++ b/src/as/com/threerings/whirled/data/SceneMarshaller.as @@ -28,7 +28,7 @@ import com.threerings.whirled.client.SceneService; import com.threerings.whirled.client.SceneService_SceneMoveListener; /** - * Provides the implementation of the SceneService interface + * Provides the implementation of the {@link SceneService} 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 @@ -37,7 +37,7 @@ import com.threerings.whirled.client.SceneService_SceneMoveListener; public class SceneMarshaller extends InvocationMarshaller implements SceneService { - /** The method id used to dispatch moveTo requests. */ + /** The method id used to dispatch {@link #moveTo} requests. */ public static const MOVE_TO :int = 1; // from interface SceneService diff --git a/src/as/com/threerings/whirled/data/SceneMarshaller_SceneMoveMarshaller.as b/src/as/com/threerings/whirled/data/SceneMarshaller_SceneMoveMarshaller.as index 3f3d88cd..6e20cd42 100644 --- a/src/as/com/threerings/whirled/data/SceneMarshaller_SceneMoveMarshaller.as +++ b/src/as/com/threerings/whirled/data/SceneMarshaller_SceneMoveMarshaller.as @@ -32,16 +32,16 @@ import com.threerings.whirled.client.SceneService_SceneMoveListener; public class SceneMarshaller_SceneMoveMarshaller extends InvocationMarshaller_ListenerMarshaller { - /** The method id used to dispatch moveRequiresServerSwitch responses. */ + /** The method id used to dispatch {@link #moveRequiresServerSwitch} responses. */ public static const MOVE_REQUIRES_SERVER_SWITCH :int = 1; - /** The method id used to dispatch moveSucceeded responses. */ + /** The method id used to dispatch {@link #moveSucceeded} responses. */ public static const MOVE_SUCCEEDED :int = 2; - /** The method id used to dispatch moveSucceededWithScene responses. */ + /** The method id used to dispatch {@link #moveSucceededWithScene} responses. */ public static const MOVE_SUCCEEDED_WITH_SCENE :int = 3; - /** The method id used to dispatch moveSucceededWithUpdates responses. */ + /** The method id used to dispatch {@link #moveSucceededWithUpdates} responses. */ public static const MOVE_SUCCEEDED_WITH_UPDATES :int = 4; // from InvocationMarshaller_ListenerMarshaller diff --git a/src/as/com/threerings/whirled/spot/data/SpotMarshaller.as b/src/as/com/threerings/whirled/spot/data/SpotMarshaller.as index 6e95ef7a..5e668af7 100644 --- a/src/as/com/threerings/whirled/spot/data/SpotMarshaller.as +++ b/src/as/com/threerings/whirled/spot/data/SpotMarshaller.as @@ -32,7 +32,7 @@ import com.threerings.whirled.data.SceneMarshaller_SceneMoveMarshaller; import com.threerings.whirled.spot.client.SpotService; /** - * Provides the implementation of the SpotService interface + * Provides the implementation of the {@link SpotService} 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 @@ -41,7 +41,7 @@ import com.threerings.whirled.spot.client.SpotService; public class SpotMarshaller extends InvocationMarshaller implements SpotService { - /** The method id used to dispatch changeLocation requests. */ + /** The method id used to dispatch {@link #changeLocation} requests. */ public static const CHANGE_LOCATION :int = 1; // from interface SpotService @@ -54,7 +54,7 @@ public class SpotMarshaller extends InvocationMarshaller ]); } - /** The method id used to dispatch clusterSpeak requests. */ + /** The method id used to dispatch {@link #clusterSpeak} requests. */ public static const CLUSTER_SPEAK :int = 2; // from interface SpotService @@ -65,7 +65,7 @@ public class SpotMarshaller extends InvocationMarshaller ]); } - /** The method id used to dispatch joinCluster requests. */ + /** The method id used to dispatch {@link #joinCluster} requests. */ public static const JOIN_CLUSTER :int = 3; // from interface SpotService @@ -78,7 +78,7 @@ public class SpotMarshaller extends InvocationMarshaller ]); } - /** The method id used to dispatch traversePortal requests. */ + /** The method id used to dispatch {@link #traversePortal} requests. */ public static const TRAVERSE_PORTAL :int = 4; // from interface SpotService diff --git a/src/as/com/threerings/whirled/zone/data/ZoneMarshaller.as b/src/as/com/threerings/whirled/zone/data/ZoneMarshaller.as index 3fb18b13..8cd85cd0 100644 --- a/src/as/com/threerings/whirled/zone/data/ZoneMarshaller.as +++ b/src/as/com/threerings/whirled/zone/data/ZoneMarshaller.as @@ -28,7 +28,7 @@ import com.threerings.whirled.zone.client.ZoneService; import com.threerings.whirled.zone.client.ZoneService_ZoneMoveListener; /** - * Provides the implementation of the ZoneService interface + * 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 @@ -37,7 +37,7 @@ import com.threerings.whirled.zone.client.ZoneService_ZoneMoveListener; public class ZoneMarshaller extends InvocationMarshaller implements ZoneService { - /** The method id used to dispatch moveTo requests. */ + /** The method id used to dispatch {@link #moveTo} requests. */ public static const MOVE_TO :int = 1; // from interface ZoneService diff --git a/src/as/com/threerings/whirled/zone/data/ZoneMarshaller_ZoneMoveMarshaller.as b/src/as/com/threerings/whirled/zone/data/ZoneMarshaller_ZoneMoveMarshaller.as index f21a6b28..8678d6d0 100644 --- a/src/as/com/threerings/whirled/zone/data/ZoneMarshaller_ZoneMoveMarshaller.as +++ b/src/as/com/threerings/whirled/zone/data/ZoneMarshaller_ZoneMoveMarshaller.as @@ -33,13 +33,13 @@ import com.threerings.whirled.zone.client.ZoneService_ZoneMoveListener; public class ZoneMarshaller_ZoneMoveMarshaller extends InvocationMarshaller_ListenerMarshaller { - /** The method id used to dispatch moveSucceeded responses. */ + /** The method id used to dispatch {@link #moveSucceeded} responses. */ public static const MOVE_SUCCEEDED :int = 1; - /** The method id used to dispatch moveSucceededWithScene responses. */ + /** The method id used to dispatch {@link #moveSucceededWithScene} responses. */ public static const MOVE_SUCCEEDED_WITH_SCENE :int = 2; - /** The method id used to dispatch moveSucceededWithUpdates responses. */ + /** The method id used to dispatch {@link #moveSucceededWithUpdates} responses. */ public static const MOVE_SUCCEEDED_WITH_UPDATES :int = 3; // from InvocationMarshaller_ListenerMarshaller diff --git a/src/java/com/threerings/micasa/lobby/LobbyDispatcher.java b/src/java/com/threerings/micasa/lobby/LobbyDispatcher.java index 2a1148c2..bde19330 100644 --- a/src/java/com/threerings/micasa/lobby/LobbyDispatcher.java +++ b/src/java/com/threerings/micasa/lobby/LobbyDispatcher.java @@ -22,6 +22,7 @@ package com.threerings.micasa.lobby; import com.threerings.presents.data.ClientObject; +import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; @@ -45,6 +46,7 @@ public class LobbyDispatcher extends InvocationDispatcher return new LobbyMarshaller(); } + @SuppressWarnings("unchecked") @Override // documentation inherited public void dispatchRequest ( ClientObject source, int methodId, Object[] args) @@ -53,13 +55,15 @@ public class LobbyDispatcher extends InvocationDispatcher switch (methodId) { case LobbyMarshaller.GET_CATEGORIES: ((LobbyProvider)provider).getCategories( - source, (LobbyService.CategoriesListener)args[0] + source, + (LobbyService.CategoriesListener)args[0] ); return; case LobbyMarshaller.GET_LOBBIES: ((LobbyProvider)provider).getLobbies( - source, (String)args[0], (LobbyService.LobbiesListener)args[1] + source, + (String)args[0], (LobbyService.LobbiesListener)args[1] ); return; diff --git a/src/java/com/threerings/micasa/lobby/LobbyMarshaller.java b/src/java/com/threerings/micasa/lobby/LobbyMarshaller.java index 49e8be0c..81c2555e 100644 --- a/src/java/com/threerings/micasa/lobby/LobbyMarshaller.java +++ b/src/java/com/threerings/micasa/lobby/LobbyMarshaller.java @@ -24,6 +24,7 @@ package com.threerings.micasa.lobby; import com.threerings.presents.client.Client; import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.dobj.InvocationResponseEvent; +import com.threerings.presents.net.Transport; import java.util.List; /** @@ -37,7 +38,7 @@ public class LobbyMarshaller extends InvocationMarshaller implements LobbyService { /** - * Marshalls results to implementations of {@link LobbyService.CategoriesListener}. + * Marshalls results to implementations of {@link CategoriesListener}. */ public static class CategoriesMarshaller extends ListenerMarshaller implements CategoriesListener @@ -72,7 +73,7 @@ public class LobbyMarshaller extends InvocationMarshaller } /** - * Marshalls results to implementations of {@link LobbyService.LobbiesListener}. + * Marshalls results to implementations of {@link LobbiesListener}. */ public static class LobbiesMarshaller extends ListenerMarshaller implements LobbiesListener @@ -82,7 +83,7 @@ public class LobbyMarshaller extends InvocationMarshaller public static final int GOT_LOBBIES = 1; // from interface LobbiesMarshaller - public void gotLobbies (List arg1) + public void gotLobbies (List arg1) { _invId = null; omgr.postEvent(new InvocationResponseEvent( @@ -91,13 +92,12 @@ public class LobbyMarshaller extends InvocationMarshaller } @Override // from InvocationMarshaller - @SuppressWarnings("unchecked") public void dispatchResponse (int methodId, Object[] args) { switch (methodId) { case GOT_LOBBIES: ((LobbiesListener)listener).gotLobbies( - (List)args[0]); + (List)args[0]); return; default: diff --git a/src/java/com/threerings/micasa/lobby/LobbyProvider.java b/src/java/com/threerings/micasa/lobby/LobbyProvider.java index 32c5da25..25cef2cb 100644 --- a/src/java/com/threerings/micasa/lobby/LobbyProvider.java +++ b/src/java/com/threerings/micasa/lobby/LobbyProvider.java @@ -33,12 +33,12 @@ public interface LobbyProvider extends InvocationProvider /** * Handles a {@link LobbyService#getCategories} request. */ - void getCategories (ClientObject caller, LobbyService.CategoriesListener arg1) + public void getCategories (ClientObject caller, LobbyService.CategoriesListener arg1) throws InvocationException; /** * Handles a {@link LobbyService#getLobbies} request. */ - void getLobbies (ClientObject caller, String arg1, LobbyService.LobbiesListener arg2) + public void getLobbies (ClientObject caller, String arg1, LobbyService.LobbiesListener arg2) throws InvocationException; } diff --git a/src/java/com/threerings/micasa/simulator/data/SimulatorMarshaller.java b/src/java/com/threerings/micasa/simulator/data/SimulatorMarshaller.java index b9a7e715..b829a43f 100644 --- a/src/java/com/threerings/micasa/simulator/data/SimulatorMarshaller.java +++ b/src/java/com/threerings/micasa/simulator/data/SimulatorMarshaller.java @@ -25,6 +25,7 @@ import com.threerings.micasa.simulator.client.SimulatorService; import com.threerings.parlor.game.data.GameConfig; import com.threerings.presents.client.Client; import com.threerings.presents.data.InvocationMarshaller; +import com.threerings.presents.net.Transport; /** * Provides the implementation of the {@link SimulatorService} interface diff --git a/src/java/com/threerings/micasa/simulator/server/SimulatorDispatcher.java b/src/java/com/threerings/micasa/simulator/server/SimulatorDispatcher.java index b67c3c25..2efd2931 100644 --- a/src/java/com/threerings/micasa/simulator/server/SimulatorDispatcher.java +++ b/src/java/com/threerings/micasa/simulator/server/SimulatorDispatcher.java @@ -24,6 +24,7 @@ package com.threerings.micasa.simulator.server; import com.threerings.micasa.simulator.data.SimulatorMarshaller; import com.threerings.parlor.game.data.GameConfig; import com.threerings.presents.data.ClientObject; +import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; @@ -47,6 +48,7 @@ public class SimulatorDispatcher extends InvocationDispatcher return new ParlorMarshaller(); } + @SuppressWarnings("unchecked") @Override // documentation inherited public void dispatchRequest ( ClientObject source, int methodId, Object[] args) @@ -58,25 +60,29 @@ public class ParlorDispatcher extends InvocationDispatcher switch (methodId) { case ParlorMarshaller.CANCEL: ((ParlorProvider)provider).cancel( - source, ((Integer)args[0]).intValue(), (InvocationService.InvocationListener)args[1] + source, + ((Integer)args[0]).intValue(), (InvocationService.InvocationListener)args[1] ); return; case ParlorMarshaller.INVITE: ((ParlorProvider)provider).invite( - source, (Name)args[0], (GameConfig)args[1], (ParlorService.InviteListener)args[2] + source, + (Name)args[0], (GameConfig)args[1], (ParlorService.InviteListener)args[2] ); return; case ParlorMarshaller.RESPOND: ((ParlorProvider)provider).respond( - source, ((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), args[2], (InvocationService.InvocationListener)args[3] + source, + ((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), args[2], (InvocationService.InvocationListener)args[3] ); return; case ParlorMarshaller.START_SOLITAIRE: ((ParlorProvider)provider).startSolitaire( - source, (GameConfig)args[0], (InvocationService.ConfirmListener)args[1] + source, + (GameConfig)args[0], (InvocationService.ConfirmListener)args[1] ); return; diff --git a/src/java/com/threerings/parlor/server/ParlorProvider.java b/src/java/com/threerings/parlor/server/ParlorProvider.java index 972a27dd..a03e46e1 100644 --- a/src/java/com/threerings/parlor/server/ParlorProvider.java +++ b/src/java/com/threerings/parlor/server/ParlorProvider.java @@ -37,24 +37,24 @@ public interface ParlorProvider extends InvocationProvider /** * Handles a {@link ParlorService#cancel} request. */ - void cancel (ClientObject caller, int arg1, InvocationService.InvocationListener arg2) + public void cancel (ClientObject caller, int arg1, InvocationService.InvocationListener arg2) throws InvocationException; /** * Handles a {@link ParlorService#invite} request. */ - void invite (ClientObject caller, Name arg1, GameConfig arg2, ParlorService.InviteListener arg3) + public void invite (ClientObject caller, Name arg1, GameConfig arg2, ParlorService.InviteListener arg3) throws InvocationException; /** * Handles a {@link ParlorService#respond} request. */ - void respond (ClientObject caller, int arg1, int arg2, Object arg3, InvocationService.InvocationListener arg4) + public void respond (ClientObject caller, int arg1, int arg2, Object arg3, InvocationService.InvocationListener arg4) throws InvocationException; /** * Handles a {@link ParlorService#startSolitaire} request. */ - void startSolitaire (ClientObject caller, GameConfig arg1, InvocationService.ConfirmListener arg2) + public void startSolitaire (ClientObject caller, GameConfig arg1, InvocationService.ConfirmListener arg2) throws InvocationException; } diff --git a/src/java/com/threerings/parlor/server/TableDispatcher.java b/src/java/com/threerings/parlor/server/TableDispatcher.java index 1448adc6..e799d2ad 100644 --- a/src/java/com/threerings/parlor/server/TableDispatcher.java +++ b/src/java/com/threerings/parlor/server/TableDispatcher.java @@ -26,6 +26,7 @@ import com.threerings.parlor.data.TableMarshaller; import com.threerings.parlor.game.data.GameConfig; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.ClientObject; +import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; @@ -49,33 +50,45 @@ public class TableDispatcher extends InvocationDispatcher return new TableMarshaller(); } + @SuppressWarnings("unchecked") @Override // documentation inherited public void dispatchRequest ( ClientObject source, int methodId, Object[] args) throws InvocationException { switch (methodId) { + case TableMarshaller.BOOT_PLAYER: + ((TableProvider)provider).bootPlayer( + source, + ((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), (InvocationService.InvocationListener)args[2] + ); + return; + case TableMarshaller.CREATE_TABLE: ((TableProvider)provider).createTable( - source, (TableConfig)args[0], (GameConfig)args[1], (InvocationService.ResultListener)args[2] + source, + (TableConfig)args[0], (GameConfig)args[1], (InvocationService.ResultListener)args[2] ); return; case TableMarshaller.JOIN_TABLE: ((TableProvider)provider).joinTable( - source, ((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), (InvocationService.InvocationListener)args[2] + source, + ((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), (InvocationService.InvocationListener)args[2] ); return; case TableMarshaller.LEAVE_TABLE: ((TableProvider)provider).leaveTable( - source, ((Integer)args[0]).intValue(), (InvocationService.InvocationListener)args[1] + source, + ((Integer)args[0]).intValue(), (InvocationService.InvocationListener)args[1] ); return; case TableMarshaller.START_TABLE_NOW: ((TableProvider)provider).startTableNow( - source, ((Integer)args[0]).intValue(), (InvocationService.InvocationListener)args[1] + source, + ((Integer)args[0]).intValue(), (InvocationService.InvocationListener)args[1] ); return; diff --git a/src/java/com/threerings/parlor/server/TableManager.java b/src/java/com/threerings/parlor/server/TableManager.java index f131b829..22672a65 100644 --- a/src/java/com/threerings/parlor/server/TableManager.java +++ b/src/java/com/threerings/parlor/server/TableManager.java @@ -108,6 +108,14 @@ public class TableManager _tableClass = tableClass; } + /** + * Allow a player in the first position of a table to boot others. + */ + public void setAllowBooting (boolean allowBooting) + { + _allowBooting = allowBooting; + } + /** * Creates a table for the specified creator and returns said table. * @@ -126,7 +134,7 @@ public class TableManager try { table = _tableClass.newInstance(); } catch (Exception e) { - log.warning("Table.newInstance() failde [class=" + _tableClass + ", e=" + e + "]."); + log.warning("Table.newInstance() failed [class=" + _tableClass + ", e=" + e + "]."); throw new InvocationException(INTERNAL_ERROR); } table.init(_dobj.getOid(), tableConfig, config); @@ -160,7 +168,7 @@ public class TableManager return table; } - // from interface ParlorProvider + // from interface TableProvider public void createTable (ClientObject caller, TableConfig tableConfig, GameConfig config, TableService.ResultListener listener) throws InvocationException @@ -180,7 +188,7 @@ public class TableManager listener.requestProcessed(createTable(creator, tableConfig, config).tableId); } - // from interface ParlorProvider + // from interface TableProvider public void joinTable (ClientObject caller, int tableId, int position, TableService.InvocationListener listener) throws InvocationException @@ -220,7 +228,7 @@ public class TableManager // themselves show up in the table that they joined } - // from interface ParlorProvider + // from interface TableProvider public void leaveTable (ClientObject caller, int tableId, TableService.InvocationListener listener) throws InvocationException @@ -256,7 +264,7 @@ public class TableManager // themselves removed from the table they just left } - // from interface ParlorProvider + // from interface TableProvider public void startTableNow (ClientObject caller, int tableId, TableService.InvocationListener listener) throws InvocationException @@ -273,6 +281,32 @@ public class TableManager createGame(table); } + // from interface TableProvider + public void bootPlayer (ClientObject caller, int tableId, int bodyId, + TableService.InvocationListener listener) + throws InvocationException + { + BodyObject booter = (BodyObject) caller; + Table table = _tables.get(tableId); + + if (table == null) { + throw new InvocationException(NO_SUCH_TABLE); + } else if (booter.getOid() != table.bodyOids[0]) { + throw new InvocationException(INVALID_TABLE_POSITION); + } else if ( ! _allowBooting) { + throw new InvocationException(INTERNAL_ERROR); + } + + // Remove the player from the table + if ( ! table.clearPlayerByOid(bodyId)) { + throw new InvocationException(NOT_AT_TABLE); + } + if (notePlayerRemoved(bodyId) == null) { + log.warning("No body to table mapping to clear? [bodyId=" + bodyId + + ", table=" + table + "]."); + } + } + /** * Removes the table from all of our internal tables and from its lobby's distributed object. */ @@ -556,6 +590,9 @@ public class TableManager /** A listener that removes users from tables when they're no longer able to play. */ protected ChangeListener _userListener = new UserListener(); + /** Whether or not tables should support booting. */ + protected boolean _allowBooting = false; + protected RootDObjectManager _omgr; protected InvocationManager _invmgr; protected PlaceRegistry _plreg; diff --git a/src/java/com/threerings/parlor/server/TableProvider.java b/src/java/com/threerings/parlor/server/TableProvider.java index ccc88f0a..df08575b 100644 --- a/src/java/com/threerings/parlor/server/TableProvider.java +++ b/src/java/com/threerings/parlor/server/TableProvider.java @@ -21,7 +21,6 @@ package com.threerings.parlor.server; -import com.threerings.parlor.client.TableService; import com.threerings.parlor.data.TableConfig; import com.threerings.parlor.game.data.GameConfig; import com.threerings.presents.client.InvocationService; @@ -34,27 +33,33 @@ import com.threerings.presents.server.InvocationProvider; */ public interface TableProvider extends InvocationProvider { + /** + * Handles a {@link TableService#bootPlayer} request. + */ + public void bootPlayer (ClientObject caller, int arg1, int arg2, InvocationService.InvocationListener arg3) + throws InvocationException; + /** * Handles a {@link TableService#createTable} request. */ - void createTable (ClientObject caller, TableConfig arg1, GameConfig arg2, InvocationService.ResultListener arg3) + public void createTable (ClientObject caller, TableConfig arg1, GameConfig arg2, InvocationService.ResultListener arg3) throws InvocationException; /** * Handles a {@link TableService#joinTable} request. */ - void joinTable (ClientObject caller, int arg1, int arg2, InvocationService.InvocationListener arg3) + public void joinTable (ClientObject caller, int arg1, int arg2, InvocationService.InvocationListener arg3) throws InvocationException; /** * Handles a {@link TableService#leaveTable} request. */ - void leaveTable (ClientObject caller, int arg1, InvocationService.InvocationListener arg2) + public void leaveTable (ClientObject caller, int arg1, InvocationService.InvocationListener arg2) throws InvocationException; /** * Handles a {@link TableService#startTableNow} request. */ - void startTableNow (ClientObject caller, int arg1, InvocationService.InvocationListener arg2) + public void startTableNow (ClientObject caller, int arg1, InvocationService.InvocationListener arg2) throws InvocationException; } diff --git a/src/java/com/threerings/parlor/tourney/data/TourneyMarshaller.java b/src/java/com/threerings/parlor/tourney/data/TourneyMarshaller.java index b4148272..5fd8cfb8 100644 --- a/src/java/com/threerings/parlor/tourney/data/TourneyMarshaller.java +++ b/src/java/com/threerings/parlor/tourney/data/TourneyMarshaller.java @@ -25,6 +25,7 @@ import com.threerings.parlor.tourney.client.TourneyService; import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.InvocationMarshaller; +import com.threerings.presents.net.Transport; /** * Provides the implementation of the {@link TourneyService} interface diff --git a/src/java/com/threerings/parlor/tourney/data/TourniesMarshaller.java b/src/java/com/threerings/parlor/tourney/data/TourniesMarshaller.java index d5f7a942..1ca15cde 100644 --- a/src/java/com/threerings/parlor/tourney/data/TourniesMarshaller.java +++ b/src/java/com/threerings/parlor/tourney/data/TourniesMarshaller.java @@ -25,6 +25,7 @@ import com.threerings.parlor.tourney.client.TourniesService; import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.InvocationMarshaller; +import com.threerings.presents.net.Transport; /** * Provides the implementation of the {@link TourniesService} interface diff --git a/src/java/com/threerings/parlor/tourney/server/TourneyDispatcher.java b/src/java/com/threerings/parlor/tourney/server/TourneyDispatcher.java index 67d8a9de..7c304467 100644 --- a/src/java/com/threerings/parlor/tourney/server/TourneyDispatcher.java +++ b/src/java/com/threerings/parlor/tourney/server/TourneyDispatcher.java @@ -24,6 +24,7 @@ package com.threerings.parlor.tourney.server; import com.threerings.parlor.tourney.data.TourneyMarshaller; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.ClientObject; +import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; @@ -47,6 +48,7 @@ public class TourneyDispatcher extends InvocationDispatcher return new TourneyMarshaller(); } + @SuppressWarnings("unchecked") @Override // documentation inherited public void dispatchRequest ( ClientObject source, int methodId, Object[] args) @@ -55,19 +57,22 @@ public class TourneyDispatcher extends InvocationDispatcher switch (methodId) { case TourneyMarshaller.CANCEL: ((TourneyProvider)provider).cancel( - source, (InvocationService.ConfirmListener)args[0] + source, + (InvocationService.ConfirmListener)args[0] ); return; case TourneyMarshaller.JOIN: ((TourneyProvider)provider).join( - source, (InvocationService.ConfirmListener)args[0] + source, + (InvocationService.ConfirmListener)args[0] ); return; case TourneyMarshaller.LEAVE: ((TourneyProvider)provider).leave( - source, (InvocationService.ConfirmListener)args[0] + source, + (InvocationService.ConfirmListener)args[0] ); return; diff --git a/src/java/com/threerings/parlor/tourney/server/TourneyProvider.java b/src/java/com/threerings/parlor/tourney/server/TourneyProvider.java index cfbb2cb8..485d4632 100644 --- a/src/java/com/threerings/parlor/tourney/server/TourneyProvider.java +++ b/src/java/com/threerings/parlor/tourney/server/TourneyProvider.java @@ -21,7 +21,6 @@ package com.threerings.parlor.tourney.server; -import com.threerings.parlor.tourney.client.TourneyService; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.ClientObject; import com.threerings.presents.server.InvocationException; @@ -35,18 +34,18 @@ public interface TourneyProvider extends InvocationProvider /** * Handles a {@link TourneyService#cancel} request. */ - void cancel (ClientObject caller, InvocationService.ConfirmListener arg1) + public void cancel (ClientObject caller, InvocationService.ConfirmListener arg1) throws InvocationException; /** * Handles a {@link TourneyService#join} request. */ - void join (ClientObject caller, InvocationService.ConfirmListener arg1) + public void join (ClientObject caller, InvocationService.ConfirmListener arg1) throws InvocationException; /** * Handles a {@link TourneyService#leave} request. */ - void leave (ClientObject caller, InvocationService.ConfirmListener arg1) + public void leave (ClientObject caller, InvocationService.ConfirmListener arg1) throws InvocationException; } diff --git a/src/java/com/threerings/parlor/tourney/server/TourniesDispatcher.java b/src/java/com/threerings/parlor/tourney/server/TourniesDispatcher.java index 62812f32..a716aa14 100644 --- a/src/java/com/threerings/parlor/tourney/server/TourniesDispatcher.java +++ b/src/java/com/threerings/parlor/tourney/server/TourniesDispatcher.java @@ -25,6 +25,7 @@ import com.threerings.parlor.tourney.data.TourneyConfig; import com.threerings.parlor.tourney.data.TourniesMarshaller; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.ClientObject; +import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; @@ -48,6 +49,7 @@ public class TourniesDispatcher extends InvocationDispatcher return new TourniesMarshaller(); } + @SuppressWarnings("unchecked") @Override // documentation inherited public void dispatchRequest ( ClientObject source, int methodId, Object[] args) @@ -56,7 +58,8 @@ public class TourniesDispatcher extends InvocationDispatcher switch (methodId) { case TourniesMarshaller.CREATE_TOURNEY: ((TourniesProvider)provider).createTourney( - source, (TourneyConfig)args[0], (InvocationService.ResultListener)args[1] + source, + (TourneyConfig)args[0], (InvocationService.ResultListener)args[1] ); return; diff --git a/src/java/com/threerings/parlor/tourney/server/TourniesProvider.java b/src/java/com/threerings/parlor/tourney/server/TourniesProvider.java index e6f9e006..7414913a 100644 --- a/src/java/com/threerings/parlor/tourney/server/TourniesProvider.java +++ b/src/java/com/threerings/parlor/tourney/server/TourniesProvider.java @@ -21,7 +21,6 @@ package com.threerings.parlor.tourney.server; -import com.threerings.parlor.tourney.client.TourniesService; import com.threerings.parlor.tourney.data.TourneyConfig; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.ClientObject; @@ -36,6 +35,6 @@ public interface TourniesProvider extends InvocationProvider /** * Handles a {@link TourniesService#createTourney} request. */ - void createTourney (ClientObject caller, TourneyConfig arg1, InvocationService.ResultListener arg2) + public void createTourney (ClientObject caller, TourneyConfig arg1, InvocationService.ResultListener arg2) throws InvocationException; } diff --git a/src/java/com/threerings/puzzle/data/PuzzleGameMarshaller.java b/src/java/com/threerings/puzzle/data/PuzzleGameMarshaller.java index 5e6bb84f..0cb6dfed 100644 --- a/src/java/com/threerings/puzzle/data/PuzzleGameMarshaller.java +++ b/src/java/com/threerings/puzzle/data/PuzzleGameMarshaller.java @@ -23,6 +23,7 @@ package com.threerings.puzzle.data; import com.threerings.presents.client.Client; import com.threerings.presents.data.InvocationMarshaller; +import com.threerings.presents.net.Transport; import com.threerings.puzzle.client.PuzzleGameService; /** diff --git a/src/java/com/threerings/puzzle/server/PuzzleGameDispatcher.java b/src/java/com/threerings/puzzle/server/PuzzleGameDispatcher.java index 80428afe..5ad3d424 100644 --- a/src/java/com/threerings/puzzle/server/PuzzleGameDispatcher.java +++ b/src/java/com/threerings/puzzle/server/PuzzleGameDispatcher.java @@ -22,6 +22,7 @@ package com.threerings.puzzle.server; import com.threerings.presents.data.ClientObject; +import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; import com.threerings.puzzle.data.Board; @@ -47,6 +48,7 @@ public class PuzzleGameDispatcher extends InvocationDispatcher return new SceneMarshaller(); } + @SuppressWarnings("unchecked") @Override // documentation inherited public void dispatchRequest ( ClientObject source, int methodId, Object[] args) @@ -55,7 +57,8 @@ public class SceneDispatcher extends InvocationDispatcher switch (methodId) { case SceneMarshaller.MOVE_TO: ((SceneProvider)provider).moveTo( - source, ((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), (SceneService.SceneMoveListener)args[2] + source, + ((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), (SceneService.SceneMoveListener)args[2] ); return; diff --git a/src/java/com/threerings/whirled/server/SceneProvider.java b/src/java/com/threerings/whirled/server/SceneProvider.java index f6f7e556..d4b77f4c 100644 --- a/src/java/com/threerings/whirled/server/SceneProvider.java +++ b/src/java/com/threerings/whirled/server/SceneProvider.java @@ -34,6 +34,6 @@ public interface SceneProvider extends InvocationProvider /** * Handles a {@link SceneService#moveTo} request. */ - void moveTo (ClientObject caller, int arg1, int arg2, SceneService.SceneMoveListener arg3) + public void moveTo (ClientObject caller, int arg1, int arg2, SceneService.SceneMoveListener arg3) throws InvocationException; } diff --git a/src/java/com/threerings/whirled/spot/data/SpotMarshaller.java b/src/java/com/threerings/whirled/spot/data/SpotMarshaller.java index 9742bdaf..02942afc 100644 --- a/src/java/com/threerings/whirled/spot/data/SpotMarshaller.java +++ b/src/java/com/threerings/whirled/spot/data/SpotMarshaller.java @@ -24,6 +24,7 @@ package com.threerings.whirled.spot.data; import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.InvocationMarshaller; +import com.threerings.presents.net.Transport; import com.threerings.whirled.client.SceneService; import com.threerings.whirled.data.SceneMarshaller; import com.threerings.whirled.spot.client.SpotService; diff --git a/src/java/com/threerings/whirled/spot/server/SpotDispatcher.java b/src/java/com/threerings/whirled/spot/server/SpotDispatcher.java index d39ecde0..88115555 100644 --- a/src/java/com/threerings/whirled/spot/server/SpotDispatcher.java +++ b/src/java/com/threerings/whirled/spot/server/SpotDispatcher.java @@ -23,6 +23,7 @@ package com.threerings.whirled.spot.server; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.ClientObject; +import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; import com.threerings.whirled.client.SceneService; @@ -49,6 +50,7 @@ public class SpotDispatcher extends InvocationDispatcher return new SpotMarshaller(); } + @SuppressWarnings("unchecked") @Override // documentation inherited public void dispatchRequest ( ClientObject source, int methodId, Object[] args) @@ -57,25 +59,29 @@ public class SpotDispatcher extends InvocationDispatcher switch (methodId) { case SpotMarshaller.CHANGE_LOCATION: ((SpotProvider)provider).changeLocation( - source, ((Integer)args[0]).intValue(), (Location)args[1], (InvocationService.ConfirmListener)args[2] + source, + ((Integer)args[0]).intValue(), (Location)args[1], (InvocationService.ConfirmListener)args[2] ); return; case SpotMarshaller.CLUSTER_SPEAK: ((SpotProvider)provider).clusterSpeak( - source, (String)args[0], ((Byte)args[1]).byteValue() + source, + (String)args[0], ((Byte)args[1]).byteValue() ); return; case SpotMarshaller.JOIN_CLUSTER: ((SpotProvider)provider).joinCluster( - source, ((Integer)args[0]).intValue(), (InvocationService.ConfirmListener)args[1] + source, + ((Integer)args[0]).intValue(), (InvocationService.ConfirmListener)args[1] ); return; case SpotMarshaller.TRAVERSE_PORTAL: ((SpotProvider)provider).traversePortal( - source, ((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), ((Integer)args[2]).intValue(), (SceneService.SceneMoveListener)args[3] + source, + ((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), ((Integer)args[2]).intValue(), (SceneService.SceneMoveListener)args[3] ); return; diff --git a/src/java/com/threerings/whirled/spot/server/SpotProvider.java b/src/java/com/threerings/whirled/spot/server/SpotProvider.java index 09e68085..b077c929 100644 --- a/src/java/com/threerings/whirled/spot/server/SpotProvider.java +++ b/src/java/com/threerings/whirled/spot/server/SpotProvider.java @@ -26,7 +26,6 @@ import com.threerings.presents.data.ClientObject; import com.threerings.presents.server.InvocationException; import com.threerings.presents.server.InvocationProvider; import com.threerings.whirled.client.SceneService; -import com.threerings.whirled.spot.client.SpotService; import com.threerings.whirled.spot.data.Location; /** @@ -37,23 +36,23 @@ public interface SpotProvider extends InvocationProvider /** * Handles a {@link SpotService#changeLocation} request. */ - void changeLocation (ClientObject caller, int arg1, Location arg2, InvocationService.ConfirmListener arg3) + public void changeLocation (ClientObject caller, int arg1, Location arg2, InvocationService.ConfirmListener arg3) throws InvocationException; /** * Handles a {@link SpotService#clusterSpeak} request. */ - void clusterSpeak (ClientObject caller, String arg1, byte arg2); + public void clusterSpeak (ClientObject caller, String arg1, byte arg2); /** * Handles a {@link SpotService#joinCluster} request. */ - void joinCluster (ClientObject caller, int arg1, InvocationService.ConfirmListener arg2) + public void joinCluster (ClientObject caller, int arg1, InvocationService.ConfirmListener arg2) throws InvocationException; /** * Handles a {@link SpotService#traversePortal} request. */ - void traversePortal (ClientObject caller, int arg1, int arg2, int arg3, SceneService.SceneMoveListener arg4) + public void traversePortal (ClientObject caller, int arg1, int arg2, int arg3, SceneService.SceneMoveListener arg4) throws InvocationException; } diff --git a/src/java/com/threerings/whirled/zone/data/ZoneMarshaller.java b/src/java/com/threerings/whirled/zone/data/ZoneMarshaller.java index 2079494d..e3063670 100644 --- a/src/java/com/threerings/whirled/zone/data/ZoneMarshaller.java +++ b/src/java/com/threerings/whirled/zone/data/ZoneMarshaller.java @@ -25,6 +25,7 @@ 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.net.Transport; import com.threerings.whirled.data.SceneModel; import com.threerings.whirled.data.SceneUpdate; import com.threerings.whirled.zone.client.ZoneService; @@ -40,7 +41,7 @@ public class ZoneMarshaller extends InvocationMarshaller implements ZoneService { /** - * Marshalls results to implementations of {@link ZoneService.ZoneMoveListener}. + * Marshalls results to implementations of {@link ZoneMoveListener}. */ public static class ZoneMoveMarshaller extends ListenerMarshaller implements ZoneMoveListener diff --git a/src/java/com/threerings/whirled/zone/server/ZoneDispatcher.java b/src/java/com/threerings/whirled/zone/server/ZoneDispatcher.java index 8e11434d..4ed831eb 100644 --- a/src/java/com/threerings/whirled/zone/server/ZoneDispatcher.java +++ b/src/java/com/threerings/whirled/zone/server/ZoneDispatcher.java @@ -22,6 +22,7 @@ package com.threerings.whirled.zone.server; import com.threerings.presents.data.ClientObject; +import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; import com.threerings.whirled.zone.client.ZoneService; @@ -47,6 +48,7 @@ public class ZoneDispatcher extends InvocationDispatcher return new ZoneMarshaller(); } + @SuppressWarnings("unchecked") @Override // documentation inherited public void dispatchRequest ( ClientObject source, int methodId, Object[] args) @@ -55,7 +57,8 @@ public class ZoneDispatcher extends InvocationDispatcher switch (methodId) { case ZoneMarshaller.MOVE_TO: ((ZoneProvider)provider).moveTo( - source, ((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), ((Integer)args[2]).intValue(), (ZoneService.ZoneMoveListener)args[3] + source, + ((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), ((Integer)args[2]).intValue(), (ZoneService.ZoneMoveListener)args[3] ); return; diff --git a/src/java/com/threerings/whirled/zone/server/ZoneProvider.java b/src/java/com/threerings/whirled/zone/server/ZoneProvider.java index beabd15d..86f7b202 100644 --- a/src/java/com/threerings/whirled/zone/server/ZoneProvider.java +++ b/src/java/com/threerings/whirled/zone/server/ZoneProvider.java @@ -34,6 +34,6 @@ public interface ZoneProvider extends InvocationProvider /** * Handles a {@link ZoneService#moveTo} request. */ - void moveTo (ClientObject caller, int arg1, int arg2, int arg3, ZoneService.ZoneMoveListener arg4) + public void moveTo (ClientObject caller, int arg1, int arg2, int arg3, ZoneService.ZoneMoveListener arg4) throws InvocationException; }