Allow client code to detect whether or not the client is connected, since isLoggedOn returns true during the dispatch of CLIENT_DID_LOGOFF. This will allow msoy to prevent the display of room change popups when the client is disconnected.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5790 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -234,6 +234,15 @@ public class Client extends EventDispatcher
|
|||||||
return (_clobj != null);
|
return (_clobj != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detects if the client is currently connected to the server. This can sometimes return false
|
||||||
|
* even though <code>isLoggedOn</code> returns true.
|
||||||
|
*/
|
||||||
|
public function isConnected () :Boolean
|
||||||
|
{
|
||||||
|
return _comm != null && _comm.isConnected();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Requests that this client connect and logon to the server with which it was previously
|
* Requests that this client connect and logon to the server with which it was previously
|
||||||
* configured.
|
* configured.
|
||||||
|
|||||||
@@ -85,6 +85,16 @@ public class Communicator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detects if the communicator currently has an open channel to the server. This is guaranteed
|
||||||
|
* to return false while the logoff event is being dispatched. It also returns true during
|
||||||
|
* authentication, but prior to the client appearing to be logged on.
|
||||||
|
*/
|
||||||
|
public function isConnected () :Boolean
|
||||||
|
{
|
||||||
|
return _writer != null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to logon on using the port at the specified index.
|
* Attempts to logon on using the port at the specified index.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user