From 3d7c12a5d1e1078d4c04f7f582854634d72527a1 Mon Sep 17 00:00:00 2001 From: Mike Thomas Date: Fri, 28 Jul 2006 21:16:37 +0000 Subject: [PATCH] Allow a little more info in deciding whether to declare the place empty. Also, while I was in there, added some safety so we don't lose track of shutdownIntervals and let them run amuck. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4295 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/crowd/server/PlaceManager.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/java/com/threerings/crowd/server/PlaceManager.java b/src/java/com/threerings/crowd/server/PlaceManager.java index 35ab7ed5c..b3ffd0610 100644 --- a/src/java/com/threerings/crowd/server/PlaceManager.java +++ b/src/java/com/threerings/crowd/server/PlaceManager.java @@ -452,7 +452,7 @@ public class PlaceManager } // clear out their canonical (local) occupant info record - _occInfo.remove(bodyOid); + OccupantInfo leaver = _occInfo.remove(bodyOid); // let our delegates know what's up applyToDelegates(new DelegateOp() { @@ -462,7 +462,7 @@ public class PlaceManager }); // if that leaves us with zero occupants, maybe do something - if (shouldDeclareEmpty()) { + if (shouldDeclareEmpty(leaver)) { placeBecameEmpty(); } } @@ -471,7 +471,7 @@ public class PlaceManager * Returns whether the location should be marked as empty and potentially * shutdown. */ - protected boolean shouldDeclareEmpty () + protected boolean shouldDeclareEmpty (OccupantInfo leaver) { return (_plobj.occupants.size() == 0); } @@ -514,9 +514,9 @@ public class PlaceManager */ protected void checkShutdownInterval () { - // queue up a shutdown interval + // queue up a shutdown interval, unless we've already got one. long idlePeriod = idleUnloadPeriod(); - if (idlePeriod > 0L) { + if (idlePeriod > 0L && _shutdownInterval == null) { _shutdownInterval = new Interval((PresentsDObjectMgr)_omgr) { public void expired () { Log.debug("Unloading idle place '" + where () + "'.");