SmartFoxServer 2X C++ API
ChangeRoomCapacityRequest.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of ChangeRoomCapacityRequest
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __ChangeRoomCapacityRequest__
12 #define __ChangeRoomCapacityRequest__
13 
14 #include "../Util/Common.h"
15 #include "BaseRequest.h"
16 #include "../Entities/Room.h"
17 
18 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
19 
20 #if defined(_MSC_VER)
21 #pragma warning(disable:4786) // STL library: disable warning 4786; this warning is generated due to a Microsoft bug
22 #endif
23 #include <list> // STL library: list object
24 using namespace std; // STL library: declare the STL namespace
25 
26 namespace Sfs2X {
27 namespace Requests {
28 
40  class DLLImportExport ChangeRoomCapacityRequest : public BaseRequest
41  {
42  public:
43 
44  // -------------------------------------------------------------------
45  // Public methods
46  // -------------------------------------------------------------------
47 
99  ChangeRoomCapacityRequest(boost::shared_ptr<Room> room, long int newMaxUsers, long int newMaxSpect);
100  virtual ~ChangeRoomCapacityRequest();
101 
102  void Validate(boost::shared_ptr<SmartFox> sfs);
103 
104  void Execute (boost::shared_ptr<SmartFox> sfs);
105 
106  // -------------------------------------------------------------------
107  // Public members
108  // -------------------------------------------------------------------
109  static boost::shared_ptr<string> KEY_ROOM;
110 
111  static boost::shared_ptr<string> KEY_USER_SIZE;
112 
113  static boost::shared_ptr<string> KEY_SPEC_SIZE;
114 
115  protected:
116 
117  // -------------------------------------------------------------------
118  // Protected methods
119  // -------------------------------------------------------------------
120 
121  // -------------------------------------------------------------------
122  // Protected members
123  // -------------------------------------------------------------------
124 
125  private:
126 
127  // -------------------------------------------------------------------
128  // Private methods
129  // -------------------------------------------------------------------
130 
131  // -------------------------------------------------------------------
132  // Private members
133  // -------------------------------------------------------------------
134  boost::shared_ptr<Room> room;
135  long int newMaxUsers;
136  long int newMaxSpect;
137  };
138 
139 } // namespace Requests
140 } // namespace Sfs2X
141 
142 #endif
Change the capacity of a Room (maxUsers and maxSpectators) at runtime.
Definition: ChangeRoomCapacityRequest.h:40
STL namespace.
Definition: SmartFox.cpp:24