We cannot initialize these intervals until the init() function, otherwise _omgr is null and we end up getting things called on the wrong thread.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@805 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
+26
-13
@@ -32,10 +32,13 @@ import com.threerings.util.Name;
|
|||||||
|
|
||||||
import com.threerings.presents.data.ClientObject;
|
import com.threerings.presents.data.ClientObject;
|
||||||
import com.threerings.presents.dobj.DObject;
|
import com.threerings.presents.dobj.DObject;
|
||||||
|
import com.threerings.presents.dobj.RootDObjectManager;
|
||||||
|
import com.threerings.presents.server.InvocationManager;
|
||||||
|
|
||||||
import com.threerings.crowd.data.BodyObject;
|
import com.threerings.crowd.data.BodyObject;
|
||||||
import com.threerings.crowd.data.PlaceConfig;
|
import com.threerings.crowd.data.PlaceConfig;
|
||||||
import com.threerings.crowd.data.PlaceObject;
|
import com.threerings.crowd.data.PlaceObject;
|
||||||
|
import com.threerings.crowd.server.PlaceManager;
|
||||||
|
|
||||||
import com.threerings.parlor.card.data.Card;
|
import com.threerings.parlor.card.data.Card;
|
||||||
import com.threerings.parlor.card.data.CardGameObject;
|
import com.threerings.parlor.card.data.CardGameObject;
|
||||||
@@ -65,6 +68,27 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init (PlaceManager plmgr, RootDObjectManager omgr, InvocationManager invmgr)
|
||||||
|
{
|
||||||
|
super.init(plmgr, omgr, invmgr);
|
||||||
|
|
||||||
|
// Create these intervals HERE after the _omgr is actually initialized.
|
||||||
|
_turnTimeoutInterval = new Interval(_omgr) {
|
||||||
|
@Override
|
||||||
|
public void expired () {
|
||||||
|
_turnTimedOut = true;
|
||||||
|
turnTimedOut();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
_endTrickInterval = new Interval(_omgr) {
|
||||||
|
@Override
|
||||||
|
public void expired () {
|
||||||
|
endTrick();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void didInit (PlaceConfig config)
|
public void didInit (PlaceConfig config)
|
||||||
{
|
{
|
||||||
@@ -566,21 +590,10 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** The all-purpose turn timeout interval. */
|
/** The all-purpose turn timeout interval. */
|
||||||
protected Interval _turnTimeoutInterval = new Interval(_omgr) {
|
protected Interval _turnTimeoutInterval;
|
||||||
@Override
|
|
||||||
public void expired () {
|
|
||||||
_turnTimedOut = true;
|
|
||||||
turnTimedOut();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Calls {@link #endTrick} upon expiration. */
|
/** Calls {@link #endTrick} upon expiration. */
|
||||||
protected Interval _endTrickInterval = new Interval(_omgr) {
|
protected Interval _endTrickInterval;
|
||||||
@Override
|
|
||||||
public void expired () {
|
|
||||||
endTrick();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/** The card game manager. */
|
/** The card game manager. */
|
||||||
protected CardGameManager _cgmgr;
|
protected CardGameManager _cgmgr;
|
||||||
|
|||||||
Reference in New Issue
Block a user