Have to check that the user exists in sessionConnectionClosed() before

setting their status to disconnected; don't have to check that the user
exists in sessionDidEnd().


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2028 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-12-05 16:39:21 +00:00
parent 0749a20e6e
commit ee8eda46bb
@@ -1,5 +1,5 @@
// //
// $Id: CrowdClient.java,v 1.20 2002/12/04 02:47:03 mdb Exp $ // $Id: CrowdClient.java,v 1.21 2002/12/05 16:39:21 mdb Exp $
package com.threerings.crowd.server; package com.threerings.crowd.server;
@@ -19,15 +19,17 @@ import com.threerings.crowd.server.CrowdServer;
public class CrowdClient extends PresentsClient public class CrowdClient extends PresentsClient
{ {
// documentation inherited // documentation inherited
protected void sessionConnectionClosed (ClientObject clobj) protected void sessionConnectionClosed ()
{ {
super.sessionConnectionClosed(clobj); super.sessionConnectionClosed();
// note that the user's disconnected if (_clobj != null) {
BodyObject bobj = (BodyObject)clobj; // note that the user is disconnected
BodyObject bobj = (BodyObject)_clobj;
BodyProvider.updateOccupantStatus( BodyProvider.updateOccupantStatus(
bobj, bobj.location, OccupantInfo.DISCONNECTED); bobj, bobj.location, OccupantInfo.DISCONNECTED);
} }
}
// documentation inherited // documentation inherited
protected void sessionWillResume () protected void sessionWillResume ()
@@ -43,15 +45,13 @@ public class CrowdClient extends PresentsClient
// documentation inherited // documentation inherited
protected void sessionDidEnd () protected void sessionDidEnd ()
{ {
super.sessionDidEnd();
// clear out our location so that anyone listening for such things // clear out our location so that anyone listening for such things
// will know that we've left // will know that we've left
if (_clobj != null) {
clearLocation((BodyObject)_clobj); clearLocation((BodyObject)_clobj);
} }
super.sessionDidEnd();
}
/** /**
* When the user ends their session, this method is called to clear * When the user ends their session, this method is called to clear
* out any location they might occupy. The default implementation * out any location they might occupy. The default implementation