Package | net.user1.reactor |
Class | public class ClientManagerEvent |
Inheritance | ClientManagerEvent ![]() |
Since : | Reactor 1.0.0 |
ClientManagerEvent is a simple data class used to pass information from an application's ClientManager to registered event-listeners when a client-management event occurs. The ClientManagerEvent class also defines constants representing the available client-management events.
To register for a client-management event, use ClientManager's addEventListener() method, as shown in the following code:
var clientMan:ClientManager = reactor.getClientManager(); clientMan.addEventListener(ClientManagerEvent.CLIENT_CONNECTED, clientConnectedListener);
See also
Method | Defined By | ||
---|---|---|---|
ClientManagerEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, clientID:String = null, client:IClient = null, address:String = null, status:String = null)
Constructor. | ClientManagerEvent | ||
clone():Event [override] | ClientManagerEvent | ||
getAddress():String
Returns an address that was either banned or unbanned. | ClientManagerEvent | ||
Returns the Client object for the client to which this event pertains. | ClientManagerEvent | ||
getClientID():String
Returns the clientID of the client to which this event pertains. | ClientManagerEvent | ||
getStatus():String
Returns the status of the client-management operation to which this
event pertains. | ClientManagerEvent | ||
toString():String [override] | ClientManagerEvent |
Constant | Defined By | ||
---|---|---|---|
ADDRESS_BANNED : String = ADDRESS_BANNED [static]
Dispatched when the ClientManager is informed by Union Server that a
client address was banned. | ClientManagerEvent | ||
ADDRESS_UNBANNED : String = ADDRESS_UNBANNED [static]
Dispatched when the ClientManager is informed by Union Server that a
client address was unbanned. | ClientManagerEvent | ||
BAN_RESULT : String = BAN_RESULT [static]
Dispatched when the result of an earlier Client.ban()
or ClientManager.ban() request is received. | ClientManagerEvent | ||
CLIENT_CONNECTED : String = CLIENT_CONNECTED [static]
Dispatched when the ClientManager is informed by Union Server that a
client connected. | ClientManagerEvent | ||
CLIENT_DISCONNECTED : String = CLIENT_DISCONNECTED [static]
Dispatched when the ClientManager is informed by Union Server that a
client disconnected. | ClientManagerEvent | ||
KICK_RESULT : String = KICK_RESULT [static]
Dispatched when the result of an earlier Client.kick()
or ClientManager.kickClient() request is received. | ClientManagerEvent | ||
STOP_WATCHING_FOR_BANNED_ADDRESSES_RESULT : String = STOP_WATCHING_FOR_BANNED_ADDRESSES_RESULT [static]
Dispatched when the result of an earlier call to
ClientManager.stopWatchingForBannedAddresses() is received. | ClientManagerEvent | ||
STOP_WATCHING_FOR_CLIENTS_RESULT : String = STOP_WATCHING_FOR_CLIENTS_RESULT [static]
Dispatched when the ClientManager receives the result of an earlier
stopWatchingForClients() request. | ClientManagerEvent | ||
SYNCHRONIZE : String = SYNCHRONIZE [static]
Dispatched when the ClientManager's list of clients has finished
being synchronized after a watchForClients() request. | ClientManagerEvent | ||
SYNCHRONIZE_BANLIST : String = SYNCHRONIZE_BANLIST [static]
Dispatched when the ClientManager's list of clients has finished
being synchronized after a watchForBannedAddresses() request. | ClientManagerEvent | ||
UNBAN_RESULT : String = UNBAN_RESULT [static]
Dispatched when the result of an earlier ClientManager.unban() request
is received. | ClientManagerEvent | ||
WATCH_FOR_BANNED_ADDRESSES_RESULT : String = WATCH_FOR_BANNED_ADDRESSES_RESULT [static]
Dispatched when the result of an earlier call to
ClientManager.watchForBannedAddresses() is received. | ClientManagerEvent | ||
WATCH_FOR_CLIENTS_RESULT : String = WATCH_FOR_CLIENTS_RESULT [static]
Dispatched when the ClientManager receives the result of an earlier
watchForClients() request. | ClientManagerEvent |
ClientManagerEvent | () | Constructor |
public function ClientManagerEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, clientID:String = null, client:IClient = null, address:String = null, status:String = null)
Constructor.
Parameterstype:String | |
bubbles:Boolean (default = false )
| |
cancelable:Boolean (default = false )
| |
clientID:String (default = null )
| |
client:IClient (default = null )
| |
address:String (default = null )
| |
status:String (default = null )
|
clone | () | method |
override public function clone():Event
ReturnsEvent |
getAddress | () | method |
public function getAddress():String
Since : | Reactor 1.0.0 |
Returns an address that was either banned or unbanned. This method applies to the following events:
String |
getClient | () | method |
public function getClient():IClient
Since : | Reactor 1.0.0 |
Returns the Client object for the client to which this event pertains. For example, for the ClientManagerEvent.CLIENT_DISCONNECTED event, getClient() returns the IClient object for the client that disconnected.
ReturnsIClient |
getClientID | () | method |
public function getClientID():String
Since : | Reactor 1.0.0 |
Returns the clientID of the client to which this event pertains. For example, for the ClientManagerEvent.CLIENT_CONNECTED event, getClientID() returns the clientID of the client that connected.
ReturnsString |
getStatus | () | method |
public function getStatus():String
Since : | Reactor 1.0.0 |
Returns the status of the client-management operation to which this event pertains. The getStatus() method's return value is always one of the Status class's constants. For example, getStatus() might return the value of Status.SUCCESS. For a list of specific status values that are available for a particular ClientManagerEvent event, see that event's documentation.
ReturnsString |
toString | () | method |
override public function toString():String
ReturnsString |
ADDRESS_BANNED | Constant |
public static const ADDRESS_BANNED:String = ADDRESS_BANNED
Since : | Reactor 1.0.0 |
Dispatched when the ClientManager is informed by Union Server that a client address was banned. This event is available when the ClientManager is watching for banned addresses only (see watchForBannedAddresses()).
See also
ADDRESS_UNBANNED | Constant |
public static const ADDRESS_UNBANNED:String = ADDRESS_UNBANNED
Since : | Reactor 1.0.0 |
Dispatched when the ClientManager is informed by Union Server that a client address was unbanned. This event is available when the ClientManager is watching for banned addresses only (see watchForBannedAddresses()).
See also
BAN_RESULT | Constant |
public static const BAN_RESULT:String = BAN_RESULT
Since : | Reactor 1.0.0 |
Dispatched when the result of an earlier Client.ban() or ClientManager.ban() request is received.
See also
CLIENT_CONNECTED | Constant |
public static const CLIENT_CONNECTED:String = CLIENT_CONNECTED
Since : | Reactor 1.0.0 |
Dispatched when the ClientManager is informed by Union Server that a client connected. This event is available when the ClientManager is watching for clients only (see watchForClients()).
See also
CLIENT_DISCONNECTED | Constant |
public static const CLIENT_DISCONNECTED:String = CLIENT_DISCONNECTED
Since : | Reactor 1.0.0 |
Dispatched when the ClientManager is informed by Union Server that a client disconnected. This event is available when the ClientManager is watching for clients (see watchForClients()) or observing the client that disconnected (see observeClient()) only.
See also
KICK_RESULT | Constant |
public static const KICK_RESULT:String = KICK_RESULT
Since : | Reactor 1.0.0 |
Dispatched when the result of an earlier Client.kick() or ClientManager.kickClient() request is received.
See also
STOP_WATCHING_FOR_BANNED_ADDRESSES_RESULT | Constant |
public static const STOP_WATCHING_FOR_BANNED_ADDRESSES_RESULT:String = STOP_WATCHING_FOR_BANNED_ADDRESSES_RESULT
Since : | Reactor 1.0.0 |
Dispatched when the result of an earlier call to ClientManager.stopWatchingForBannedAddresses() is received.
See also
STOP_WATCHING_FOR_CLIENTS_RESULT | Constant |
public static const STOP_WATCHING_FOR_CLIENTS_RESULT:String = STOP_WATCHING_FOR_CLIENTS_RESULT
Since : | Reactor 1.0.0 |
Dispatched when the ClientManager receives the result of an earlier stopWatchingForClients() request. To determine the result of the attempt, use getStatus(), which has the following possible return values:
See also
SYNCHRONIZE | Constant |
public static const SYNCHRONIZE:String = SYNCHRONIZE
Since : | Reactor 1.0.0 |
Dispatched when the ClientManager's list of clients has finished being synchronized after a watchForClients() request.
See also
SYNCHRONIZE_BANLIST | Constant |
public static const SYNCHRONIZE_BANLIST:String = SYNCHRONIZE_BANLIST
Since : | Reactor 1.0.0 |
Dispatched when the ClientManager's list of clients has finished being synchronized after a watchForBannedAddresses() request.
See also
UNBAN_RESULT | Constant |
public static const UNBAN_RESULT:String = UNBAN_RESULT
Since : | Reactor 1.0.0 |
Dispatched when the result of an earlier ClientManager.unban() request is received.
See also
WATCH_FOR_BANNED_ADDRESSES_RESULT | Constant |
public static const WATCH_FOR_BANNED_ADDRESSES_RESULT:String = WATCH_FOR_BANNED_ADDRESSES_RESULT
Since : | Reactor 1.0.0 |
Dispatched when the result of an earlier call to ClientManager.watchForBannedAddresses() is received.
See also
WATCH_FOR_CLIENTS_RESULT | Constant |
public static const WATCH_FOR_CLIENTS_RESULT:String = WATCH_FOR_CLIENTS_RESULT
Since : | Reactor 1.0.0 |
Dispatched when the ClientManager receives the result of an earlier watchForClients() request. To determine the result of the request, use getStatus(), which has the following possible return values:
See also
var clientMan:ClientManager = reactor.getClientManager(); clientMan.addEventListener(ClientManagerEvent.WATCH_FOR_CLIENTS_RESULT, watchForClientsResultListener); private function watchForClientsResultListener (e:ClientManagerEvent):void { if (e.getStatus() != Status.SUCCESS) { displayError(); // displayError() code not shown } }