Added basic hook for portal traversal access control.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2309 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-03-17 19:34:26 +00:00
parent 36bcb083ca
commit 0bddc6767f
2 changed files with 20 additions and 2 deletions
@@ -1,5 +1,5 @@
//
// $Id: SpotProvider.java,v 1.15 2003/02/12 07:23:31 mdb Exp $
// $Id: SpotProvider.java,v 1.16 2003/03/17 19:34:26 mdb Exp $
package com.threerings.whirled.spot.server;
@@ -77,6 +77,12 @@ public class SpotProvider
SpotScene rss = (SpotScene)smgr.getScene();
final Portal fdest = rss.getPortal(portalId);
// give the source scene manager a chance to do access control
String errmsg = smgr.mayTraversePortal(fsource, fdest);
if (errmsg != null) {
throw new InvocationException(errmsg);
}
// make sure this portal has valid info
if (fdest == null || !fdest.isValid()) {
Log.warning("Traverse portal with invalid portal " +
@@ -1,5 +1,5 @@
//
// $Id: SpotSceneManager.java,v 1.27 2003/02/14 21:34:26 mdb Exp $
// $Id: SpotSceneManager.java,v 1.28 2003/03/17 19:34:26 mdb Exp $
package com.threerings.whirled.spot.server;
@@ -82,6 +82,18 @@ public class SpotSceneManager extends SceneManager
_enterers.remove(body.getOid());
}
/**
* This is called when a user requests to traverse a portal from this
* scene to another scene. The manager may return an error code string
* that will be reported back to the caller explaining the failure or
* <code>null</code> indicating that it is OK for the caller to
* traverse the portal.
*/
public String mayTraversePortal (BodyObject body, Portal portal)
{
return null;
}
// documentation inherited
protected void didStartup ()
{