Enum SFSEventType
- java.lang.Object
-
- java.lang.Enum<SFSEventType>
-
- com.smartfoxserver.v2.core.SFSEventType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<SFSEventType>
public enum SFSEventType extends java.lang.Enum<SFSEventType>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description __CLUSTER_READY
__TRACE_MESSAGE
BUDDY_ADD
This event is fired when a User is added in the Buddy List of another client.BUDDY_BLOCK
This event is fired when a Buddy is blocked in User's Buddy List.BUDDY_LIST_INIT
This event is fired when a User initializes his Buddy List.BUDDY_MESSAGE
This event is fired when a Buddy Message is sent between two Buddies.BUDDY_ONLINE_STATE_UPDATE
This event is fired when a Buddy changes his online state.BUDDY_REMOVE
This event is fired when a User is removed in the Buddy List of another client.BUDDY_VARIABLES_UPDATE
This event is fired when a Buddy Variables are set by a User.FILE_UPLOAD
This event is fired when one or more files have been uploaded by a User connected in the current Zone.GAME_INVITATION_FAILURE
This event is fired after a private SFSGame has finished the cycle of invitations.GAME_INVITATION_SUCCESS
This event is fired after a private SFSGame has finished the cycle of invitations.GAME_NODE_EVENT
Overcast Cluster OnlyPLAYER_TO_SPECTATOR
This event is fired when a User joined in a Game Room as player changes turns into a Spectator.PRIVATE_MESSAGE
This event is fired when a private message is sent by a client.PUBLIC_MESSAGE
This event is fired when a public message is sent by a client.ROOM_ADDED
This event is fired after a new Room was created in the current ZoneROOM_REMOVED
This event is fired after a Room was removed from the current ZoneROOM_VARIABLES_UPDATE
This event is fired when a one or more Room Variables are set.SERVER_READY
The event is fired by SmartFox when the server engine has completed the boot phase.SPECTATOR_TO_PLAYER
This event is fired when a User joined in a Game Room as spectator changes turns into a Player.USER_DISCONNECT
The event is fired after a User disconnects or is disconnected.USER_JOIN_ROOM
The event is fired after a User has joined a Room.USER_JOIN_ZONE
The event is fired after a successful User login.USER_LEAVE_ROOM
The event is fired after a User has left a Room.USER_LOGIN
The event is fired when a User sends a login request.USER_LOGOUT
The event is fired after a User logout.USER_RECONNECTION_SUCCESS
The event is fired when the HRC (highly resilient connection) feature is turned on and a User was successfully reconnected.USER_RECONNECTION_TRY
The event is fired when the HRC (highly resilient connection) feature is turned on and a User is trying to reconnect.USER_VARIABLES_UPDATE
This event is fired when a one or more User Variables are set.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SFSEventType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static SFSEventType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SERVER_READY
public static final SFSEventType SERVER_READY
The event is fired by SmartFox when the server engine has completed the boot phase.Level: Zone
Parameters: none
-
USER_LOGIN
public static final SFSEventType USER_LOGIN
The event is fired when a User sends a login request. You can use this event to check the User's credentials and you can throw aSFSLoginException
to stop the flow of the login.NOTE: The Zone must be configured with the customLogin attribute set to true.
Level: Zone
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.SESSION
: the User session (Session
)SFSEventParam.LOGIN_NAME
: the User name (String
)SFSEventParam.LOGIN_PASSWORD
: (optional) the password (String
)SFSEventParam.LOGIN_IN_DATA
: (optional) the custom user data (SFSObject
)SFSEventParam.LOGIN_OUT_DATA
: (optional) the outgoing custom object (SFSObject
)
-
USER_JOIN_ZONE
public static final SFSEventType USER_JOIN_ZONE
The event is fired after a successful User login.Level: Zone
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.USER
: the User (User
)
-
USER_LOGOUT
public static final SFSEventType USER_LOGOUT
The event is fired after a User logout.Level: Zone
Parameters:
SFSEventParam.ZONE
: the Zone< (Zone
)/li>SFSEventParam.USER
: the User (User
)SFSEventParam.JOINED_ROOMS
: the list of Rooms previously joined by the User (List
)SFSEventParam.PLAYER_IDS_BY_ROOM
: a map of PlayerId by Room, for each Room joined by the User (Map
of Room, Integer)
-
USER_JOIN_ROOM
public static final SFSEventType USER_JOIN_ROOM
The event is fired after a User has joined a Room.Level: Zone, Room
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.ROOM
: the Room that was joined (Room
)SFSEventParam.USER
: the User (User
)
-
USER_LEAVE_ROOM
public static final SFSEventType USER_LEAVE_ROOM
The event is fired after a User has left a Room.Level: Zone, Room
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.ROOM
: the Room that was left (Room
)SFSEventParam.USER
: the User (User
)SFSEventParam.PLAYER_ID
: the previous playerId of the User in that Room (Integer
)
-
USER_DISCONNECT
public static final SFSEventType USER_DISCONNECT
The event is fired after a User disconnects or is disconnected.Level: Zone, Room
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.USER
: the User (User
)SFSEventParam.JOINED_ROOMS
: the list of Rooms previously joined by the User (List
or Room )SFSEventParam.PLAYER_IDS_BY_ROOM
: a map of PlayerId by Room, for each Room joined by the User (Map
of Room, Integer)SFSEventParam.DISCONNECTION_REASON
: the reason of the disconnection (where it is possible to detect it) (ClientDisconnectionReason
)
- See Also:
ClientDisconnectionReason
-
USER_RECONNECTION_TRY
public static final SFSEventType USER_RECONNECTION_TRY
The event is fired when the HRC (highly resilient connection) feature is turned on and a User is trying to reconnect.When a User looses connection for an unknown reason the client will attempt to re-connect immediately. If the operation is done within the expected time the User connection will be resumed transparently. The User does not loose its current state and it's not removed from the server so, for example, the game can continue from the point it was stopped (if turn-based).
This event notifies the developer that the User is in "reconnection mode". The event can be used to stop the game if necessary or simply notify the other player of the temporary change. The reconnection time is specified in the Zone configuration using the
setting.Level: Zone, Room
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.USER
: the User (User
)
-
USER_RECONNECTION_SUCCESS
public static final SFSEventType USER_RECONNECTION_SUCCESS
The event is fired when the HRC (highly resilient connection) feature is turned on and a User was successfully reconnected.When a User looses connection for an unknown reason the client will attempt to re-connect immediately. If the operation is done within the expected time the User connection will be resumed transparently. The User does not loose its current state and it's not removed from the server so, for example, the game can continue from the point it was stopped (if turn-based).
This event notifies the developer that the User was reconnected. The event can be used to re-start the game if necessary or simply notify the other players.
The reconnection time is specified in the Zone configuration using the
setting. In case the User is not able to reconnect a regularUSER_DISCONNECT
event will be fired.Level: Zone, Room
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.USER
: the User (User
)
-
ROOM_ADDED
public static final SFSEventType ROOM_ADDED
This event is fired after a new Room was created in the current ZoneLevel: Zone
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.ROOM
: the Room (Room
)
-
ROOM_REMOVED
public static final SFSEventType ROOM_REMOVED
This event is fired after a Room was removed from the current ZoneLevel: Zone
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.ROOM
: the Room< (Room
)/li>
-
PUBLIC_MESSAGE
public static final SFSEventType PUBLIC_MESSAGE
This event is fired when a public message is sent by a client.Level: Zone
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.ROOM
: the Room (Room
)SFSEventParam.USER
: the sender of the message (User
)SFSEventParam.MESSAGE
: the message (String
)SFSEventParam.OBJECT
: the message (ISFSObject
)
-
PRIVATE_MESSAGE
public static final SFSEventType PRIVATE_MESSAGE
This event is fired when a private message is sent by a client.Level: Zone
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.ROOM
: the Room (Room
)SFSEventParam.USER
: the sender of the message (User
)SFSEventParam.RECIPIENT
: the recipient of the message (User
)SFSEventParam.MESSAGE
: the message (String
)SFSEventParam.OBJECT
: the message (ISFSObject
)
-
ROOM_VARIABLES_UPDATE
public static final SFSEventType ROOM_VARIABLES_UPDATE
This event is fired when a one or more Room Variables are set.Level: Zone, Room
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.ROOM
: the Room (Room
)SFSEventParam.USER
: the user setting the variables (User
)SFSEventParam.VARIABLES
: the variables (List
of RoomVariable )SFSEventParam.VARIABLES_MAP
: the variables as key-value map (Map
of String, RoomVariable )
-
USER_VARIABLES_UPDATE
public static final SFSEventType USER_VARIABLES_UPDATE
This event is fired when a one or more User Variables are set.Level: Zone, Room (Room Level added since version 2.8.x)
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.USER
: the user setting the variables (User
)SFSEventParam.VARIABLES
: the variables (List
of UserVariable )SFSEventParam.VARIABLES_MAP
: the variables as key-value map (Map
of String, UserVariable )
-
SPECTATOR_TO_PLAYER
public static final SFSEventType SPECTATOR_TO_PLAYER
This event is fired when a User joined in a Game Room as spectator changes turns into a Player. The User will be assigned a new playerId which is passed in the event parameters.Level: Zone, Room
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.ROOM
: the Room (Room
)SFSEventParam.USER
: the User (User
)SFSEventParam.PLAYER_ID
: the new player Id assigned to the User that was switched (Integer
)
-
PLAYER_TO_SPECTATOR
public static final SFSEventType PLAYER_TO_SPECTATOR
This event is fired when a User joined in a Game Room as player changes turns into a Spectator. The User playerId will be set to -1. (default for all spectators)Level: Zone, Room
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.ROOM
: the Room (Room
)SFSEventParam.USER
: the User (User
)
-
BUDDY_ADD
public static final SFSEventType BUDDY_ADD
This event is fired when a User is added in the Buddy List of another client.Level: Zone
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.USER
: the owner of the Buddy List (User
)SFSBuddyEventParam.BUDDY
: the added Buddy (Buddy
)
-
BUDDY_REMOVE
public static final SFSEventType BUDDY_REMOVE
This event is fired when a User is removed in the Buddy List of another client.Level: Zone
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.USER
: the owner of the Buddy List (User
)SFSBuddyEventParam.BUDDY
: the removed Buddy (Buddy
)
-
BUDDY_BLOCK
public static final SFSEventType BUDDY_BLOCK
This event is fired when a Buddy is blocked in User's Buddy List.Level: Zone
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.USER
: the owner of the Buddy List (User
)SFSBuddyEventParam.BUDDY
: the blocked Buddy (Buddy
)
-
BUDDY_VARIABLES_UPDATE
public static final SFSEventType BUDDY_VARIABLES_UPDATE
This event is fired when a Buddy Variables are set by a User.Level: Zone
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.USER
: the User (User
)SFSEventParam.VARIABLES
: the Buddy Variables (List
of BuddyVariable )SFSEventParam.VARIABLES_MAP
: the variables as key-value map (Map
of String, BuddyVariable )
-
BUDDY_ONLINE_STATE_UPDATE
public static final SFSEventType BUDDY_ONLINE_STATE_UPDATE
This event is fired when a Buddy changes his online state.Level: Zone
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.USER
: the User(User
)SFSBuddyEventParam.BUDDY_IS_ONLINE
: the new state: true == online, false == offline. (Boolean
)
-
BUDDY_MESSAGE
public static final SFSEventType BUDDY_MESSAGE
This event is fired when a Buddy Message is sent between two Buddies.Level: Zone
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.USER
: the owner of the Buddy List (User
)SFSEventParam.RECIPIENT
: the blocked Buddy (Buddy
)SFSEventParam.MESSAGE
: the blocked Buddy (String
)SFSEventParam.OBJECT
: the message (ISFSObject
)
-
BUDDY_LIST_INIT
public static final SFSEventType BUDDY_LIST_INIT
This event is fired when a User initializes his Buddy List. The initialization is necessary in order to populate the Buddy List with the data saved in the last session (list of buddies, state, variables etc...)Level: Zone
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.USER
: the owner of the Buddy List (User
)SFSBuddyEventParam.BUDDY_LIST
: the User's BuddyList (BuddyList
)
-
GAME_INVITATION_SUCCESS
public static final SFSEventType GAME_INVITATION_SUCCESS
This event is fired after a private SFSGame has finished the cycle of invitations. The event signals that enough players were joined in the Game Room and the game is ready to start.Level: Zone, Room
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.ROOM
: the Game Room (Room
)
-
GAME_INVITATION_FAILURE
public static final SFSEventType GAME_INVITATION_FAILURE
This event is fired after a private SFSGame has finished the cycle of invitations. The event signals that not enough players were joined in the Game Room and the game cannot start.Level: Zone, Room
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.ROOM
: the Game Room (Room
)
-
FILE_UPLOAD
public static final SFSEventType FILE_UPLOAD
This event is fired when one or more files have been uploaded by a User connected in the current Zone.Level: Zone
Parameters:
SFSEventParam.ZONE
: the Zone (Zone
)SFSEventParam.USER
: the User (User
)SFSEventParam.UPLOAD_FILE_LIST
: a List ofUploadedFile
elementsSFSEventParam.UPLOAD_HTTP_PARAMS
: a Map of custom parameters. Each entry in the map provides the name (String) and the relative value (String) of the parameter.
-
GAME_NODE_EVENT
public static final SFSEventType GAME_NODE_EVENT
Overcast Cluster OnlyThis event is fired on the Lobby Node in the Overcast Cluster and contains custom parameters sent from an Extension running on a Game Node
Level: Global, i.e. it is fired to all active Zone Extensions in the Lobby Node
Parameters:
SFSEventParam.CLUSTER_EVENT_PARAMS
: the custom event params as Map<String, Object> (all values must be Serializable)
-
__TRACE_MESSAGE
public static final SFSEventType __TRACE_MESSAGE
-
__CLUSTER_READY
public static final SFSEventType __CLUSTER_READY
-
-
Method Detail
-
values
public static SFSEventType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SFSEventType c : SFSEventType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SFSEventType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-