Add Zone handling to vilya's actionscript side to go with scene handling. Also, handle SceneDirector's forcedMove in the same way the java side does in the face of already pending moves.

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@910 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Mike Thomas
2010-05-25 20:46:23 +00:00
parent 42fd385710
commit a996cf60c8
7 changed files with 460 additions and 5 deletions
@@ -173,7 +173,7 @@ public class SceneDirector extends BasicDirector
var refuse :Boolean = _locdir.checkRepeatMove();
// complain if we're over-writing a pending request
if (_pendingData != null) {
if (movePending()) {
if (refuse) {
log.warning("Refusing moveTo; We have a request outstanding",
"psid", _pendingData.sceneId, "nsid", sceneId);
@@ -383,9 +383,26 @@ public class SceneDirector extends BasicDirector
clearScene();
}
/**
* Returns true if there is a pending move request.
*/
public function movePending () :Boolean
{
return (_pendingData != null);
}
// documentation inherited from interface
public function forcedMove (sceneId :int) :void
{
// if we're in the middle of a move, we can't abort it or we will screw everything up, so
// just finish up what we're doing and assume that the repeated move request was the
// spurious one as it would be in the case of lag causing rapid-fire repeat requests
if (movePending()) {
log.info("Dropping forced move because we have a move pending",
"pendId", _pendingData.sceneId, "reqId", sceneId);
return;
}
log.info("Moving at request of server", "sceneId", sceneId);
// clear out our old scene and place data