Extract client info clearing into a method that can be easily extended.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4775 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2007-07-18 21:35:54 +00:00
parent 20719ee3f1
commit 6531aa581c
@@ -546,7 +546,7 @@ public class PeerManager
Name username = client.getCredentials().getUsername();
for (ClientInfo clinfo : _nodeobj.clients) {
if (clinfo.username.equals(username)) {
_nodeobj.removeFromClients(clinfo.getKey());
clearClientInfo(client, clinfo);
return;
}
}
@@ -741,6 +741,14 @@ public class PeerManager
info.username = client.getCredentials().getUsername();
}
/**
* Called when a client ends their session to clear their information from our node object.
*/
protected void clearClientInfo (PresentsClient client, ClientInfo info)
{
_nodeobj.removeFromClients(info.getKey());
}
/**
* Creates a {@link PeerNode} to manage our connection to the specified peer.
*/