Don't start our tick interval until we've successfully logged on. There's no
utility in sending pings before we're authenticated. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5543 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -267,13 +267,6 @@ public class Client extends EventDispatcher
|
|||||||
_comm = new Communicator(this);
|
_comm = new Communicator(this);
|
||||||
callLater(_comm.logon);
|
callLater(_comm.logon);
|
||||||
|
|
||||||
// it is safe, however, to start up our tick interval immediately
|
|
||||||
if (_tickInterval == null) {
|
|
||||||
_tickInterval = new Timer(5000);
|
|
||||||
_tickInterval.addEventListener(TimerEvent.TIMER, tick);
|
|
||||||
_tickInterval.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,10 +313,12 @@ public class Client extends EventDispatcher
|
|||||||
if (abortable && !notifyObservers(ClientEvent.CLIENT_WILL_LOGOFF)) {
|
if (abortable && !notifyObservers(ClientEvent.CLIENT_WILL_LOGOFF)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_tickInterval.stop();
|
if (_tickInterval != null) {
|
||||||
_tickInterval = null;
|
_tickInterval.stop();
|
||||||
|
_tickInterval = null;
|
||||||
|
}
|
||||||
|
|
||||||
_comm.logoff();
|
_comm.logoff();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -372,7 +367,16 @@ public class Client extends EventDispatcher
|
|||||||
*/
|
*/
|
||||||
public function gotClientObject (clobj :ClientObject) :void
|
public function gotClientObject (clobj :ClientObject) :void
|
||||||
{
|
{
|
||||||
|
// keep our client object around
|
||||||
_clobj = clobj;
|
_clobj = clobj;
|
||||||
|
|
||||||
|
// and start up our tick interval (which will send pings when necessary)
|
||||||
|
if (_tickInterval == null) {
|
||||||
|
_tickInterval = new Timer(5000);
|
||||||
|
_tickInterval.addEventListener(TimerEvent.TIMER, tick);
|
||||||
|
_tickInterval.start();
|
||||||
|
}
|
||||||
|
|
||||||
notifyObservers(ClientEvent.CLIENT_DID_LOGON);
|
notifyObservers(ClientEvent.CLIENT_DID_LOGON);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user