Disconnect the client side when we disconnect on the backend so that we don't

end up differing in opinion about whether or not we're connected.


git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@456 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2007-10-18 00:57:56 +00:00
parent 4e462ce974
commit 60b3eabc16
2 changed files with 10 additions and 0 deletions
@@ -613,6 +613,7 @@ public class EZGameControl extends BaseControl
*/ */
protected function populateProperties (o :Object) :void protected function populateProperties (o :Object) :void
{ {
o["connectionClosed_v1"] = connectionClosed_v1;
o["propertyWasSet_v1"] = propertyWasSet_v1; o["propertyWasSet_v1"] = propertyWasSet_v1;
o["controlDidChange_v1"] = controlDidChange_v1; o["controlDidChange_v1"] = controlDidChange_v1;
o["turnDidChange_v1"] = turnDidChange_v1; o["turnDidChange_v1"] = turnDidChange_v1;
@@ -624,6 +625,14 @@ public class EZGameControl extends BaseControl
o["userChat_v1"] = userChat_v1; o["userChat_v1"] = userChat_v1;
} }
/**
* Private method called when the backend disconnects from us.
*/
private function connectionClosed_v1 () :void
{
_gameData = null;
}
/** /**
* Private method to post a PropertyChangedEvent. * Private method to post a PropertyChangedEvent.
*/ */
@@ -129,6 +129,7 @@ public class GameControlBackend
_ctx.getChatDirector().removeChatDisplay(this); _ctx.getChatDirector().removeChatDisplay(this);
_ctx.getClient().getClientObject().removeListener(_userListener); _ctx.getClient().getClientObject().removeListener(_userListener);
_userFuncs = null; // disconnect _userFuncs = null; // disconnect
callUserCode("connectionClosed_v1");
} }
/** /**