Refuse moves to invalid zones, scenes or places.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2819 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-10-03 20:41:32 +00:00
parent 567d3696a9
commit b032f51b84
3 changed files with 22 additions and 3 deletions
@@ -1,5 +1,5 @@
//
// $Id: LocationDirector.java,v 1.30 2003/06/14 00:47:16 mdb Exp $
// $Id: LocationDirector.java,v 1.31 2003/10/03 20:41:31 mdb Exp $
package com.threerings.crowd.client;
@@ -112,6 +112,12 @@ public class LocationDirector extends BasicDirector
*/
public boolean moveTo (int placeId)
{
// make sure the placeId is valid
if (placeId < 0) {
Log.warning("Refusing moveTo(): invalid placeId " + placeId + ".");
return false;
}
// first check to see if our observers are happy with this move
// request
if (!mayMoveTo(placeId, null)) {
@@ -1,5 +1,5 @@
//
// $Id: SceneDirector.java,v 1.24 2003/02/12 07:23:30 mdb Exp $
// $Id: SceneDirector.java,v 1.25 2003/10/03 20:41:31 mdb Exp $
package com.threerings.whirled.client;
@@ -94,6 +94,12 @@ public class SceneDirector extends BasicDirector
*/
public boolean moveTo (int sceneId)
{
// make sure the sceneId is valid
if (sceneId < 0) {
Log.warning("Refusing moveTo(): invalid sceneId " + sceneId + ".");
return false;
}
// sanity-check the destination scene id
if (sceneId == _sceneId) {
Log.warning("Refusing request to move to the same scene " +
@@ -1,5 +1,5 @@
//
// $Id: ZoneDirector.java,v 1.14 2003/02/12 07:23:32 mdb Exp $
// $Id: ZoneDirector.java,v 1.15 2003/10/03 20:41:32 mdb Exp $
package com.threerings.whirled.zone.client;
@@ -94,6 +94,13 @@ public class ZoneDirector extends BasicDirector
*/
public boolean moveTo (int zoneId, int sceneId, ResultListener rl)
{
// make sure the zoneId and sceneId are valid
if (zoneId < 0 || sceneId < 0) {
Log.warning("Refusing moveTo(): invalid sceneId or zoneId " +
"[zoneId=" + zoneId + ", sceneId=" + sceneId + "].");
return false;
}
// if the requested zone is the same as our current zone, we just
// want a regular old moveTo request
if (_summary != null && zoneId == _summary.zoneId) {