public class Events extends Object
Modifier and Type | Field and Description |
---|---|
static byte |
ANY
Events should NEVER have this type.
|
static byte |
CHANGE_ATTRIBUTE |
static byte |
CONNECT |
static byte |
CONNECT_FAILED |
static byte |
DISCONNECT
If a remote connection is disconnected or closed then raise this event.
|
static byte |
EXCEPTION
A network exception will in turn cause this even to be raised.
|
static byte |
GAME_LIST |
static byte |
GAME_ROOM_JOIN |
static byte |
GAME_ROOM_JOIN_FAILURE |
static byte |
GAME_ROOM_JOIN_SUCCESS |
static byte |
GAME_ROOM_LEAVE |
static byte |
LOG_IN
Event used to log in to a server from a remote client.
|
static byte |
LOG_IN_FAILURE |
static byte |
LOG_IN_SUCCESS |
static byte |
LOG_OUT |
static byte |
LOG_OUT_FAILURE |
static byte |
LOG_OUT_SUCCESS |
static byte |
NETWORK_MESSAGE
This event is used to send data from the current machine to remote
machines using TCP or UDP transports.
|
static byte |
PROTCOL_VERSION |
static byte |
RECONNECT
Similar to LOG_IN but parameters are different.
|
static byte |
ROOM_LIST |
static byte |
SESSION_MESSAGE
Incoming data from another machine/JVM to this JVM (server or client)
|
static byte |
START
Event sent from server to client to start message sending from client to server.
|
static byte |
STOP
Event sent from server to client to stop messages from being sent to server.
|
Constructor and Description |
---|
Events() |
Modifier and Type | Method and Description |
---|---|
static Event |
changeAttributeEvent(String key,
Object value) |
static Event |
connectEvent(MessageSender.Fast udpSender) |
static Event |
connectEvent(MessageSender.Reliable tcpSender) |
static Event |
connectEvent(MessageSender.Reliable tcpSender,
MessageSender.Fast udpSender) |
static Event |
dataInEvent(Object source) |
static Event |
event(Object source,
int eventType) |
static Event |
event(Object source,
int eventType,
EventContext context) |
static Event |
event(Object source,
int eventType,
Session session) |
static NetworkEvent |
networkEvent(Object source)
Creates a network event with the source set to the object passed in as
parameter and the
DeliveryGuaranty set to
DeliveryGuaranty.DeliveryGuarantyOptions.RELIABLE . |
static NetworkEvent |
networkEvent(Object source,
DeliveryGuaranty deliveryGuaranty)
Creates a network event with the source set to the object passed in as
parameter and the
DeliveryGuaranty set to the incoming
parameter. |
public static final byte PROTCOL_VERSION
public static final byte ANY
DefaultSessionEventHandler
public static final byte CONNECT
public static final byte RECONNECT
public static final byte CONNECT_FAILED
public static final byte LOG_IN
public static final byte LOG_OUT
public static final byte LOG_IN_SUCCESS
public static final byte LOG_IN_FAILURE
public static final byte LOG_OUT_SUCCESS
public static final byte LOG_OUT_FAILURE
public static final byte GAME_LIST
public static final byte ROOM_LIST
public static final byte GAME_ROOM_JOIN
public static final byte GAME_ROOM_LEAVE
public static final byte GAME_ROOM_JOIN_SUCCESS
public static final byte GAME_ROOM_JOIN_FAILURE
public static final byte START
public static final byte STOP
public static final byte SESSION_MESSAGE
public static final byte NETWORK_MESSAGE
public static final byte CHANGE_ATTRIBUTE
public static final byte DISCONNECT
public static final byte EXCEPTION
public static Event event(Object source, int eventType, EventContext context)
public static NetworkEvent networkEvent(Object source)
DeliveryGuaranty
set to
DeliveryGuaranty.DeliveryGuarantyOptions.RELIABLE
. This method delegates to
networkEvent(Object, DeliveryGuaranty)
.source
- The payload of the event. This is the actual data that gets
transmitted to remote machine.NetworkEvent
public static NetworkEvent networkEvent(Object source, DeliveryGuaranty deliveryGuaranty)
DeliveryGuaranty
set to the incoming
parameter.source
- The payload of the event. This is the actual data that gets
transmitted to remote machine.deliveryGuaranty
- This decides which transport TCP or UDP to be used to send the
message to remote machine.NetworkEvent
public static Event connectEvent(MessageSender.Reliable tcpSender)
public static Event connectEvent(MessageSender.Fast udpSender)
public static Event connectEvent(MessageSender.Reliable tcpSender, MessageSender.Fast udpSender)
Copyright © 2013. All Rights Reserved.