The Client's ClientObject is not necessarily the body anymore.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@1030 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
package com.threerings.whirled.spot.client {
|
package com.threerings.whirled.spot.client {
|
||||||
|
import com.threerings.crowd.client.CrowdClient;
|
||||||
import com.threerings.util.Log;
|
import com.threerings.util.Log;
|
||||||
import com.threerings.util.ResultListener;
|
import com.threerings.util.ResultListener;
|
||||||
|
|
||||||
@@ -127,8 +127,7 @@ public class SpotSceneDirector extends BasicDirector
|
|||||||
|
|
||||||
// sanity check the server's notion of what scene we're in with our notion of it
|
// sanity check the server's notion of what scene we're in with our notion of it
|
||||||
var sceneId :int = _scdir.getScene().getId();
|
var sceneId :int = _scdir.getScene().getId();
|
||||||
var clSceneId :int = ScenePlace.getSceneId(
|
var clSceneId :int = ScenePlace.getSceneId(CrowdClient(_wctx.getClient()).bodyOf());
|
||||||
_wctx.getClient().getClientObject() as BodyObject);
|
|
||||||
if (sceneId != clSceneId) {
|
if (sceneId != clSceneId) {
|
||||||
log.warning("Client and server differ in opinion of what scene we're in " +
|
log.warning("Client and server differ in opinion of what scene we're in " +
|
||||||
"[sSceneId=" + clSceneId + ", cSceneId=" + sceneId + "].");
|
"[sSceneId=" + clSceneId + ", cSceneId=" + sceneId + "].");
|
||||||
@@ -334,11 +333,11 @@ public class SpotSceneDirector extends BasicDirector
|
|||||||
{
|
{
|
||||||
super.clientDidLogon(event);
|
super.clientDidLogon(event);
|
||||||
|
|
||||||
var clientObj :ClientObject = event.getClient().getClientObject();
|
var body :BodyObject = CrowdClient(event.getClient()).bodyOf();
|
||||||
if (clientObj is ClusteredBodyObject) {
|
if (body is ClusteredBodyObject) {
|
||||||
// listen to the client object
|
// listen to the body
|
||||||
clientObj.addListener(this);
|
body.addListener(this);
|
||||||
_self = (clientObj as ClusteredBodyObject);
|
_self = (body as ClusteredBodyObject);
|
||||||
|
|
||||||
// we may need to subscribe to a cluster due to session resumption
|
// we may need to subscribe to a cluster due to session resumption
|
||||||
maybeUpdateCluster();
|
maybeUpdateCluster();
|
||||||
@@ -350,10 +349,12 @@ public class SpotSceneDirector extends BasicDirector
|
|||||||
{
|
{
|
||||||
super.clientObjectDidChange(event);
|
super.clientObjectDidChange(event);
|
||||||
|
|
||||||
// listen to the client object
|
var body :BodyObject = CrowdClient(event.getClient()).bodyOf();
|
||||||
var clientObj :ClientObject = event.getClient().getClientObject();
|
if (body is ClusteredBodyObject) {
|
||||||
clientObj.addListener(this);
|
// listen to the body
|
||||||
_self = (clientObj as ClusteredBodyObject);
|
body.addListener(this);
|
||||||
|
_self = (body as ClusteredBodyObject);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
@@ -367,10 +368,9 @@ public class SpotSceneDirector extends BasicDirector
|
|||||||
_sservice = null;
|
_sservice = null;
|
||||||
clearCluster(true);
|
clearCluster(true);
|
||||||
|
|
||||||
// stop listening to the client object
|
var body :BodyObject = CrowdClient(event.getClient()).bodyOf();
|
||||||
var clientObj :ClientObject = event.getClient().getClientObject();
|
if (body is ClusteredBodyObject) {
|
||||||
if (clientObj != null) {
|
body.removeListener(this);
|
||||||
clientObj.removeListener(this);
|
|
||||||
}
|
}
|
||||||
_self = null;
|
_self = null;
|
||||||
}
|
}
|
||||||
@@ -391,7 +391,7 @@ public class SpotSceneDirector extends BasicDirector
|
|||||||
var ssobj :SpotSceneObject = (plobj as SpotSceneObject);
|
var ssobj :SpotSceneObject = (plobj as SpotSceneObject);
|
||||||
if (ssobj != null) {
|
if (ssobj != null) {
|
||||||
scloc = ssobj.occupantLocs.get(
|
scloc = ssobj.occupantLocs.get(
|
||||||
_wctx.getClient().getClientObject().getOid()) as SceneLocation;
|
CrowdClient(_wctx.getClient()).bodyOf().getOid()) as SceneLocation;
|
||||||
}
|
}
|
||||||
_location = (scloc == null) ? null : scloc.loc;
|
_location = (scloc == null) ? null : scloc.loc;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user