Added facility for enumerating the body objects for all active users on
the server. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1274 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
//
|
//
|
||||||
// $Id: CrowdServer.java,v 1.11 2002/03/28 22:32:31 mdb Exp $
|
// $Id: CrowdServer.java,v 1.12 2002/04/18 00:44:50 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.crowd.server;
|
package com.threerings.crowd.server;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.threerings.presents.server.PresentsServer;
|
import com.threerings.presents.server.PresentsServer;
|
||||||
|
|
||||||
@@ -48,6 +48,17 @@ public class CrowdServer extends PresentsServer
|
|||||||
Log.info("Crowd server initialized.");
|
Log.info("Crowd server initialized.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enumerates the body objects for all active users on the server.
|
||||||
|
* This should only be called from the dobjmgr thread. The caller had
|
||||||
|
* best be certain they know what they're doing, since this should
|
||||||
|
* only be necessary for use in rather special circumstances.
|
||||||
|
*/
|
||||||
|
public static Iterator enumerateBodies ()
|
||||||
|
{
|
||||||
|
return clmgr.enumerateClientObjects();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The server maintains a mapping of username to body object for all
|
* The server maintains a mapping of username to body object for all
|
||||||
* active users on the server. This should only be called from the
|
* active users on the server. This should only be called from the
|
||||||
@@ -70,9 +81,6 @@ public class CrowdServer extends PresentsServer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** We use this to map usernames to body objects. */
|
|
||||||
protected static HashMap _bodymap = new HashMap();
|
|
||||||
|
|
||||||
/** The config key for our list of invocation provider mappings. */
|
/** The config key for our list of invocation provider mappings. */
|
||||||
protected final static String PROVIDERS_KEY = "providers";
|
protected final static String PROVIDERS_KEY = "providers";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
//
|
//
|
||||||
// $Id: ClientManager.java,v 1.14 2002/03/05 05:33:25 mdb Exp $
|
// $Id: ClientManager.java,v 1.15 2002/04/18 00:44:50 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.presents.server;
|
package com.threerings.presents.server;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.threerings.presents.Log;
|
import com.threerings.presents.Log;
|
||||||
import com.threerings.presents.data.ClientObject;
|
import com.threerings.presents.data.ClientObject;
|
||||||
@@ -74,6 +75,14 @@ public class ClientManager implements ConnectionObserver
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enumerates all active client objects.
|
||||||
|
*/
|
||||||
|
public Iterator enumerateClientObjects ()
|
||||||
|
{
|
||||||
|
return _objmap.values().iterator();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the client object associated with the specified username.
|
* Returns the client object associated with the specified username.
|
||||||
* This will return null unless the client object is resolved for some
|
* This will return null unless the client object is resolved for some
|
||||||
|
|||||||
Reference in New Issue
Block a user