Debugging code to try to track down the cause of the multiply released

pending ratings. Somehow a game is getting ended twice even though the
code should prevent it.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3055 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2004-07-10 01:32:54 +00:00
parent 55df96a644
commit fe7e9dc413
@@ -1,5 +1,5 @@
// //
// $Id: GameManager.java,v 1.71 2004/03/06 11:29:19 mdb Exp $ // $Id: GameManager.java,v 1.72 2004/07/10 01:32:54 mdb Exp $
package com.threerings.parlor.game; package com.threerings.parlor.game;
@@ -464,7 +464,8 @@ public class GameManager extends PlaceManager
// "[game=" + _gameobj.which() + "]."); // "[game=" + _gameobj.which() + "].");
// cancel the game if it was not already over // cancel the game if it was not already over
if (_gameobj.state != GameObject.GAME_OVER) { if (_gameobj.state != GameObject.GAME_OVER &&
_gameobj.state != GameObject.CANCELLED) {
_gameobj.setState(GameObject.CANCELLED); _gameobj.setState(GameObject.CANCELLED);
} }
@@ -527,7 +528,10 @@ public class GameManager extends PlaceManager
protected void handlePartialNoShow () protected void handlePartialNoShow ()
{ {
// cancel the game // cancel the game
_gameobj.setState(GameObject.CANCELLED); if (_gameobj.state != GameObject.GAME_OVER &&
_gameobj.state != GameObject.CANCELLED) {
_gameobj.setState(GameObject.CANCELLED);
}
} }
/** /**
@@ -652,6 +656,15 @@ public class GameManager extends PlaceManager
*/ */
public void endGame () public void endGame ()
{ {
// TEMP: debug pending rating repeat bug
if (_gameEndTrace != null) {
Log.warning("Requested to end already ended game " +
"[game=" + _gameobj.which() + "].");
Thread.dumpStack();
}
_gameEndTrace = new Exception().getStackTrace();
// END TEMP
if (_gameobj.state != GameObject.IN_PLAY) { if (_gameobj.state != GameObject.IN_PLAY) {
Log.debug("Refusing to end game that was not in play " + Log.debug("Refusing to end game that was not in play " +
"[game=" + _gameobj.which() + "]."); "[game=" + _gameobj.which() + "].");
@@ -660,7 +673,6 @@ public class GameManager extends PlaceManager
_gameobj.startTransaction(); _gameobj.startTransaction();
try { try {
// let the derived class do its pre-end stuff // let the derived class do its pre-end stuff
gameWillEnd(); gameWillEnd();
@@ -968,6 +980,9 @@ public class GameManager extends PlaceManager
/** Our delegate operator to tick AIs. */ /** Our delegate operator to tick AIs. */
protected TickAIDelegateOp _tickAIOp; protected TickAIDelegateOp _tickAIOp;
/** TEMP: debugging the pending rating double release bug. */
protected StackTraceElement[] _gameEndTrace;
/** A list of all currently active game managers. */ /** A list of all currently active game managers. */
protected static ArrayList _managers = new ArrayList(); protected static ArrayList _managers = new ArrayList();