From 60b3eabc16a915ef5d7d079b188a08bfc4caa8ca Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 18 Oct 2007 00:57:56 +0000 Subject: [PATCH] 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 --- src/as/com/threerings/ezgame/EZGameControl.as | 9 +++++++++ .../com/threerings/ezgame/client/GameControlBackend.as | 1 + 2 files changed, 10 insertions(+) diff --git a/src/as/com/threerings/ezgame/EZGameControl.as b/src/as/com/threerings/ezgame/EZGameControl.as index 789ef754..05ddcb8c 100644 --- a/src/as/com/threerings/ezgame/EZGameControl.as +++ b/src/as/com/threerings/ezgame/EZGameControl.as @@ -613,6 +613,7 @@ public class EZGameControl extends BaseControl */ protected function populateProperties (o :Object) :void { + o["connectionClosed_v1"] = connectionClosed_v1; o["propertyWasSet_v1"] = propertyWasSet_v1; o["controlDidChange_v1"] = controlDidChange_v1; o["turnDidChange_v1"] = turnDidChange_v1; @@ -624,6 +625,14 @@ public class EZGameControl extends BaseControl 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. */ diff --git a/src/as/com/threerings/ezgame/client/GameControlBackend.as b/src/as/com/threerings/ezgame/client/GameControlBackend.as index cb6e193d..88218549 100644 --- a/src/as/com/threerings/ezgame/client/GameControlBackend.as +++ b/src/as/com/threerings/ezgame/client/GameControlBackend.as @@ -129,6 +129,7 @@ public class GameControlBackend _ctx.getChatDirector().removeChatDisplay(this); _ctx.getClient().getClientObject().removeListener(_userListener); _userFuncs = null; // disconnect + callUserCode("connectionClosed_v1"); } /**