Regenerated our marshaller and dispatcher classes with the new Java-based

generator. It handles inner classes slightly differently and prepends a
project-specific header to the generated classes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3239 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2004-11-25 04:47:40 +00:00
parent a0d343ff04
commit a04e23e025
32 changed files with 296 additions and 211 deletions
@@ -1,12 +1,30 @@
//
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/narya/
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.threerings.parlor.card.data;
import com.threerings.parlor.card.client.CardGameService;
import com.threerings.parlor.card.data.Card;
import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService.ConfirmListener;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.dobj.InvocationResponseEvent;
@@ -24,9 +42,9 @@ public class CardGameMarshaller extends InvocationMarshaller
public static final int SEND_CARDS_TO_PLAYER = 1;
// documentation inherited from interface
public void sendCardsToPlayer (Client arg1, int arg2, Card[] arg3, ConfirmListener arg4)
public void sendCardsToPlayer (Client arg1, int arg2, Card[] arg3, InvocationService.ConfirmListener arg4)
{
ConfirmMarshaller listener4 = new ConfirmMarshaller();
InvocationMarshaller.ConfirmMarshaller listener4 = new InvocationMarshaller.ConfirmMarshaller();
listener4.listener = arg4;
sendRequest(arg1, SEND_CARDS_TO_PLAYER, new Object[] {
new Integer(arg2), arg3, listener4
@@ -1,5 +1,23 @@
//
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/narya/
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.threerings.parlor.card.server;
@@ -7,7 +25,7 @@ import com.threerings.parlor.card.client.CardGameService;
import com.threerings.parlor.card.data.Card;
import com.threerings.parlor.card.data.CardGameMarshaller;
import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService.ConfirmListener;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.server.InvocationDispatcher;
@@ -42,7 +60,7 @@ public class CardGameDispatcher extends InvocationDispatcher
case CardGameMarshaller.SEND_CARDS_TO_PLAYER:
((CardGameProvider)provider).sendCardsToPlayer(
source,
((Integer)args[0]).intValue(), (Card[])args[1], (ConfirmListener)args[2]
((Integer)args[0]).intValue(), (Card[])args[1], (InvocationService.ConfirmListener)args[2]
);
return;
@@ -1,5 +1,5 @@
//
// $Id: ParlorMarshaller.java,v 1.4 2004/08/27 02:20:13 mdb Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -22,11 +22,9 @@
package com.threerings.parlor.data;
import com.threerings.parlor.client.ParlorService;
import com.threerings.parlor.client.ParlorService.InviteListener;
import com.threerings.parlor.client.ParlorService.TableListener;
import com.threerings.parlor.game.GameConfig;
import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService.InvocationListener;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.dobj.InvocationResponseEvent;
import com.threerings.util.Name;
@@ -41,37 +39,6 @@ import com.threerings.util.Name;
public class ParlorMarshaller extends InvocationMarshaller
implements ParlorService
{
// documentation inherited
public static class TableMarshaller extends ListenerMarshaller
implements TableListener
{
/** The method id used to dispatch {@link #tableCreated}
* responses. */
public static final int TABLE_CREATED = 1;
// documentation inherited from interface
public void tableCreated (int arg1)
{
omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, TABLE_CREATED,
new Object[] { new Integer(arg1) }));
}
// documentation inherited
public void dispatchResponse (int methodId, Object[] args)
{
switch (methodId) {
case TABLE_CREATED:
((TableListener)listener).tableCreated(
((Integer)args[0]).intValue());
return;
default:
super.dispatchResponse(methodId, args);
}
}
}
// documentation inherited
public static class InviteMarshaller extends ListenerMarshaller
implements InviteListener
@@ -103,37 +70,42 @@ public class ParlorMarshaller extends InvocationMarshaller
}
}
/** The method id used to dispatch {@link #invite} requests. */
public static final int INVITE = 1;
// documentation inherited from interface
public void invite (Client arg1, Name arg2, GameConfig arg3, InviteListener arg4)
// documentation inherited
public static class TableMarshaller extends ListenerMarshaller
implements TableListener
{
InviteMarshaller listener4 = new InviteMarshaller();
listener4.listener = arg4;
sendRequest(arg1, INVITE, new Object[] {
arg2, arg3, listener4
});
}
/** The method id used to dispatch {@link #tableCreated}
* responses. */
public static final int TABLE_CREATED = 1;
/** The method id used to dispatch {@link #respond} requests. */
public static final int RESPOND = 2;
// documentation inherited from interface
public void tableCreated (int arg1)
{
omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, TABLE_CREATED,
new Object[] { new Integer(arg1) }));
}
// documentation inherited from interface
public void respond (Client arg1, int arg2, int arg3, Object arg4, InvocationListener arg5)
{
ListenerMarshaller listener5 = new ListenerMarshaller();
listener5.listener = arg5;
sendRequest(arg1, RESPOND, new Object[] {
new Integer(arg2), new Integer(arg3), arg4, listener5
});
// documentation inherited
public void dispatchResponse (int methodId, Object[] args)
{
switch (methodId) {
case TABLE_CREATED:
((TableListener)listener).tableCreated(
((Integer)args[0]).intValue());
return;
default:
super.dispatchResponse(methodId, args);
}
}
}
/** The method id used to dispatch {@link #cancel} requests. */
public static final int CANCEL = 3;
public static final int CANCEL = 1;
// documentation inherited from interface
public void cancel (Client arg1, int arg2, InvocationListener arg3)
public void cancel (Client arg1, int arg2, InvocationService.InvocationListener arg3)
{
ListenerMarshaller listener3 = new ListenerMarshaller();
listener3.listener = arg3;
@@ -142,13 +114,39 @@ public class ParlorMarshaller extends InvocationMarshaller
});
}
/** The method id used to dispatch {@link #invite} requests. */
public static final int INVITE = 2;
// documentation inherited from interface
public void invite (Client arg1, Name arg2, GameConfig arg3, ParlorService.InviteListener arg4)
{
ParlorMarshaller.InviteMarshaller listener4 = new ParlorMarshaller.InviteMarshaller();
listener4.listener = arg4;
sendRequest(arg1, INVITE, new Object[] {
arg2, arg3, listener4
});
}
/** The method id used to dispatch {@link #respond} requests. */
public static final int RESPOND = 3;
// documentation inherited from interface
public void respond (Client arg1, int arg2, int arg3, Object arg4, InvocationService.InvocationListener arg5)
{
ListenerMarshaller listener5 = new ListenerMarshaller();
listener5.listener = arg5;
sendRequest(arg1, RESPOND, new Object[] {
new Integer(arg2), new Integer(arg3), arg4, listener5
});
}
/** The method id used to dispatch {@link #createTable} requests. */
public static final int CREATE_TABLE = 4;
// documentation inherited from interface
public void createTable (Client arg1, int arg2, GameConfig arg3, TableListener arg4)
public void createTable (Client arg1, int arg2, GameConfig arg3, ParlorService.TableListener arg4)
{
TableMarshaller listener4 = new TableMarshaller();
ParlorMarshaller.TableMarshaller listener4 = new ParlorMarshaller.TableMarshaller();
listener4.listener = arg4;
sendRequest(arg1, CREATE_TABLE, new Object[] {
new Integer(arg2), arg3, listener4
@@ -159,7 +157,7 @@ public class ParlorMarshaller extends InvocationMarshaller
public static final int JOIN_TABLE = 5;
// documentation inherited from interface
public void joinTable (Client arg1, int arg2, int arg3, int arg4, InvocationListener arg5)
public void joinTable (Client arg1, int arg2, int arg3, int arg4, InvocationService.InvocationListener arg5)
{
ListenerMarshaller listener5 = new ListenerMarshaller();
listener5.listener = arg5;
@@ -172,7 +170,7 @@ public class ParlorMarshaller extends InvocationMarshaller
public static final int LEAVE_TABLE = 6;
// documentation inherited from interface
public void leaveTable (Client arg1, int arg2, int arg3, InvocationListener arg4)
public void leaveTable (Client arg1, int arg2, int arg3, InvocationService.InvocationListener arg4)
{
ListenerMarshaller listener4 = new ListenerMarshaller();
listener4.listener = arg4;
@@ -1,5 +1,5 @@
//
// $Id: GameDispatcher.java,v 1.5 2004/08/27 02:20:14 mdb Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -57,15 +57,13 @@ public class GameDispatcher extends InvocationDispatcher
switch (methodId) {
case GameMarshaller.PLAYER_READY:
((GameProvider)provider).playerReady(
source
source
);
return;
case GameMarshaller.START_PARTY_GAME:
((GameProvider)provider).startPartyGame(
source
source
);
return;
@@ -1,5 +1,5 @@
//
// $Id: GameMarshaller.java,v 1.6 2004/08/27 02:20:14 mdb Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -1,5 +1,5 @@
//
// $Id: ParlorDispatcher.java,v 1.4 2004/08/27 02:20:14 mdb Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -22,12 +22,10 @@
package com.threerings.parlor.server;
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;
import com.threerings.parlor.game.GameConfig;
import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService.InvocationListener;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.server.InvocationDispatcher;
@@ -60,45 +58,45 @@ public class ParlorDispatcher extends InvocationDispatcher
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], (InviteListener)args[2]
(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(), (Object)args[2], (InvocationListener)args[3]
);
return;
case ParlorMarshaller.CANCEL:
((ParlorProvider)provider).cancel(
source,
((Integer)args[0]).intValue(), (InvocationListener)args[1]
((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), (Object)args[2], (InvocationService.InvocationListener)args[3]
);
return;
case ParlorMarshaller.CREATE_TABLE:
((ParlorProvider)provider).createTable(
source,
((Integer)args[0]).intValue(), (GameConfig)args[1], (TableListener)args[2]
((Integer)args[0]).intValue(), (GameConfig)args[1], (ParlorService.TableListener)args[2]
);
return;
case ParlorMarshaller.JOIN_TABLE:
((ParlorProvider)provider).joinTable(
source,
((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), ((Integer)args[2]).intValue(), (InvocationListener)args[3]
((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), ((Integer)args[2]).intValue(), (InvocationService.InvocationListener)args[3]
);
return;
case ParlorMarshaller.LEAVE_TABLE:
((ParlorProvider)provider).leaveTable(
source,
((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), (InvocationListener)args[2]
((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), (InvocationService.InvocationListener)args[2]
);
return;