SmartFoxServer 2X C++ API
KickUserRequest.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of KickUserRequest
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __KickUserRequest__
12 #define __KickUserRequest__
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 
35  class DLLImportExport KickUserRequest : public BaseRequest
36  {
37  public:
38 
39  // -------------------------------------------------------------------
40  // Public methods
41  // -------------------------------------------------------------------
45  KickUserRequest(long int userId);
46 
50  KickUserRequest(long int userId, string message);
51 
74  KickUserRequest(long int userId, string message, long int delaySeconds);
75 
76  virtual ~KickUserRequest();
77 
78  void Validate(boost::shared_ptr<SmartFox> sfs);
79 
80  void Execute (boost::shared_ptr<SmartFox> sfs);
81  // -------------------------------------------------------------------
82  // Public members
83  // -------------------------------------------------------------------
84 
85  static boost::shared_ptr<string> KEY_USER_ID;
86 
87  static boost::shared_ptr<string> KEY_MESSAGE;
88 
89  static boost::shared_ptr<string> KEY_DELAY;
90 
91  protected:
92 
93  // -------------------------------------------------------------------
94  // Protected methods
95  // -------------------------------------------------------------------
96 
97  // -------------------------------------------------------------------
98  // Protected members
99  // -------------------------------------------------------------------
100 
101  private:
102 
103  // -------------------------------------------------------------------
104  // Private methods
105  // -------------------------------------------------------------------
106  void Init(long int userId, string message, long int delaySeconds);
107 
108  // -------------------------------------------------------------------
109  // Private members
110  // -------------------------------------------------------------------
111  long int userId;
112  boost::shared_ptr<string> message;
113  long int delay;
114  };
115 
116 } // namespace Requests
117 } // namespace Sfs2X
118 
119 #endif
Kicks a User out of the server (for moderators and admins only)
Definition: KickUserRequest.h:35
STL namespace.
Definition: SmartFox.cpp:24