Give bureau sessions their own classes, and use it react immediately to disconnects. When a Thane instance dies, we want the game to shut down immediately. There's no going back from that.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5662 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Par Winzell
2009-02-20 21:41:56 +00:00
parent ba7a7af8d3
commit fe357a5099
2 changed files with 37 additions and 2 deletions
@@ -0,0 +1,36 @@
//
// $Id: $
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2007 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/narya/
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.threerings.bureau.server;
import com.threerings.presents.server.PresentsSession;
public class BureauSession extends PresentsSession
{
@Override // from PresentsSession
protected void sessionConnectionClosed ()
{
super.sessionConnectionClosed();
// end our session when the connection is closed
endSession();
}
}
@@ -47,9 +47,8 @@ public class BureauSessionFactory implements SessionFactory
public Class<? extends PresentsSession> getSessionClass (AuthRequest areq)
{
// Just give bureaus a vanilla PresentsSession client for now.
// TODO: will bureaus need a more tailored client?
if (areq.getCredentials() instanceof BureauCredentials) {
return PresentsSession.class;
return BureauSession.class;
} else {
return _delegate.getSessionClass(areq);
}