| Package | com.electrotank.electroserver4.message.event |
| Class | public class ConnectionEvent |
| Inheritance | ConnectionEvent EventImpl MessageImpl |
import com.electrotank.electroserver4.ElectroServer;
import com.electrotank.electroserver4.message.MessageType;
import com.electrotank.electroserver4.message.event.ConnectionEvent;
//
var es:ElectroServer;
es.addEventListener(MessageType.ConnectionEvent, "onConnectionEvent", this);
function onConnectionEvent(e:ConnectionEvent):void {
trace("connection established: "+e.getAccepted());
}
| Property | Defined by | ||
|---|---|---|---|
| success : Boolean [read-only]
Returns true if the connection was a success.
| ConnectionEvent | ||
![]() | target : Object | MessageImpl | |
![]() | type : String | MessageImpl | |
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new instance of the ConnectionEvent class.
| ConnectionEvent | ||
|
getAccepted():Boolean
Returns true if the connection was a success.
| ConnectionEvent | ||
|
getBase():String
Gets the base.
| ConnectionEvent | ||
|
Gets the EsError.
| ConnectionEvent | ||
|
getHashId():int
| ConnectionEvent | ||
![]() |
getIsRealServerMessage():Boolean
Used internally when one client-request needs to be remapped to a server request.
| MessageImpl | |
![]() |
getMessageId():Number
The id of the message.
| MessageImpl | |
![]() |
The type of message being used.
| MessageImpl | |
|
getPrime():String
Gets the prime.
| ConnectionEvent | ||
![]() |
If this is not a real message, then get it.
| MessageImpl | |
|
setHashId(hashId:int):void
| ConnectionEvent | ||
![]() |
setIsRealServerMessage(isRealServerMessage:Boolean):void
Used internally when one client-request needs to be remapped to a server request.
| MessageImpl | |
![]() |
setMessageId(id:Number):void
The id of the message.
| MessageImpl | |
![]() |
setMessageType(mt:MessageType):void
This defines the type of message being used, such as LoginRequest or CreateRoomVariableRequest.
| MessageImpl | |
|
toString():String
| ConnectionEvent | ||
![]() |
Every messages have varying optional fields.
| MessageImpl | |
| success | property |
success:Boolean [read-only]Returns true if the connection was a success.
Implementation public function get success():Boolean
| ConnectionEvent | () | constructor |
public function ConnectionEvent()Creates a new instance of the ConnectionEvent class.
| getAccepted | () | method |
public function getAccepted():BooleanReturns true if the connection was a success.
ReturnsBoolean — True or false.
|
| getBase | () | method |
public function getBase():StringGets the base.
ReturnsString — The base.
|
| getEsError | () | method |
public function getEsError():EsErrorGets the EsError. If the connection failed then there will be an EsError.
ReturnsEsError —
The EsError.
|
| getHashId | () | method |
public function getHashId():int
Returns
int |
| getPrime | () | method |
public function getPrime():StringGets the prime.
ReturnsString — The prime.
|
| setHashId | () | method |
public function setHashId(hashId:int):voidParameters
hashId:int |
| toString | () | method |
public function toString():String
Returns
String |