SmartFoxServer 2X C++ API
CreateSFSGameRequest.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of CreateSFSGameRequest
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __CreateSFSGameRequest__
12 #define __CreateSFSGameRequest__
13 
14 #include "../../Util/Common.h"
15 #include "../BaseRequest.h"
16 #include "../CreateRoomRequest.h"
17 #include "SFSGameSettings.h"
18 #include "InviteUsersRequest.h"
19 
20 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
21 
22 #if defined(_MSC_VER)
23 #pragma warning(disable:4786) // STL library: disable warning 4786; this warning is generated due to a Microsoft bug
24 #endif
25 #include <list> // STL library: list object
26 #include <string> // STL library: string object
27 using namespace std; // STL library: declare the STL namespace
28 
29 namespace Sfs2X {
30 namespace Requests {
31 namespace Game {
32 
42  class DLLImportExport CreateSFSGameRequest : public BaseRequest
43  {
44  public:
45 
46  // -------------------------------------------------------------------
47  // Public methods
48  // -------------------------------------------------------------------
49 
87  CreateSFSGameRequest(boost::shared_ptr<SFSGameSettings> settings);
88 
89  virtual ~CreateSFSGameRequest();
90 
91  void Validate(boost::shared_ptr<SmartFox> sfs);
92 
93  void Execute (boost::shared_ptr<SmartFox> sfs);
94 
95  // -------------------------------------------------------------------
96  // Public members
97  // -------------------------------------------------------------------
98 
99  static boost::shared_ptr<string> KEY_IS_PUBLIC;
100 
101  static boost::shared_ptr<string> KEY_MIN_PLAYERS;
102 
103  static boost::shared_ptr<string> KEY_INVITED_PLAYERS;
104 
105  static boost::shared_ptr<string> KEY_SEARCHABLE_ROOMS;
106 
107  static boost::shared_ptr<string> KEY_PLAYER_MATCH_EXP;
108 
109  static boost::shared_ptr<string> KEY_SPECTATOR_MATCH_EXP;
110 
111  static boost::shared_ptr<string> KEY_INVITATION_EXPIRY;
112 
113  static boost::shared_ptr<string> KEY_LEAVE_ROOM;
114 
115  static boost::shared_ptr<string> KEY_NOTIFY_GAME_STARTED;
116 
117  static boost::shared_ptr<string> KEY_INVITATION_PARAMS;
118 
119  protected:
120 
121  // -------------------------------------------------------------------
122  // Protected methods
123  // -------------------------------------------------------------------
124 
125  // -------------------------------------------------------------------
126  // Protected members
127  // -------------------------------------------------------------------
128 
129  private:
130 
131  // -------------------------------------------------------------------
132  // Private methods
133  // -------------------------------------------------------------------
134 
135  // -------------------------------------------------------------------
136  // Private members
137  // -------------------------------------------------------------------
138  boost::shared_ptr<CreateRoomRequest> createRoomRequest;
139  boost::shared_ptr<SFSGameSettings> settings;
140  };
141 
142 } // namespace Game
143 } // namespace Requests
144 } // namespace Sfs2X
145 
146 #endif
STL namespace.
The request launches a new public or private game, including game invitations, player matching and a ...
Definition: CreateSFSGameRequest.h:42
Definition: SmartFox.cpp:24