Switched to dynamic dispatch.

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@1043 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2011-01-01 01:39:26 +00:00
parent c8a4fbfd8b
commit 24c3d4ef3e
23 changed files with 22 additions and 973 deletions
@@ -1,75 +0,0 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved
// http://code.google.com/p/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.micasa.lobby;
import javax.annotation.Generated;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException;
/**
* Dispatches requests to the {@link LobbyProvider}.
*/
@Generated(value={"com.threerings.presents.tools.GenServiceTask"},
comments="Derived from LobbyService.java.")
public class LobbyDispatcher extends InvocationDispatcher<LobbyMarshaller>
{
/**
* Creates a dispatcher that may be registered to dispatch invocation
* service requests for the specified provider.
*/
public LobbyDispatcher (LobbyProvider provider)
{
this.provider = provider;
}
@Override
public LobbyMarshaller createMarshaller ()
{
return new LobbyMarshaller();
}
@Override
public void dispatchRequest (
ClientObject source, int methodId, Object[] args)
throws InvocationException
{
switch (methodId) {
case LobbyMarshaller.GET_CATEGORIES:
((LobbyProvider)provider).getCategories(
source, (LobbyService.CategoriesListener)args[0]
);
return;
case LobbyMarshaller.GET_LOBBIES:
((LobbyProvider)provider).getLobbies(
source, (String)args[0], (LobbyService.LobbiesListener)args[1]
);
return;
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -42,6 +42,7 @@ import com.threerings.presents.server.InvocationManager;
import com.threerings.crowd.data.BodyObject;
import com.threerings.crowd.server.PlaceRegistry;
import com.threerings.micasa.lobby.LobbyMarshaller;
import com.threerings.micasa.lobby.LobbyService.CategoriesListener;
import com.threerings.micasa.lobby.LobbyService.LobbiesListener;
import com.threerings.micasa.server.MiCasaConfig;
@@ -100,7 +101,7 @@ public class LobbyRegistry
@Inject public LobbyRegistry (InvocationManager invmgr)
{
// register ourselves as an invocation service handler
invmgr.registerDispatcher(new LobbyDispatcher(this), InvocationCodes.GLOBAL_GROUP);
invmgr.registerProvider(this, LobbyMarshaller.class, InvocationCodes.GLOBAL_GROUP);
}
/**
@@ -1,71 +0,0 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved
// http://code.google.com/p/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.micasa.simulator.server;
import javax.annotation.Generated;
import com.threerings.micasa.simulator.data.SimulatorMarshaller;
import com.threerings.parlor.game.data.GameConfig;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException;
/**
* Dispatches requests to the {@link SimulatorProvider}.
*/
@Generated(value={"com.threerings.presents.tools.GenServiceTask"},
comments="Derived from SimulatorService.java.")
public class SimulatorDispatcher extends InvocationDispatcher<SimulatorMarshaller>
{
/**
* Creates a dispatcher that may be registered to dispatch invocation
* service requests for the specified provider.
*/
public SimulatorDispatcher (SimulatorProvider provider)
{
this.provider = provider;
}
@Override
public SimulatorMarshaller createMarshaller ()
{
return new SimulatorMarshaller();
}
@Override
public void dispatchRequest (
ClientObject source, int methodId, Object[] args)
throws InvocationException
{
switch (methodId) {
case SimulatorMarshaller.CREATE_GAME:
((SimulatorProvider)provider).createGame(
source, (GameConfig)args[0], (String)args[1], ((Integer)args[2]).intValue()
);
return;
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -27,6 +27,7 @@ import com.google.common.collect.Lists;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.threerings.micasa.simulator.data.SimulatorMarshaller;
import com.threerings.util.Name;
import com.threerings.presents.data.ClientObject;
@@ -57,7 +58,7 @@ public class SimulatorManager
{
// register our simulator provider
SimulatorProvider sprov = new SimulatorProvider(this);
invmgr.registerDispatcher(new SimulatorDispatcher(sprov), InvocationCodes.GLOBAL_GROUP);
invmgr.registerProvider(sprov, SimulatorMarshaller.class, InvocationCodes.GLOBAL_GROUP);
}
/**
@@ -1,83 +0,0 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved
// http://code.google.com/p/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.server;
import javax.annotation.Generated;
import com.threerings.parlor.card.data.Card;
import com.threerings.parlor.card.trick.data.TrickCardGameMarshaller;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException;
/**
* Dispatches requests to the {@link TrickCardGameProvider}.
*/
@Generated(value={"com.threerings.presents.tools.GenServiceTask"},
comments="Derived from TrickCardGameService.java.")
public class TrickCardGameDispatcher extends InvocationDispatcher<TrickCardGameMarshaller>
{
/**
* Creates a dispatcher that may be registered to dispatch invocation
* service requests for the specified provider.
*/
public TrickCardGameDispatcher (TrickCardGameProvider provider)
{
this.provider = provider;
}
@Override
public TrickCardGameMarshaller createMarshaller ()
{
return new TrickCardGameMarshaller();
}
@Override
public void dispatchRequest (
ClientObject source, int methodId, Object[] args)
throws InvocationException
{
switch (methodId) {
case TrickCardGameMarshaller.PLAY_CARD:
((TrickCardGameProvider)provider).playCard(
source, (Card)args[0], ((Integer)args[1]).intValue()
);
return;
case TrickCardGameMarshaller.REQUEST_REMATCH:
((TrickCardGameProvider)provider).requestRematch(
source
);
return;
case TrickCardGameMarshaller.SEND_CARDS_TO_PLAYER:
((TrickCardGameProvider)provider).sendCardsToPlayer(
source, ((Integer)args[0]).intValue(), (Card[])args[1]
);
return;
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -47,6 +47,7 @@ import com.threerings.parlor.card.data.Deck;
import com.threerings.parlor.card.data.Hand;
import com.threerings.parlor.card.data.PlayerCard;
import com.threerings.parlor.card.server.CardGameManager;
import com.threerings.parlor.card.trick.data.TrickCardGameMarshaller;
import com.threerings.parlor.card.trick.data.TrickCardGameObject;
import com.threerings.parlor.turn.server.TurnGameManagerDelegate;
@@ -105,7 +106,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate
_deck = new Deck();
_trickCardGame = (TrickCardGameObject)plobj;
_cardGame = (CardGameObject)plobj;
_trickCardGame.setTrickCardGameService(addDispatcher(new TrickCardGameDispatcher(this)));
_trickCardGame.setTrickCardGameService(addProvider(this, TrickCardGameMarshaller.class));
}
@Override
@@ -1,92 +0,0 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved
// http://code.google.com/p/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.server;
import javax.annotation.Generated;
import com.threerings.parlor.client.ParlorService;
import com.threerings.parlor.data.ParlorMarshaller;
import com.threerings.parlor.game.data.GameConfig;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException;
import com.threerings.util.Name;
/**
* Dispatches requests to the {@link ParlorProvider}.
*/
@Generated(value={"com.threerings.presents.tools.GenServiceTask"},
comments="Derived from ParlorService.java.")
public class ParlorDispatcher extends InvocationDispatcher<ParlorMarshaller>
{
/**
* Creates a dispatcher that may be registered to dispatch invocation
* service requests for the specified provider.
*/
public ParlorDispatcher (ParlorProvider provider)
{
this.provider = provider;
}
@Override
public ParlorMarshaller createMarshaller ()
{
return new ParlorMarshaller();
}
@Override
public void dispatchRequest (
ClientObject source, int methodId, Object[] args)
throws InvocationException
{
switch (methodId) {
case ParlorMarshaller.CANCEL:
((ParlorProvider)provider).cancel(
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]
);
return;
case ParlorMarshaller.RESPOND:
((ParlorProvider)provider).respond(
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]
);
return;
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -38,6 +38,7 @@ import com.threerings.crowd.server.PlaceRegistry;
import com.threerings.parlor.client.ParlorService;
import com.threerings.parlor.data.ParlorCodes;
import com.threerings.parlor.data.ParlorMarshaller;
import com.threerings.parlor.game.data.GameConfig;
import static com.threerings.parlor.Log.log;
@@ -53,7 +54,7 @@ public class ParlorManager
{
@Inject public ParlorManager (InvocationManager invmgr)
{
invmgr.registerDispatcher(new ParlorDispatcher(this), PARLOR_GROUP);
invmgr.registerProvider(this, ParlorMarshaller.class, PARLOR_GROUP);
}
// from interface ParlorProvider
@@ -1,98 +0,0 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved
// http://code.google.com/p/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.server;
import javax.annotation.Generated;
import com.threerings.parlor.data.TableConfig;
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.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException;
import com.threerings.util.Name;
/**
* Dispatches requests to the {@link TableProvider}.
*/
@Generated(value={"com.threerings.presents.tools.GenServiceTask"},
comments="Derived from TableService.java.")
public class TableDispatcher extends InvocationDispatcher<TableMarshaller>
{
/**
* Creates a dispatcher that may be registered to dispatch invocation
* service requests for the specified provider.
*/
public TableDispatcher (TableProvider provider)
{
this.provider = provider;
}
@Override
public TableMarshaller createMarshaller ()
{
return new TableMarshaller();
}
@Override
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(), (Name)args[1], (InvocationService.InvocationListener)args[2]
);
return;
case TableMarshaller.CREATE_TABLE:
((TableProvider)provider).createTable(
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]
);
return;
case TableMarshaller.LEAVE_TABLE:
((TableProvider)provider).leaveTable(
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]
);
return;
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -54,6 +54,7 @@ import com.threerings.parlor.data.ParlorCodes;
import com.threerings.parlor.data.Table;
import com.threerings.parlor.data.TableConfig;
import com.threerings.parlor.data.TableLobbyObject;
import com.threerings.parlor.data.TableMarshaller;
import com.threerings.parlor.game.data.GameConfig;
import com.threerings.parlor.game.data.GameObject;
import com.threerings.parlor.game.server.GameManager;
@@ -92,7 +93,7 @@ public class TableManager
// set up our object references
_tlobj = (TableLobbyObject)tableObject;
_tlobj.setTableService(_invmgr.registerDispatcher(new TableDispatcher(this)));
_tlobj.setTableService(_invmgr.registerProvider(this, TableMarshaller.class));
_dobj = tableObject;
// if our table is in a "place" add ourselves as a listener so that we can tell if a user
@@ -1,83 +0,0 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved
// http://code.google.com/p/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.tourney.server;
import javax.annotation.Generated;
import com.threerings.parlor.tourney.data.TourneyMarshaller;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException;
/**
* Dispatches requests to the {@link TourneyProvider}.
*/
@Generated(value={"com.threerings.presents.tools.GenServiceTask"},
comments="Derived from TourneyService.java.")
public class TourneyDispatcher extends InvocationDispatcher<TourneyMarshaller>
{
/**
* Creates a dispatcher that may be registered to dispatch invocation
* service requests for the specified provider.
*/
public TourneyDispatcher (TourneyProvider provider)
{
this.provider = provider;
}
@Override
public TourneyMarshaller createMarshaller ()
{
return new TourneyMarshaller();
}
@Override
public void dispatchRequest (
ClientObject source, int methodId, Object[] args)
throws InvocationException
{
switch (methodId) {
case TourneyMarshaller.CANCEL:
((TourneyProvider)provider).cancel(
source, (InvocationService.ConfirmListener)args[0]
);
return;
case TourneyMarshaller.JOIN:
((TourneyProvider)provider).join(
source, (InvocationService.ConfirmListener)args[0]
);
return;
case TourneyMarshaller.LEAVE:
((TourneyProvider)provider).leave(
source, (InvocationService.ConfirmListener)args[0]
);
return;
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -38,6 +38,7 @@ import com.threerings.crowd.server.BodyLocator;
import com.threerings.parlor.tourney.data.Participant;
import com.threerings.parlor.tourney.data.TourneyCodes;
import com.threerings.parlor.tourney.data.TourneyConfig;
import com.threerings.parlor.tourney.data.TourneyMarshaller;
import com.threerings.parlor.tourney.data.TourneyObject;
/**
@@ -58,7 +59,7 @@ public abstract class TourneyManager
// creare and configure our Tourney object
_trobj = _omgr.registerObject(new TourneyObject());
_trobj.setTourneyService(_invmgr.registerDispatcher(new TourneyDispatcher(this)));
_trobj.setTourneyService(_invmgr.registerProvider(this, TourneyMarshaller.class));
_trobj.config = config;
@@ -1,72 +0,0 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved
// http://code.google.com/p/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.tourney.server;
import javax.annotation.Generated;
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.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException;
/**
* Dispatches requests to the {@link TourniesProvider}.
*/
@Generated(value={"com.threerings.presents.tools.GenServiceTask"},
comments="Derived from TourniesService.java.")
public class TourniesDispatcher extends InvocationDispatcher<TourniesMarshaller>
{
/**
* Creates a dispatcher that may be registered to dispatch invocation
* service requests for the specified provider.
*/
public TourniesDispatcher (TourniesProvider provider)
{
this.provider = provider;
}
@Override
public TourniesMarshaller createMarshaller ()
{
return new TourniesMarshaller();
}
@Override
public void dispatchRequest (
ClientObject source, int methodId, Object[] args)
throws InvocationException
{
switch (methodId) {
case TourniesMarshaller.CREATE_TOURNEY:
((TourniesProvider)provider).createTourney(
source, (TourneyConfig)args[0], (InvocationService.ResultListener)args[1]
);
return;
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -1,77 +0,0 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved
// http://code.google.com/p/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.puzzle.server;
import javax.annotation.Generated;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException;
import com.threerings.puzzle.data.Board;
import com.threerings.puzzle.data.PuzzleGameMarshaller;
/**
* Dispatches requests to the {@link PuzzleGameProvider}.
*/
@Generated(value={"com.threerings.presents.tools.GenServiceTask"},
comments="Derived from PuzzleGameService.java.")
public class PuzzleGameDispatcher extends InvocationDispatcher<PuzzleGameMarshaller>
{
/**
* Creates a dispatcher that may be registered to dispatch invocation
* service requests for the specified provider.
*/
public PuzzleGameDispatcher (PuzzleGameProvider provider)
{
this.provider = provider;
}
@Override
public PuzzleGameMarshaller createMarshaller ()
{
return new PuzzleGameMarshaller();
}
@Override
public void dispatchRequest (
ClientObject source, int methodId, Object[] args)
throws InvocationException
{
switch (methodId) {
case PuzzleGameMarshaller.UPDATE_PROGRESS:
((PuzzleGameProvider)provider).updateProgress(
source, ((Integer)args[0]).intValue(), (int[])args[1]
);
return;
case PuzzleGameMarshaller.UPDATE_PROGRESS_SYNC:
((PuzzleGameProvider)provider).updateProgressSync(
source, ((Integer)args[0]).intValue(), (int[])args[1], (Board[])args[2]
);
return;
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -34,6 +34,7 @@ import com.threerings.parlor.game.server.GameManager;
import com.threerings.puzzle.data.Board;
import com.threerings.puzzle.data.BoardSummary;
import com.threerings.puzzle.data.PuzzleCodes;
import com.threerings.puzzle.data.PuzzleGameMarshaller;
import com.threerings.puzzle.data.PuzzleObject;
import static com.threerings.puzzle.Log.log;
@@ -157,7 +158,7 @@ public abstract class PuzzleManager extends GameManager
_puzobj = (PuzzleObject)_gameobj;
// create and fill in our game service object
_puzobj.setPuzzleGameService(addDispatcher(new PuzzleGameDispatcher(this)));
_puzobj.setPuzzleGameService(addProvider(this, PuzzleGameMarshaller.class));
}
@Override
@@ -1,78 +0,0 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved
// http://code.google.com/p/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.stage.server;
import javax.annotation.Generated;
import com.threerings.miso.data.ObjectInfo;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException;
import com.threerings.stage.data.StageSceneMarshaller;
/**
* Dispatches requests to the {@link StageSceneProvider}.
*/
@Generated(value={"com.threerings.presents.tools.GenServiceTask"},
comments="Derived from StageSceneService.java.")
public class StageSceneDispatcher extends InvocationDispatcher<StageSceneMarshaller>
{
/**
* Creates a dispatcher that may be registered to dispatch invocation
* service requests for the specified provider.
*/
public StageSceneDispatcher (StageSceneProvider provider)
{
this.provider = provider;
}
@Override
public StageSceneMarshaller createMarshaller ()
{
return new StageSceneMarshaller();
}
@Override
public void dispatchRequest (
ClientObject source, int methodId, Object[] args)
throws InvocationException
{
switch (methodId) {
case StageSceneMarshaller.ADD_OBJECT:
((StageSceneProvider)provider).addObject(
source, (ObjectInfo)args[0], (InvocationService.ConfirmListener)args[1]
);
return;
case StageSceneMarshaller.REMOVE_OBJECTS:
((StageSceneProvider)provider).removeObjects(
source, (ObjectInfo[])args[0], (InvocationService.ConfirmListener)args[1]
);
return;
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -63,6 +63,7 @@ import com.threerings.stage.data.StageLocation;
import com.threerings.stage.data.StageMisoSceneModel;
import com.threerings.stage.data.StageOccupantInfo;
import com.threerings.stage.data.StageScene;
import com.threerings.stage.data.StageSceneMarshaller;
import com.threerings.stage.data.StageSceneModel;
import com.threerings.stage.data.StageSceneObject;
import com.threerings.stage.util.StageSceneUtil;
@@ -257,7 +258,7 @@ public class StageSceneManager extends SpotSceneManager
_ssobj = (StageSceneObject)_plobj;
// register and fill in our stage scene service
_ssobj.setStageSceneService(addDispatcher(new StageSceneDispatcher(this)));
_ssobj.setStageSceneService(addProvider(this, StageSceneMarshaller.class));
}
@Override
@@ -1,71 +0,0 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved
// http://code.google.com/p/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.server;
import javax.annotation.Generated;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException;
import com.threerings.whirled.client.SceneService;
import com.threerings.whirled.data.SceneMarshaller;
/**
* Dispatches requests to the {@link SceneProvider}.
*/
@Generated(value={"com.threerings.presents.tools.GenServiceTask"},
comments="Derived from SceneService.java.")
public class SceneDispatcher extends InvocationDispatcher<SceneMarshaller>
{
/**
* Creates a dispatcher that may be registered to dispatch invocation
* service requests for the specified provider.
*/
public SceneDispatcher (SceneProvider provider)
{
this.provider = provider;
}
@Override
public SceneMarshaller createMarshaller ()
{
return new SceneMarshaller();
}
@Override
public void dispatchRequest (
ClientObject source, int methodId, Object[] args)
throws InvocationException
{
switch (methodId) {
case SceneMarshaller.MOVE_TO:
((SceneProvider)provider).moveTo(
source, ((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), (SceneService.SceneMoveListener)args[2]
);
return;
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -48,6 +48,7 @@ import com.threerings.crowd.server.PlaceRegistry;
import com.threerings.whirled.client.SceneService;
import com.threerings.whirled.data.Scene;
import com.threerings.whirled.data.SceneCodes;
import com.threerings.whirled.data.SceneMarshaller;
import com.threerings.whirled.data.SceneModel;
import com.threerings.whirled.server.persist.SceneRepository;
import com.threerings.whirled.util.NoSuchSceneException;
@@ -110,7 +111,7 @@ public class SceneRegistry
@Inject public SceneRegistry (InvocationManager invmgr)
{
// register our scene service
invmgr.registerDispatcher(new SceneDispatcher(this), SceneCodes.WHIRLED_GROUP);
invmgr.registerProvider(this, SceneMarshaller.class, SceneCodes.WHIRLED_GROUP);
}
/**
@@ -1,91 +0,0 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved
// http://code.google.com/p/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.spot.server;
import javax.annotation.Generated;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException;
import com.threerings.whirled.spot.client.SpotService;
import com.threerings.whirled.spot.data.Location;
import com.threerings.whirled.spot.data.SpotMarshaller;
/**
* Dispatches requests to the {@link SpotProvider}.
*/
@Generated(value={"com.threerings.presents.tools.GenServiceTask"},
comments="Derived from SpotService.java.")
public class SpotDispatcher extends InvocationDispatcher<SpotMarshaller>
{
/**
* Creates a dispatcher that may be registered to dispatch invocation
* service requests for the specified provider.
*/
public SpotDispatcher (SpotProvider provider)
{
this.provider = provider;
}
@Override
public SpotMarshaller createMarshaller ()
{
return new SpotMarshaller();
}
@Override
public void dispatchRequest (
ClientObject source, int methodId, Object[] args)
throws InvocationException
{
switch (methodId) {
case SpotMarshaller.CHANGE_LOCATION:
((SpotProvider)provider).changeLocation(
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()
);
return;
case SpotMarshaller.JOIN_CLUSTER:
((SpotProvider)provider).joinCluster(
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(), (SpotService.SpotSceneMoveListener)args[3]
);
return;
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -43,6 +43,7 @@ import com.threerings.whirled.spot.client.SpotService;
import com.threerings.whirled.spot.data.Location;
import com.threerings.whirled.spot.data.Portal;
import com.threerings.whirled.spot.data.SpotCodes;
import com.threerings.whirled.spot.data.SpotMarshaller;
import com.threerings.whirled.spot.data.SpotScene;
import static com.threerings.whirled.spot.Log.log;
@@ -60,7 +61,7 @@ public class SpotSceneRegistry extends SceneRegistry
@Inject public SpotSceneRegistry (InvocationManager invmgr)
{
super(invmgr);
invmgr.registerDispatcher(new SpotDispatcher(this), SceneCodes.WHIRLED_GROUP);
invmgr.registerProvider(this, SpotMarshaller.class, SceneCodes.WHIRLED_GROUP);
}
/**
@@ -1,71 +0,0 @@
//
// $Id$
//
// Vilya library - tools for developing networked games
// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved
// http://code.google.com/p/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.server;
import javax.annotation.Generated;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.server.InvocationDispatcher;
import com.threerings.presents.server.InvocationException;
import com.threerings.whirled.zone.client.ZoneService;
import com.threerings.whirled.zone.data.ZoneMarshaller;
/**
* Dispatches requests to the {@link ZoneProvider}.
*/
@Generated(value={"com.threerings.presents.tools.GenServiceTask"},
comments="Derived from ZoneService.java.")
public class ZoneDispatcher extends InvocationDispatcher<ZoneMarshaller>
{
/**
* Creates a dispatcher that may be registered to dispatch invocation
* service requests for the specified provider.
*/
public ZoneDispatcher (ZoneProvider provider)
{
this.provider = provider;
}
@Override
public ZoneMarshaller createMarshaller ()
{
return new ZoneMarshaller();
}
@Override
public void dispatchRequest (
ClientObject source, int methodId, Object[] args)
throws InvocationException
{
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]
);
return;
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -39,6 +39,7 @@ import com.threerings.crowd.server.LocationProvider;
import com.threerings.whirled.server.SceneRegistry;
import com.threerings.whirled.zone.client.ZoneService;
import com.threerings.whirled.zone.data.ZoneCodes;
import com.threerings.whirled.zone.data.ZoneMarshaller;
import com.threerings.whirled.zone.data.ZonedBodyObject;
import com.threerings.whirled.zone.util.ZoneUtil;
@@ -56,7 +57,7 @@ public class ZoneRegistry
*/
@Inject public ZoneRegistry (InvocationManager invmgr)
{
invmgr.registerDispatcher(new ZoneDispatcher(this), ZoneCodes.WHIRLED_GROUP);
invmgr.registerProvider(this, ZoneMarshaller.class, ZoneCodes.WHIRLED_GROUP);
}
/**