More session type reporting.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5630 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2009-01-10 19:04:12 +00:00
parent 4e980867cf
commit d273a550fa
@@ -369,8 +369,7 @@ public class ClientManager
{ {
Credentials creds = req.getCredentials(); Credentials creds = req.getCredentials();
Name username = creds.getUsername(); Name username = creds.getUsername();
String type = username.getClass().getName(); String type = username.getClass().getSimpleName();
type = type.substring(type.lastIndexOf(".")+1);
// see if a client is already registered with these credentials // see if a client is already registered with these credentials
PresentsSession client = getClient(username); PresentsSession client = getClient(username);
@@ -380,7 +379,7 @@ public class ClientManager
client.resumeSession(req, conn); client.resumeSession(req, conn);
} else { } else {
log.info("Session initiated", "who", username, "conn", conn); log.info("Session initiated", "type", type, "who", username, "conn", conn);
// create a new client and stick'em in the table // create a new client and stick'em in the table
client = _injector.getInstance(_factory.getSessionClass(req)); client = _injector.getInstance(_factory.getSessionClass(req));
client.startSession(req, conn, rsp.authdata); client.startSession(req, conn, rsp.authdata);
@@ -465,10 +464,11 @@ public class ClientManager
* Called by the client instance when the client requests a logoff. This is called from the * Called by the client instance when the client requests a logoff. This is called from the
* dobjmgr thread. * dobjmgr thread.
*/ */
protected void clientSessionDidEnd (final PresentsSession client) protected void clientSessionDidEnd (final PresentsSession session)
{ {
// remove the client from the username map // remove the client from the username map
Name username = client.getCredentials().getUsername(); Name username = session.getCredentials().getUsername();
String type = username.getClass().getSimpleName();
PresentsSession rc; PresentsSession rc;
synchronized (_usermap) { synchronized (_usermap) {
rc = _usermap.remove(username); rc = _usermap.remove(username);
@@ -476,18 +476,18 @@ public class ClientManager
// sanity check just because we can // sanity check just because we can
if (rc == null) { if (rc == null) {
log.warning("Unregistered client ended session", "username", username, "client", client, log.warning("Unregistered client ended session", "type", type, "who", username,
new Exception()); "session", session, new Exception());
} else if (rc != client) { } else if (rc != session) {
log.warning("Different clients with same username!?", "c1", rc, "c2", client); log.warning("Different clients with same username!?", "c1", rc, "c2", session);
} else { } else {
log.info("Ending session", "username", username, "client", client); log.info("Ending session", "type", type, "who", username, "session", session);
} }
// notify the observers that the session is ended // notify the observers that the session is ended
_clobservers.apply(new ObserverList.ObserverOp<ClientObserver>() { _clobservers.apply(new ObserverList.ObserverOp<ClientObserver>() {
public boolean apply (ClientObserver observer) { public boolean apply (ClientObserver observer) {
observer.clientSessionDidEnd(client); observer.clientSessionDidEnd(session);
return true; return true;
} }
}); });