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:
@@ -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;
|
package com.threerings.crowd.client;
|
||||||
|
|
||||||
@@ -112,6 +112,12 @@ public class LocationDirector extends BasicDirector
|
|||||||
*/
|
*/
|
||||||
public boolean moveTo (int placeId)
|
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
|
// first check to see if our observers are happy with this move
|
||||||
// request
|
// request
|
||||||
if (!mayMoveTo(placeId, null)) {
|
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;
|
package com.threerings.whirled.client;
|
||||||
|
|
||||||
@@ -94,6 +94,12 @@ public class SceneDirector extends BasicDirector
|
|||||||
*/
|
*/
|
||||||
public boolean moveTo (int sceneId)
|
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
|
// sanity-check the destination scene id
|
||||||
if (sceneId == _sceneId) {
|
if (sceneId == _sceneId) {
|
||||||
Log.warning("Refusing request to move to the same scene " +
|
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;
|
package com.threerings.whirled.zone.client;
|
||||||
|
|
||||||
@@ -94,6 +94,13 @@ public class ZoneDirector extends BasicDirector
|
|||||||
*/
|
*/
|
||||||
public boolean moveTo (int zoneId, int sceneId, ResultListener rl)
|
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
|
// if the requested zone is the same as our current zone, we just
|
||||||
// want a regular old moveTo request
|
// want a regular old moveTo request
|
||||||
if (_summary != null && zoneId == _summary.zoneId) {
|
if (_summary != null && zoneId == _summary.zoneId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user