From a22a6e5551380070831129344700b353156836e7 Mon Sep 17 00:00:00 2001 From: Mike Thomas Date: Thu, 21 Jun 2007 00:10:25 +0000 Subject: [PATCH] Ensure we've registered our receiver before we call our superclass's function, since this queues up a playerReady and it's important that our addToReceivers event is queued up before that so the game doesn't start before we're ready to go. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@319 c613c5cb-e716-0410-b11b-feb51c14d237 --- .../parlor/card/client/CardGameController.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/java/com/threerings/parlor/card/client/CardGameController.java b/src/java/com/threerings/parlor/card/client/CardGameController.java index f3b97d66..bda68e32 100644 --- a/src/java/com/threerings/parlor/card/client/CardGameController.java +++ b/src/java/com/threerings/parlor/card/client/CardGameController.java @@ -42,19 +42,19 @@ public abstract class CardGameController extends GameController // Documentation inherited. public void willEnterPlace (PlaceObject plobj) { - super.willEnterPlace(plobj); - if (_ctx.getClient().getClientObject().receivers.containsKey( CardGameDecoder.RECEIVER_CODE)) { Log.warning("Yuh oh, we already have a card game receiver " + "registered and are trying for another...!"); Thread.dumpStack(); } - + _ctx.getClient().getInvocationDirector().registerReceiver( new CardGameDecoder(this)); + + super.willEnterPlace(plobj); } - + // Documentation inherited. public void didLeavePlace (PlaceObject plobj) { @@ -63,7 +63,7 @@ public abstract class CardGameController extends GameController _ctx.getClient().getInvocationDirector().unregisterReceiver( CardGameDecoder.RECEIVER_CODE); } - + // Documentation inherited. public void turnDidChange (Name turnHolder) {} @@ -77,7 +77,7 @@ public abstract class CardGameController extends GameController receivedHand(hand); } } - + /** * Called when the server deals the client a new hand of cards. Default * implementation does nothing. @@ -86,7 +86,7 @@ public abstract class CardGameController extends GameController */ public void receivedHand (Hand hand) {} - + /** * Dispatched to the client when it has received a set of cards * from another player. Default implementation does nothing. @@ -96,7 +96,7 @@ public abstract class CardGameController extends GameController */ public void receivedCardsFromPlayer (int plidx, Card[] cards) {} - + /** * Dispatched to the client when the server has forced it to send * a set of cards to another player. Default implementation does @@ -107,7 +107,7 @@ public abstract class CardGameController extends GameController */ public void sentCardsToPlayer (int plidx, Card[] cards) {} - + /** * Dispatched to the client when a set of cards is transferred between * two other players in the game. Default implementation does nothing.