From 30185cb8144b6f3ef9544ea8ae4999ff321a9f3e Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 24 Oct 2001 01:00:54 +0000 Subject: [PATCH] Shut down the game manager when everyone leaves the room. The game object and manager will simply disappear at that point which means that the game will be aborted if it hasn't yet been completed. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@547 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/parlor/game/GameManager.java | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/java/com/threerings/parlor/game/GameManager.java b/src/java/com/threerings/parlor/game/GameManager.java index 0c9c05be4..b6ffea4be 100644 --- a/src/java/com/threerings/parlor/game/GameManager.java +++ b/src/java/com/threerings/parlor/game/GameManager.java @@ -1,5 +1,5 @@ // -// $Id: GameManager.java,v 1.13 2001/10/18 18:39:10 mdb Exp $ +// $Id: GameManager.java,v 1.14 2001/10/24 01:00:54 mdb Exp $ package com.threerings.parlor.game; @@ -95,17 +95,27 @@ public class GameManager } } - // documentation inherited - protected void bodyEntered (int bodyOid) - { - } - // documentation inherited protected void bodyLeft (int bodyOid) { + super.bodyLeft(bodyOid); + // deal with disappearing players } + /** + * When a game room becomes empty, we cancel the game if it's still in + * progress and close down the game room. + */ + protected void placeBecameEmpty () + { + Log.info("Game room empty. Going away. [game=" + _gameobj + "]."); + + // shut down the place (which will destroy the game object and + // clean up after everything) + shutdown(); + } + /** * This is called when the game is ready to start (all players * involved have delivered their "am ready" notifications). It calls