Tidy up name handling a bit more: when setUsername() is called on a

PresentsSession, we don't need to or want to change our auth name, we can and
should operate entirely on ClientObject.username. The ClientManager maintains
two mappings: "current username" -> ClientObject (which is what needs to change
when setUsername or updateUsername is called) and "authname" -> PresentsSession
which has always been just the authname and has never changed during the course
of a session.  PresentsSession.getUsername() goes away and
PresentsSession.getAuthName() always returns the name that was used to
authenticate the session.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5838 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2009-06-23 06:20:31 +00:00
parent 0df7b9681a
commit 7efa2c74a7
3 changed files with 19 additions and 19 deletions
@@ -878,7 +878,7 @@ public abstract class PeerManager
// we scan through the list instead of relying on ClientInfo.getKey() because we want
// derived classes to be able to override that for lookups that happen way more frequently
// than logging off
Name username = client.getUsername();
Name username = client.getAuthName();
for (ClientInfo clinfo : _nodeobj.clients) {
if (clinfo.username.equals(username)) {
_nodeobj.startTransaction();
@@ -1038,7 +1038,7 @@ public abstract class PeerManager
*/
protected void initClientInfo (PresentsSession client, ClientInfo info)
{
info.username = client.getUsername();
info.username = client.getAuthName();
}
/**