SmartFoxServer 2X C++ API
LoginRequest.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of LoginRequest
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __LoginRequest__
12 #define __LoginRequest__
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 using namespace std; // STL library: declare the STL namespace
24 
25 using namespace Sfs2X;
26 using namespace Sfs2X::Entities::Data;
27 using namespace Sfs2X::Exceptions;
28 
29 namespace Sfs2X {
30 namespace Requests {
31 
41  class DLLImportExport LoginRequest : public BaseRequest
42  {
43  public:
44 
45  // -------------------------------------------------------------------
46  // Public methods
47  // -------------------------------------------------------------------
48 
98  LoginRequest(string userName, string password, string zoneName, boost::shared_ptr<ISFSObject> parameters);
99 
103  LoginRequest(string userName, string password, string zoneName);
104 
108  LoginRequest(string userName, string password);
109 
113  LoginRequest(string userName);
114 
115  virtual ~LoginRequest();
116 
117  void Validate(boost::shared_ptr<SmartFox> sfs);
118 
119  void Execute(boost::shared_ptr<SmartFox> sfs);
120 
121  // -------------------------------------------------------------------
122  // Public members
123  // -------------------------------------------------------------------
124 
125  static boost::shared_ptr<string> KEY_ZONE_NAME;
126 
127  static boost::shared_ptr<string> KEY_USER_NAME;
128 
129  static boost::shared_ptr<string> KEY_PASSWORD;
130 
131  static boost::shared_ptr<string> KEY_PARAMS;
132 
133  static boost::shared_ptr<string> KEY_PRIVILEGE_ID;
134 
135  static boost::shared_ptr<string> KEY_ID;
136 
137  static boost::shared_ptr<string> KEY_ROOMLIST;
138 
139  static boost::shared_ptr<string> KEY_RECONNECTION_SECONDS;
140 
141  protected:
142 
143  // -------------------------------------------------------------------
144  // Protected methods
145  // -------------------------------------------------------------------
146 
147  // -------------------------------------------------------------------
148  // Protected members
149  // -------------------------------------------------------------------
150 
151  private:
152 
153  // -------------------------------------------------------------------
154  // Private methods
155  // -------------------------------------------------------------------
156 
157  void Init(string userName, string password, string zoneName, boost::shared_ptr<ISFSObject> parameters);
158 
159  // -------------------------------------------------------------------
160  // Private members
161  // -------------------------------------------------------------------
162 
163  boost::shared_ptr<string> zoneName;
164  boost::shared_ptr<string> userName;
165  boost::shared_ptr<string> password;
166  boost::shared_ptr<ISFSObject> parameters;
167  };
168 
169 } // namespace Requests
170 } // namespace Sfs2X
171 
172 #endif
Definition: SFSCodecError.cpp:14
STL namespace.
Join one of the Zones in the Server.
Definition: LoginRequest.h:41
Definition: SmartFox.cpp:24
Definition: ISFSArray.h:17