- Monitor logins to other nodes, boot any local sessions with the same

authentication name.
- Use new (ca. 2002) pattern of creating an overridable listener,
rather than making the whole class a listener.

Mdb told me to add this at the msoy level, but I think it belongs here.
Presents simply expects a user to be in one place.

It also occurs to me that we probably want something more sophisticated:
there may be unpersisted data connected to the session that should
be flushed prior to the session starting on another node. We may
want something like a lock when users log-in, so that other nodes
can terminate the session and flush any persistent data FIRST.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5635 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2009-01-15 23:19:02 +00:00
parent 9d28bdbeef
commit b2b8f57454
2 changed files with 104 additions and 45 deletions
@@ -984,6 +984,19 @@ public abstract class PeerManager
return new PeerCreds(_nodeName, _sharedSecret);
}
/**
* Called when we hear about a client logging on to another node.
*/
protected void clientLoggedOnOtherNode (String nodeName, ClientInfo clinfo)
{
PresentsSession session = _clmgr.getClient(clinfo.username);
if (session != null) {
log.info("Booting user that has connected on another node",
"username", clinfo.username, "otherNode", nodeName);
session.endSession();
}
}
/**
* Called when a peer connects to this server.
*/