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:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user