director audit: make sure things shut down well.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1854 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2002-10-28 00:22:38 +00:00
parent 883f912a30
commit b5e5f5f4e1
2 changed files with 38 additions and 9 deletions
@@ -1,5 +1,5 @@
//
// $Id: ChatDirector.java,v 1.34 2002/10/27 22:34:11 ray Exp $
// $Id: ChatDirector.java,v 1.35 2002/10/28 00:22:38 ray Exp $
package com.threerings.crowd.chat;
@@ -145,11 +145,18 @@ public class ChatDirector extends BasicDirector
_chatters.removeLast();
}
for (Iterator iter = _chatterObservers.iterator();
iter.hasNext(); ) {
ChatterObserver co = (ChatterObserver) iter.next();
co.chattersUpdated(_chatters.listIterator());
}
notifyChatterObservers();
}
}
/**
* Notify ChatterObservers that the list of chatters has changed.
*/
protected void notifyChatterObservers ()
{
for (int ii=0, nn=_chatterObservers.size(); ii < nn; ii++) {
ChatterObserver co = (ChatterObserver) _chatterObservers.get(ii);
co.chattersUpdated(_chatters.listIterator());
}
}
@@ -528,6 +535,16 @@ public class ChatDirector extends BasicDirector
super.clientDidLogoff(client);
clearDisplays(true);
// clear out the list of people we've chatted with
_chatters.clear();
notifyChatterObservers();
// clear the _place
locationDidChange(null);
// clear our service
_cservice = null;
}
/** Our active chat context. */
@@ -1,5 +1,5 @@
//
// $Id: MuteDirector.java,v 1.3 2002/10/25 20:32:41 ray Exp $
// $Id: MuteDirector.java,v 1.4 2002/10/28 00:22:38 ray Exp $
package com.threerings.crowd.chat;
@@ -8,12 +8,15 @@ import java.util.HashSet;
import com.threerings.crowd.util.CrowdContext;
import com.threerings.presents.client.BasicDirector;
import com.threerings.presents.client.Client;
/**
* Manages the mutelist.
*
* TODO: This class right now is pretty much just a placeholder.
*/
public class MuteDirector
public class MuteDirector extends BasicDirector
implements ChatValidator
{
/**
@@ -33,7 +36,7 @@ public class MuteDirector
*/
public MuteDirector (CrowdContext ctx)
{
// nothing to initialize right now
super(ctx);
}
/**
@@ -111,6 +114,15 @@ public class MuteDirector
}
}
// documentation inherited
public void clientDidLogoff (Client client)
{
super.clientDidLogoff(client);
// clear the mutelist, don't notify..
_mutelist.clear();
}
/** The chat director that we're working hard for. */
protected ChatDirector _chatdir;