SmartFoxServer 2X C++ API
JoinRoomRequest.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of JoinRoomRequest
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __JoinRoomRequest__
12 #define __JoinRoomRequest__
13 
14 #include "../Util/Common.h"
15 #include "BaseRequest.h"
16 
17 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
18 
19 #if defined(_MSC_VER)
20 #pragma warning(disable:4786) // STL library: disable warning 4786; this warning is generated due to a Microsoft bug
21 #endif
22 #include <list> // STL library: list object
23 #include <string> // STL library: string object
24 using namespace std; // STL library: declare the STL namespace
25 
26 namespace Sfs2X {
27 namespace Requests {
28 
32  class DLLImportExport JoinRoomRequest : public BaseRequest
33  {
34  public:
35 
36  // -------------------------------------------------------------------
37  // Public methods
38  // -------------------------------------------------------------------
39 
92  JoinRoomRequest(boost::shared_ptr<Room> id, string pass, boost::shared_ptr<long int> roomIdToLeave, bool asSpectator);
93  JoinRoomRequest(string id, string pass, boost::shared_ptr<long int> roomIdToLeave, bool asSpectator);
94  JoinRoomRequest(long int id, string pass, boost::shared_ptr<long int> roomIdToLeave, bool asSpectator);
95 
99  JoinRoomRequest(boost::shared_ptr<Room> id, string pass, boost::shared_ptr<long int> roomIdToLeave);
100  JoinRoomRequest(string id, string pass, boost::shared_ptr<long int> roomIdToLeave);
101  JoinRoomRequest(long int id, string pass, boost::shared_ptr<long int> roomIdToLeave);
102 
106  JoinRoomRequest(boost::shared_ptr<Room> id, string pass);
107  JoinRoomRequest(string id, string pass);
108  JoinRoomRequest(long int id, string pass);
109 
113  JoinRoomRequest(boost::shared_ptr<Room> id);
114  JoinRoomRequest(string id);
115  JoinRoomRequest(long int id);
116 
117  virtual ~JoinRoomRequest();
118 
119  void Validate(boost::shared_ptr<SmartFox> sfs);
120 
121  void Execute (boost::shared_ptr<SmartFox> sfs);
122 
123  // -------------------------------------------------------------------
124  // Public members
125  // -------------------------------------------------------------------
126  static boost::shared_ptr<string> KEY_ROOM;
127 
128  static boost::shared_ptr<string> KEY_USER_LIST;
129 
130  static boost::shared_ptr<string> KEY_ROOM_NAME;
131 
132  static boost::shared_ptr<string> KEY_ROOM_ID;
133 
134  static boost::shared_ptr<string> KEY_PASS;
135 
136  static boost::shared_ptr<string> KEY_ROOM_TO_LEAVE;
137 
138  static boost::shared_ptr<string> KEY_AS_SPECTATOR;
139 
140  protected:
141 
142  // -------------------------------------------------------------------
143  // Protected methods
144  // -------------------------------------------------------------------
145 
146  // -------------------------------------------------------------------
147  // Protected members
148  // -------------------------------------------------------------------
149 
150  private:
151 
152  // -------------------------------------------------------------------
153  // Private methods
154  // -------------------------------------------------------------------
155  void Init(boost::shared_ptr<Room> id, boost::shared_ptr<string> pass, boost::shared_ptr<long int> roomIdToLeave, bool asSpectator);
156  void Init(string id, boost::shared_ptr<string> pass, boost::shared_ptr<long int> roomIdToLeave, bool asSpectator);
157  void Init(long int id, boost::shared_ptr<string> pass, boost::shared_ptr<long int> roomIdToLeave, bool asSpectator);
158 
159  // -------------------------------------------------------------------
160  // Private members
161  // -------------------------------------------------------------------
162  long int id;
163  boost::shared_ptr<string> name;
164  boost::shared_ptr<string> pass;
165  boost::shared_ptr<long int> roomIdToLeave;
166  bool asSpectator;
167  };
168 
169 } // namespace Requests
170 } // namespace Sfs2X
171 
172 #endif
Join the current User in a Room.
Definition: JoinRoomRequest.h:32
STL namespace.
Definition: SmartFox.cpp:24