From 4c74d96eeecf2d57f5a784058b6d25855054a2de Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Sun, 30 Mar 2003 03:33:52 +0000 Subject: [PATCH] Add facilities for vetoing a start cluster request. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2353 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../whirled/spot/server/SpotSceneManager.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java b/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java index 5fb46be24..a2dbb3e95 100644 --- a/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java +++ b/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java @@ -1,5 +1,5 @@ // -// $Id: SpotSceneManager.java,v 1.37 2003/03/27 17:13:38 mdb Exp $ +// $Id: SpotSceneManager.java,v 1.38 2003/03/30 03:33:52 mdb Exp $ package com.threerings.whirled.spot.server; @@ -264,12 +264,28 @@ public class SpotSceneManager extends SceneManager return; } + // confirm that they can start a cluster with this unsuspecting + // other person + checkCanCluster(joiner, friend); + // otherwise we create a new cluster and add our charter members! clrec = new ClusterRecord(); clrec.addBody(friend); clrec.addBody(joiner); } + /** + * Gives derived classes an opportunity to veto a user's attempt to + * start a cluster with another user. If the attempt should be vetoed, + * this method should throw an {@link InvocationException} indicating + * the reason for veto. + */ + protected void checkCanCluster (BodyObject initiator, BodyObject target) + throws InvocationException + { + // nothing to do by default + } + /** * Removes the specified user from any cluster they occupy. */