SmartFoxServer 2X C++ API
SFSEvent.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of SFSEvent
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __SFSEvent__
12 #define __SFSEvent__
13 
14 #include "../Util/Common.h"
15 #include "../Core/BaseEvent.h"
16 
17 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
18 
19 namespace Sfs2X {
20 namespace Core {
21 
27  class DLLImportExport SFSEvent : public BaseEvent
28  {
29  public:
30 
31  // -------------------------------------------------------------------
32  // Public methods
33  // -------------------------------------------------------------------
34  SFSEvent(boost::shared_ptr<string> type);
35  SFSEvent(boost::shared_ptr<string> type, boost::shared_ptr<map<string, boost::shared_ptr<void> > > data);
36 
37  // -------------------------------------------------------------------
38  // Public members
39  // -------------------------------------------------------------------
40  static boost::shared_ptr<string> HANDSHAKE;
41 
91  static boost::shared_ptr<string> UDP_INIT;
92 
143  static boost::shared_ptr<string> CONNECTION;
144 
155  static boost::shared_ptr<string> PING_PONG;
156 
157  /*
158  * The <em>SFSEvent.SOCKET_ERROR</em> constant defines the value of the <em>type</em> property of the event object for a <em>socketError</em> event.
159  * <p>The event is fired when an unexpected socket error occurs, typically a data error.</p>
160  *
161  * <p>The properties of the <em>params</em> object contained in the event object have the following values:</p>
162  * <table class="innertable">
163  * <tr><th>Property</th><th>Type</th><th>Description</th></tr>
164  * <tr><td>errorMessage</td><td><em>int</em></td><td>the description of the problem</td></tr>
165  * </table>
166  */
167  static boost::shared_ptr<string> SFS_SOCKET_ERROR;
168 
219  static boost::shared_ptr<string> CONNECTION_LOST;
220 
267  static boost::shared_ptr<string> CONNECTION_RETRY;
268 
325  static boost::shared_ptr<string> CONNECTION_RESUME;
326 
327  /*
328  * The <em>SFSEvent.CONNECTION_ATTEMPT_HTTP</em> constant defines the value of the <em>type</em> property of the event object for a <em>connectionAttemptHttp</em> event.
329  *
330  * <p>No parameters are available for this event object.</p>
331  *
332  * @example See the example provided in the <em>CONNECTION_ATTEMPT_HTTP</em> constant description.
333  *
334  * @eventType connectionAttemptHttp
335  *
336  * @see #CONNECTION
337  * @see #CONNECTION_LOST
338  */
339  static boost::shared_ptr<string> CONNECTION_ATTEMPT_HTTP;
340 
371  static boost::shared_ptr<string> CONFIG_LOAD_SUCCESS;
372 
400  static boost::shared_ptr<string> CONFIG_LOAD_FAILURE;
401 
444  static boost::shared_ptr<string> LOGIN;
445 
487  static boost::shared_ptr<string> LOGIN_ERROR;
488 
523  static boost::shared_ptr<string> LOGOUT;
524 
559  static boost::shared_ptr<string> ROOM_ADD;
560 
594  static boost::shared_ptr<string> ROOM_REMOVE;
595 
634  static boost::shared_ptr<string> ROOM_CREATION_ERROR;
635 
670  static boost::shared_ptr<string> ROOM_JOIN;
671 
710  static boost::shared_ptr<string> ROOM_JOIN_ERROR;
711 
760  static boost::shared_ptr<string> USER_ENTER_ROOM;
761 
810  static boost::shared_ptr<string> USER_EXIT_ROOM;
811 
865  static boost::shared_ptr<string> USER_COUNT_CHANGE;
866 
921  static boost::shared_ptr<string> PUBLIC_MESSAGE;
922 
971  static boost::shared_ptr<string> PRIVATE_MESSAGE;
972 
1021  static boost::shared_ptr<string> MODERATOR_MESSAGE;
1022 
1067  static boost::shared_ptr<string> ADMIN_MESSAGE;
1068 
1114  static boost::shared_ptr<string> OBJECT_MESSAGE;
1115 
1153  static boost::shared_ptr<string> EXTENSION_RESPONSE;
1154 
1177  static boost::shared_ptr<string> ROOM_VARIABLES_UPDATE;
1178 
1201  static boost::shared_ptr<string> USER_VARIABLES_UPDATE;
1202 
1224  static boost::shared_ptr<string> ROOM_GROUP_SUBSCRIBE;
1225 
1243  static boost::shared_ptr<string> ROOM_GROUP_UNSUBSCRIBE;
1244 
1266  static boost::shared_ptr<string> ROOM_GROUP_SUBSCRIBE_ERROR;
1267 
1289  static boost::shared_ptr<string> ROOM_GROUP_UNSUBSCRIBE_ERROR;
1290 
1316  static boost::shared_ptr<string> SPECTATOR_TO_PLAYER;
1317 
1339  static boost::shared_ptr<string> PLAYER_TO_SPECTATOR;
1340 
1362  static boost::shared_ptr<string> SPECTATOR_TO_PLAYER_ERROR;
1363 
1385  static boost::shared_ptr<string> PLAYER_TO_SPECTATOR_ERROR;
1386 
1408  static boost::shared_ptr<string> ROOM_NAME_CHANGE;
1409 
1431  static boost::shared_ptr<string> ROOM_NAME_CHANGE_ERROR;
1432 
1452  static boost::shared_ptr<string> ROOM_PASSWORD_STATE_CHANGE;
1453 
1475  static boost::shared_ptr<string> ROOM_PASSWORD_STATE_CHANGE_ERROR;
1476 
1494  static boost::shared_ptr<string> ROOM_CAPACITY_CHANGE;
1495 
1517  static boost::shared_ptr<string> ROOM_CAPACITY_CHANGE_ERROR;
1518 
1536  static boost::shared_ptr<string> ROOM_FIND_RESULT;
1537 
1555  static boost::shared_ptr<string> USER_FIND_RESULT;
1556 
1575  static boost::shared_ptr<string> INVITATION;
1576 
1603  static boost::shared_ptr<string> INVITATION_REPLY;
1604 
1630  static boost::shared_ptr<string> INVITATION_REPLY_ERROR;
1631 
1668  static boost::shared_ptr<string> DEBUG_MESSAGE;
1669 
1712  static boost::shared_ptr<string> PROXIMITY_LIST_UPDATE;
1713 
1773  static boost::shared_ptr<string> MMOITEM_VARIABLES_UPDATE;
1774 
1802  static boost::shared_ptr<string> CRYPTO_INIT;
1803 
1804  protected:
1805 
1806  // -------------------------------------------------------------------
1807  // Protected methods
1808  // -------------------------------------------------------------------
1809 
1810  // -------------------------------------------------------------------
1811  // Protected members
1812  // -------------------------------------------------------------------
1813 
1814  private:
1815 
1816  // -------------------------------------------------------------------
1817  // Private methods
1818  // -------------------------------------------------------------------
1819 
1820  // -------------------------------------------------------------------
1821  // Private members
1822  // -------------------------------------------------------------------
1823  };
1824 
1825 } // namespace Core
1826 } // namespace Sfs2X
1827 
1828 #endif
static boost::shared_ptr< string > OBJECT_MESSAGE
This Event is received when a User has sent an ObjectMessage request
Definition: SFSEvent.h:1114
static boost::shared_ptr< string > MODERATOR_MESSAGE
The Event is fired when a User receives a Moderator message.
Definition: SFSEvent.h:1021
static boost::shared_ptr< string > ROOM_CAPACITY_CHANGE
The Event is fired in response to a ChangeRoomCapacityRequest
Definition: SFSEvent.h:1494
static boost::shared_ptr< string > INVITATION_REPLY_ERROR
The Event is fired in response to a failed InvitationReplyRequest
Definition: SFSEvent.h:1630
static boost::shared_ptr< string > SPECTATOR_TO_PLAYER_ERROR
The Event is fired in response to a failed SpectatorToPlayerRequest
Definition: SFSEvent.h:1362
static boost::shared_ptr< string > LOGIN
The Event is dispatched in response to a login request.
Definition: SFSEvent.h:444
static boost::shared_ptr< string > USER_FIND_RESULT
The Event is fired in response to a FindUsersRequest
Definition: SFSEvent.h:1555
static boost::shared_ptr< string > CONFIG_LOAD_SUCCESS
Dispatched when the external SmartFox configuration file has been loaded successfully.
Definition: SFSEvent.h:371
static boost::shared_ptr< string > USER_EXIT_ROOM
The Event is fired whenever a User leaves one of the Rooms where the current User is joined...
Definition: SFSEvent.h:810
static boost::shared_ptr< string > ROOM_ADD
The Event is dispatched when a new Room was created inside the Zone under any of the Room Groups that...
Definition: SFSEvent.h:559
static boost::shared_ptr< string > ROOM_GROUP_SUBSCRIBE
The Event is fired in response to a SubscribeRoomGroupRequest
Definition: SFSEvent.h:1224
static boost::shared_ptr< string > PLAYER_TO_SPECTATOR
The Event is fired in response to a failed PlayerToSpectatorRequest
Definition: SFSEvent.h:1339
static boost::shared_ptr< string > ROOM_CREATION_ERROR
The Event is dispatched in response to a failed create room request.
Definition: SFSEvent.h:634
static boost::shared_ptr< string > SPECTATOR_TO_PLAYER
The Event is fired in response to a successful SpectatorToPlayerRequest
Definition: SFSEvent.h:1316
static boost::shared_ptr< string > PROXIMITY_LIST_UPDATE
Dispatched when one more users or one or more MMOItem objects enter/leave the current user&#39;s Area of ...
Definition: SFSEvent.h:1712
static boost::shared_ptr< string > LOGOUT
The Event is dispatched in response to a logout request.
Definition: SFSEvent.h:523
static boost::shared_ptr< string > USER_COUNT_CHANGE
The Event is fired whenever the number of users/spectators in a Room changes.
Definition: SFSEvent.h:865
static boost::shared_ptr< string > PLAYER_TO_SPECTATOR_ERROR
The Event is fired in response to a failed UnsubscribeRoomGroupRequest
Definition: SFSEvent.h:1385
static boost::shared_ptr< string > PUBLIC_MESSAGE
The Event is fired when a User sends a public message.
Definition: SFSEvent.h:921
static boost::shared_ptr< string > UDP_INIT
The Event notifies the result of the initial UDP handshake.
Definition: SFSEvent.h:91
static boost::shared_ptr< string > ROOM_JOIN
The Event is dispatched in response to a JoinRoomRequest.
Definition: SFSEvent.h:670
static boost::shared_ptr< string > EXTENSION_RESPONSE
The Event is fired every time a server-side Extension sends a message, usually in response to an Exte...
Definition: SFSEvent.h:1153
static boost::shared_ptr< string > PRIVATE_MESSAGE
The Event is fired when a User receives a private message.
Definition: SFSEvent.h:971
static boost::shared_ptr< string > ROOM_PASSWORD_STATE_CHANGE_ERROR
The Event is fired in response to a failed ChangeRoomPasswordStateRequest
Definition: SFSEvent.h:1475
static boost::shared_ptr< string > CONNECTION_LOST
The Event notifies the disconnection from the Server.
Definition: SFSEvent.h:219
static boost::shared_ptr< string > ROOM_NAME_CHANGE_ERROR
The Event is fired in response to a failed ChangeRoomNameRequest
Definition: SFSEvent.h:1431
This is the main SmartFox Event class. All major system events are found here.
Definition: SFSEvent.h:27
static boost::shared_ptr< string > ROOM_VARIABLES_UPDATE
The Event is fired in response to a SetRoomVariablesRequest
Definition: SFSEvent.h:1177
static boost::shared_ptr< string > PING_PONG
Definition: SFSEvent.h:155
static boost::shared_ptr< string > MMOITEM_VARIABLES_UPDATE
Dispatched when an MMOItem Variable is updated in an MMORoom.
Definition: SFSEvent.h:1773
This is the Base class of all Events in the API
Definition: BaseEvent.h:34
static boost::shared_ptr< string > CRYPTO_INIT
Dispatched in return to the initialization of an encrypted connection.
Definition: SFSEvent.h:1802
static boost::shared_ptr< string > LOGIN_ERROR
The Event is dispatched in response to a failed login request.
Definition: SFSEvent.h:487
static boost::shared_ptr< string > ROOM_GROUP_SUBSCRIBE_ERROR
The Event is fired in response to a failed SubscribeRoomGroupRequest
Definition: SFSEvent.h:1266
static boost::shared_ptr< string > ADMIN_MESSAGE
The Event is fired when a User receives an Admin message.
Definition: SFSEvent.h:1067
static boost::shared_ptr< string > USER_VARIABLES_UPDATE
The Event is fired in response to a SetUserVariablesRequest
Definition: SFSEvent.h:1201
static boost::shared_ptr< string > ROOM_PASSWORD_STATE_CHANGE
The Event is fired in response to a ChangeRoomPasswordStateRequest.
Definition: SFSEvent.h:1452
static boost::shared_ptr< string > ROOM_REMOVE
The Event is dispatched whenever a Room is removed from the Zone, under any of the Room Groups that t...
Definition: SFSEvent.h:594
static boost::shared_ptr< string > CONNECTION_RESUME
The Event is dispatched after a temporary disconnection, when the connection to the Server has been r...
Definition: SFSEvent.h:325
static boost::shared_ptr< string > CONNECTION
The Event notifies the result of a connection attempt.
Definition: SFSEvent.h:143
static boost::shared_ptr< string > CONFIG_LOAD_FAILURE
Dispatched when an error occurs while loading the external SmartFox configuration file...
Definition: SFSEvent.h:400
static boost::shared_ptr< string > INVITATION
The Event is fired when another User has sent you an Invitation
Definition: SFSEvent.h:1575
Definition: SmartFox.cpp:24
static boost::shared_ptr< string > ROOM_GROUP_UNSUBSCRIBE
The Event is fired in response to an UnsubscribeRoomGroupRequest
Definition: SFSEvent.h:1243
static boost::shared_ptr< string > ROOM_GROUP_UNSUBSCRIBE_ERROR
The Event is fired in response to a failed UnsubscribeRoomGroupRequest
Definition: SFSEvent.h:1289
static boost::shared_ptr< string > ROOM_NAME_CHANGE
The Event is fired in response to a ChangeRoomNameRequest
Definition: SFSEvent.h:1408
static boost::shared_ptr< string > INVITATION_REPLY
The Event is fired when a User sends a reply to your Invitation
Definition: SFSEvent.h:1603
static boost::shared_ptr< string > USER_ENTER_ROOM
The Event is fired whenever a User enters one of the Rooms where the current User is joined...
Definition: SFSEvent.h:760
static boost::shared_ptr< string > ROOM_FIND_RESULT
The Event is fired in response to a FindRoomsRequest
Definition: SFSEvent.h:1536
static boost::shared_ptr< string > ROOM_CAPACITY_CHANGE_ERROR
The Event is fired in response to a failed ChangeRoomCapacityRequest
Definition: SFSEvent.h:1517
static boost::shared_ptr< string > ROOM_JOIN_ERROR
The Event is dispatched in response to a failed JoinRoomRequest.
Definition: SFSEvent.h:710
static boost::shared_ptr< string > DEBUG_MESSAGE
Event fired for all log messages
Definition: SFSEvent.h:1668
static boost::shared_ptr< string > CONNECTION_RETRY
The Event notifies the disconnection from the Server.
Definition: SFSEvent.h:267