SmartFoxServer 2X C++ API
CreateRoomRequest.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of CreateRoomRequest
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __CreateRoomRequest__
12 #define __CreateRoomRequest__
13 
14 #include "../Util/Common.h"
15 #include "BaseRequest.h"
16 #include "RoomSettings.h"
17 #include "../Entities/Room.h"
18 #include "MMO/MMORoomSettings.h"
19 
20 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
21 
22 using namespace Sfs2X;
23 using namespace Sfs2X::Entities;
24 using namespace Sfs2X::Exceptions;
25 using namespace Sfs2X::Entities::Variables;
26 using namespace Sfs2X::Entities::Data;
27 using namespace Sfs2X::Requests::MMO;
28 
29 namespace Sfs2X {
30 namespace Requests {
31 
35  class DLLImportExport CreateRoomRequest : public BaseRequest
36  {
37  public:
38 
39  // -------------------------------------------------------------------
40  // Public methods
41  // -------------------------------------------------------------------
42 
99  CreateRoomRequest(boost::shared_ptr<RoomSettings> settings, bool autoJoin, boost::shared_ptr<Room> roomToLeave);
100 
104  CreateRoomRequest(boost::shared_ptr<RoomSettings> settings, bool autoJoin);
105 
109  CreateRoomRequest(boost::shared_ptr<RoomSettings> settings);
110 
111  virtual ~CreateRoomRequest();
112 
113  void Validate(boost::shared_ptr<SmartFox> sfs);
114 
115  void Execute (boost::shared_ptr<SmartFox> sfs);
116 
117  // -------------------------------------------------------------------
118  // Public members
119  // -------------------------------------------------------------------
120 
121  static boost::shared_ptr<string> KEY_ROOM;
122 
123  static boost::shared_ptr<string> KEY_NAME;
124 
125  static boost::shared_ptr<string> KEY_PASSWORD;
126 
127  static boost::shared_ptr<string> KEY_GROUP_ID;
128 
129  static boost::shared_ptr<string> KEY_ISGAME;
130 
131  static boost::shared_ptr<string> KEY_MAXUSERS;
132 
133  static boost::shared_ptr<string> KEY_MAXSPECTATORS;
134 
135  static boost::shared_ptr<string> KEY_MAXVARS;
136 
137  static boost::shared_ptr<string> KEY_ROOMVARS;
138 
139  static boost::shared_ptr<string> KEY_PERMISSIONS;
140 
141  static boost::shared_ptr<string> KEY_EVENTS;
142 
143  static boost::shared_ptr<string> KEY_EXTID;
144 
145  static boost::shared_ptr<string> KEY_EXTCLASS;
146 
147  static boost::shared_ptr<string> KEY_EXTPROP;
148 
149  static boost::shared_ptr<string> KEY_AUTOJOIN;
150 
151  static boost::shared_ptr<string> KEY_ROOM_TO_LEAVE;
152 
153  static boost::shared_ptr<string> KEY_ALLOW_JOIN_INVITATION_BY_OWNER;
154 
155 
156  //--- MMORoom Params --------------------------------------------------------
157 
158  static boost::shared_ptr<string> KEY_MMO_DEFAULT_AOI;
159 
160  static boost::shared_ptr<string> KEY_MMO_MAP_LOW_LIMIT;
161 
162  static boost::shared_ptr<string> KEY_MMO_MAP_HIGH_LIMIT;
163 
164  static boost::shared_ptr<string> KEY_MMO_USER_MAX_LIMBO_SECONDS;
165 
166  static boost::shared_ptr<string> KEY_MMO_PROXIMITY_UPDATE_MILLIS;
167 
168  static boost::shared_ptr<string> KEY_MMO_SEND_ENTRY_POINT;
169 
170  protected:
171 
172  // -------------------------------------------------------------------
173  // Protected methods
174  // -------------------------------------------------------------------
175 
176  // -------------------------------------------------------------------
177  // Protected members
178  // -------------------------------------------------------------------
179 
180  private:
181 
182  // -------------------------------------------------------------------
183  // Private methods
184  // -------------------------------------------------------------------
185  void Init(boost::shared_ptr<RoomSettings> settings, bool autoJoin, boost::shared_ptr<Room> roomToLeave);
186 
187  // -------------------------------------------------------------------
188  // Private members
189  // -------------------------------------------------------------------
190  boost::shared_ptr<RoomSettings> settings;
191  bool autoJoin;
192  boost::shared_ptr<Room> roomToLeave;
193  };
194 
195 } // namespace Requests
196 } // namespace Sfs2X
197 
198 #endif
Definition: SFSCodecError.cpp:14
Creates a new Room in the current Zone
Definition: CreateRoomRequest.h:35
Definition: BaseVariable.cpp:15
Definition: Buddy.h:30
Definition: SmartFox.cpp:24
Definition: ISFSArray.h:17