From 9abf440dde082119f763d1d618ba66872f3e7f68 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 2 May 2002 21:19:28 +0000 Subject: [PATCH] If the client asks to move to the location they're already in, just go along with them rather than sticking a fork in the program. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1325 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../crowd/server/LocationProvider.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/java/com/threerings/crowd/server/LocationProvider.java b/src/java/com/threerings/crowd/server/LocationProvider.java index 02083bec3..f6d313c5c 100644 --- a/src/java/com/threerings/crowd/server/LocationProvider.java +++ b/src/java/com/threerings/crowd/server/LocationProvider.java @@ -1,5 +1,5 @@ // -// $Id: LocationProvider.java,v 1.12 2002/04/15 16:28:01 shaper Exp $ +// $Id: LocationProvider.java,v 1.13 2002/05/02 21:19:28 mdb Exp $ package com.threerings.crowd.server; @@ -80,6 +80,16 @@ public class LocationProvider throw new ServiceFailedException(NO_SUCH_PLACE); } + // if they're already in the location they're asking to move to, + // just give them the config because we don't need to update + // anything in distributed object world + if (source.location == placeId) { + Log.info("Going along with client request to move to where " + + "they already are [source=" + source.username + + ", placeId=" + placeId + "]."); + return pmgr.getConfig(); + } + // acquire a lock on the body object to ensure that rapid fire // moveto requests don't break things if (!source.acquireLock("moveToLock")) { @@ -88,12 +98,6 @@ public class LocationProvider throw new ServiceFailedException(MOVE_IN_PROGRESS); } - // make sure they're not already in the location they're asking to - // move to - if (source.location == placeId) { - throw new ServiceFailedException(ALREADY_THERE); - } - // find out if they were previously in some other location if (source.location != -1) { // remove them from the occupant list of the previous location