//
// $Id: CrowdClient.java,v 1.16 2002/11/05 05:48:18 mdb Exp $

package com.threerings.crowd.server;

import com.threerings.presents.server.PresentsClient;

import com.threerings.crowd.Log;
import com.threerings.crowd.data.BodyObject;
import com.threerings.crowd.data.OccupantInfo;
import com.threerings.crowd.data.PlaceObject;

/**
 * The crowd client extends the presents client with crowd-specific client
 * handling.
 */
public class CrowdClient extends PresentsClient
{
    // documentation inherited
    protected void sessionConnectionClosed ()
    {
        super.sessionConnectionClosed();

        if (_clobj != null) {
            // note that the user's disconnected
            BodyObject bobj = (BodyObject)_clobj;
            BodyProvider.updateOccupantStatus(
                bobj, bobj.location, OccupantInfo.DISCONNECTED);
        }
    }

    // documentation inherited
    protected void sessionWillResume ()
    {
        super.sessionWillResume();

        // note that the user's active once more
        BodyObject bobj = (BodyObject)_clobj;
        BodyProvider.updateOccupantStatus(
            bobj, bobj.location, OccupantInfo.ACTIVE);
    }
}

@@ -30,9 +30,9 @@
  1.1
-6
+7
  200
@@ -40,19 +40,19 @@
 /11/
-05 05:48:18
+26 02:46:01
  mdb
@@ -1164,11 +1164,359 @@
 );%0A    %7D
+%0A%0A    // documentation inherited%0A    protected void sessionDidEnd ()%0A    %7B%0A        // clear out our location so that anyone listening for such things%0A        // will know that we've left%0A        if (_clobj != null) %7B%0A            BodyObject bobj = (BodyObject)_clobj;%0A            bobj.setLocation(-1);%0A        %7D%0A%0A        super.sessionDidEnd();%0A    %7D
 %0A%7D%0A

Clear out our body's location when we log off because with the new client reference counting thing, we can't rely on a user's object being destroyed immediately after they log off. Better to ensure that their location will always be cleared so that location interested entities will be properly notified.