SmartFoxServer 2X C++ API
QuickJoinGameRequest.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of QuickJoinGameRequest
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __QuickJoinGameRequest__
12 #define __QuickJoinGameRequest__
13 
14 #include "../../Util/Common.h"
15 #include "../BaseRequest.h"
16 #include "../../Entities/Room.h"
17 #include "../../Entities/Match/MatchExpression.h"
18 
19 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
20 
21 #if defined(_MSC_VER)
22 #pragma warning(disable:4786) // STL library: disable warning 4786; this warning is generated due to a Microsoft bug
23 #endif
24 #include <list> // STL library: list object
25 #include <vector> // STL library: vector object
26 #include <string> // STL library: string object
27 using namespace std; // STL library: declare the STL namespace
28 
29 using namespace Sfs2X::Entities;
30 using namespace Sfs2X::Entities::Data;
31 using namespace Sfs2X::Entities::Match;
32 
33 namespace Sfs2X {
34 namespace Requests {
35 namespace Game {
36 
43  class DLLImportExport QuickJoinGameRequest : public BaseRequest
44  {
45  public:
46 
47  // -------------------------------------------------------------------
48  // Public methods
49  // -------------------------------------------------------------------
50 
54  QuickJoinGameRequest(boost::shared_ptr<MatchExpression> matchExpression, boost::shared_ptr<vector<string> > whereToSearch);
55 
103  QuickJoinGameRequest(boost::shared_ptr<MatchExpression> matchExpression, boost::shared_ptr<vector<string> > whereToSearch, boost::shared_ptr<Room> roomToLeave);
104 
108  QuickJoinGameRequest(boost::shared_ptr<MatchExpression> matchExpression, boost::shared_ptr<vector<boost::shared_ptr<Room> > > whereToSearch);
109 
121  QuickJoinGameRequest(boost::shared_ptr<MatchExpression> matchExpression, boost::shared_ptr<vector<boost::shared_ptr<Room> > > whereToSearch, boost::shared_ptr<Room> roomToLeave);
122 
123  virtual ~QuickJoinGameRequest();
124 
125  void Validate(boost::shared_ptr<SmartFox> sfs);
126 
127  void Execute (boost::shared_ptr<SmartFox> sfs);
128 
129  // -------------------------------------------------------------------
130  // Public members
131  // -------------------------------------------------------------------
132 
133  static const long int MAX_ROOMS;
134 
135  static boost::shared_ptr<string> KEY_ROOM_LIST;
136 
137  static boost::shared_ptr<string> KEY_GROUP_LIST;
138 
139  static boost::shared_ptr<string> KEY_ROOM_TO_LEAVE;
140 
141  static boost::shared_ptr<string> KEY_MATCH_EXPRESSION;
142 
143  protected:
144 
145  // -------------------------------------------------------------------
146  // Protected methods
147  // -------------------------------------------------------------------
148 
149  // -------------------------------------------------------------------
150  // Protected members
151  // -------------------------------------------------------------------
152 
153  private:
154 
155  // -------------------------------------------------------------------
156  // Private methods
157  // -------------------------------------------------------------------
158  void Init(boost::shared_ptr<MatchExpression> matchExpression, boost::shared_ptr<vector<string> > whereToSearch, boost::shared_ptr<Room> roomToLeave);
159  void Init(boost::shared_ptr<MatchExpression> matchExpression, boost::shared_ptr<vector<boost::shared_ptr<Room> > > whereToSearch, boost::shared_ptr<Room> roomToLeave);
160 
161  // -------------------------------------------------------------------
162  // Private members
163  // -------------------------------------------------------------------
164  boost::shared_ptr<vector<boost::shared_ptr<Room> > > whereToSearchRoom;
165  boost::shared_ptr<vector<string> > whereToSearchString;
166  boost::shared_ptr<MatchExpression> matchExpression;
167  boost::shared_ptr<Room> roomToLeave;
168 
169  bool isSearchListString;
170  bool isSearchListRoom;
171  };
172 
173 } // namespace Game
174 } // namespace Requests
175 } // namespace Sfs2X
176 
177 #endif
Quick join a User in a public game.
Definition: QuickJoinGameRequest.h:43
STL namespace.
Definition: BoolMatch.cpp:15
Definition: Buddy.h:30
Definition: SmartFox.cpp:24
Definition: ISFSArray.h:17