Packagenet.user1.reactor
Classpublic class ClientManagerEvent
InheritanceClientManagerEvent Inheritance flash.events.Event

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);
   

View the examples

See also

ClientManager
ClientManager.addEventListener()


Public Methods
 MethodDefined 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
Public Constants
 ConstantDefined 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
Constructor Description
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.

Parameters
type: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)
Method Descriptions
clone()method
override public function clone():Event

Returns
Event
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:

Returns
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.

Returns
IClient
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.

Returns
String
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.

Returns
String
toString()method 
override public function toString():String

Returns
String
Constant Descriptions
ADDRESS_BANNEDConstant
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_UNBANNEDConstant 
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_RESULTConstant 
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_CONNECTEDConstant 
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_DISCONNECTEDConstant 
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_RESULTConstant 
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_RESULTConstant 
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_RESULTConstant 
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

SYNCHRONIZEConstant 
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_BANLISTConstant 
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_RESULTConstant 
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_RESULTConstant 
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_RESULTConstant 
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

Examples
The following code shows a ClientManagerEvent.WATCH_FOR_CLIENTS_RESULT listener that uses getStatus() to determine whether an earlier watchForClients() call succeeded.
   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
     }
   }