Explicitly pass along the client object to sessionConnectionClosed()
because it will have been cleared out of _clobj by the time said method is called if it is called as a part of a terminated session. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2021 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
//
|
//
|
||||||
// $Id: CrowdClient.java,v 1.19 2002/12/03 06:58:57 mdb Exp $
|
// $Id: CrowdClient.java,v 1.20 2002/12/04 02:47:03 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.crowd.server;
|
package com.threerings.crowd.server;
|
||||||
|
|
||||||
|
import com.threerings.presents.data.ClientObject;
|
||||||
import com.threerings.presents.server.PresentsClient;
|
import com.threerings.presents.server.PresentsClient;
|
||||||
|
|
||||||
import com.threerings.crowd.Log;
|
import com.threerings.crowd.Log;
|
||||||
@@ -18,16 +19,14 @@ import com.threerings.crowd.server.CrowdServer;
|
|||||||
public class CrowdClient extends PresentsClient
|
public class CrowdClient extends PresentsClient
|
||||||
{
|
{
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
protected void sessionConnectionClosed ()
|
protected void sessionConnectionClosed (ClientObject clobj)
|
||||||
{
|
{
|
||||||
super.sessionConnectionClosed();
|
super.sessionConnectionClosed(clobj);
|
||||||
|
|
||||||
if (_clobj != null) {
|
// note that the user's disconnected
|
||||||
// note that the user's disconnected
|
BodyObject bobj = (BodyObject)clobj;
|
||||||
BodyObject bobj = (BodyObject)_clobj;
|
BodyProvider.updateOccupantStatus(
|
||||||
BodyProvider.updateOccupantStatus(
|
bobj, bobj.location, OccupantInfo.DISCONNECTED);
|
||||||
bobj, bobj.location, OccupantInfo.DISCONNECTED);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: PresentsClient.java,v 1.45 2002/11/26 02:14:25 mdb Exp $
|
// $Id: PresentsClient.java,v 1.46 2002/12/04 02:47:03 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.presents.server;
|
package com.threerings.presents.server;
|
||||||
|
|
||||||
@@ -507,6 +507,10 @@ public class PresentsClient
|
|||||||
// clear out our connection reference
|
// clear out our connection reference
|
||||||
setConnection(null);
|
setConnection(null);
|
||||||
|
|
||||||
|
// we want to pass this to session connection closed even if we
|
||||||
|
// end up clearing it out before that method is actually run
|
||||||
|
final ClientObject clobj = _clobj;
|
||||||
|
|
||||||
// clear out our subscriptions. we need to do this on the dobjmgr
|
// clear out our subscriptions. we need to do this on the dobjmgr
|
||||||
// thread. it is important that we do this *after* we clear out
|
// thread. it is important that we do this *after* we clear out
|
||||||
// our connection reference. once the connection ref is null, no
|
// our connection reference. once the connection ref is null, no
|
||||||
@@ -514,7 +518,7 @@ public class PresentsClient
|
|||||||
// queued up before the connection went away)
|
// queued up before the connection went away)
|
||||||
PresentsServer.omgr.postUnit(new Runnable() {
|
PresentsServer.omgr.postUnit(new Runnable() {
|
||||||
public void run () {
|
public void run () {
|
||||||
sessionConnectionClosed();
|
sessionConnectionClosed(clobj);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -524,8 +528,12 @@ public class PresentsClient
|
|||||||
* this session has been closed and unmapped. If the user logged off
|
* this session has been closed and unmapped. If the user logged off
|
||||||
* before closing their connection, this will be preceded by a call to
|
* before closing their connection, this will be preceded by a call to
|
||||||
* {@link #sessionDidEnd}.
|
* {@link #sessionDidEnd}.
|
||||||
|
*
|
||||||
|
* @param clobj the client object is explicitly passed to this method
|
||||||
|
* because {@link #_clobj} may have already been cleared out if this
|
||||||
|
* is being called due to the termination of a session.
|
||||||
*/
|
*/
|
||||||
protected void sessionConnectionClosed ()
|
protected void sessionConnectionClosed (ClientObject clobj)
|
||||||
{
|
{
|
||||||
// clear out our dobj subscriptions in case they weren't cleared
|
// clear out our dobj subscriptions in case they weren't cleared
|
||||||
// by a call to sessionDidEnd
|
// by a call to sessionDidEnd
|
||||||
|
|||||||
Reference in New Issue
Block a user