SmartFoxServer 2X C++ API
InviteUsersRequest.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of InviteUsersRequest
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __InviteUsersRequest__
12 #define __InviteUsersRequest__
13 
14 #include "../../Util/Common.h"
15 #include "../BaseRequest.h"
16 #include "../CreateRoomRequest.h"
17 #include "../../Entities/Invitation/Invitation.h"
18 #include "../../Entities/Invitation/InvitationReply.h"
19 #include "../../Entities/Data/ISFSObject.h"
20 #include "../../Entities/Buddy.h"
21 #include "../../Entities/User.h"
22 
23 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
24 
25 #if defined(_MSC_VER)
26 #pragma warning(disable:4786) // STL library: disable warning 4786; this warning is generated due to a Microsoft bug
27 #endif
28 #include <list> // STL library: list object
29 #include <string> // STL library: string object
30 using namespace std; // STL library: declare the STL namespace
31 
32 using namespace Sfs2X::Entities::Data;
33 using namespace Sfs2X::Entities::Invitation;
34 
35 namespace Sfs2X {
36 namespace Requests {
37 namespace Game {
38 
46  class DLLImportExport InviteUsersRequest : public BaseRequest
47  {
48  public:
49 
50  // -------------------------------------------------------------------
51  // Public methods
52  // -------------------------------------------------------------------
53 
115  InviteUsersRequest(boost::shared_ptr<list<boost::shared_ptr<User> > > invitedUsers, long int secondsForReply, boost::shared_ptr<ISFSObject> parameters);
116  InviteUsersRequest(boost::shared_ptr<list<boost::shared_ptr<Buddy> > > invitedUsers, long int secondsForReply, boost::shared_ptr<ISFSObject> parameters);
117 
118  virtual ~InviteUsersRequest();
119 
120  void Validate(boost::shared_ptr<SmartFox> sfs);
121 
122  void Execute (boost::shared_ptr<SmartFox> sfs);
123 
124  // -------------------------------------------------------------------
125  // Public members
126  // -------------------------------------------------------------------
127 
128  static boost::shared_ptr<string> KEY_USER;
129 
130  static boost::shared_ptr<string> KEY_USER_ID;
131 
132  static boost::shared_ptr<string> KEY_INVITATION_ID;
133 
134  static boost::shared_ptr<string> KEY_TIME;
135 
136  static boost::shared_ptr<string> KEY_PARAMS;
137 
138  static boost::shared_ptr<string> KEY_INVITEE_ID;
139 
140  static boost::shared_ptr<string> KEY_INVITED_USERS;
141 
142  static boost::shared_ptr<string> KEY_REPLY_ID;
143 
144  static const long int MAX_INVITATIONS_FROM_CLIENT_SIDE;
145  static const long int MIN_EXPIRY_TIME;
146  static const long int MAX_EXPIRY_TIME;
147 
148  protected:
149 
150  // -------------------------------------------------------------------
151  // Protected methods
152  // -------------------------------------------------------------------
153 
154  // -------------------------------------------------------------------
155  // Protected members
156  // -------------------------------------------------------------------
157 
158  private:
159 
160  // -------------------------------------------------------------------
161  // Private methods
162  // -------------------------------------------------------------------
163 
164  // -------------------------------------------------------------------
165  // Private members
166  // -------------------------------------------------------------------
167  boost::shared_ptr<list<boost::shared_ptr<User> > > invitedUsers;
168  boost::shared_ptr<list<boost::shared_ptr<Buddy> > > invitedBuddy;
169  long int secondsForAnswer;
170  boost::shared_ptr<ISFSObject> parameters;
171  };
172 
173 } // namespace Game
174 } // namespace Requests
175 } // namespace Sfs2X
176 
177 #endif
STL namespace.
Definition: Invitation.h:24
Definition: SmartFox.cpp:24
Send one or more generic invitations to a list of Users.
Definition: InviteUsersRequest.h:46
Definition: ISFSArray.h:17