SmartFoxServer 2X C++ API
SpectatorToPlayerRequest.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of SpectatorToPlayerRequest
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __SpectatorToPlayerRequest__
12 #define __SpectatorToPlayerRequest__
13 
14 #include "../Util/Common.h"
15 #include "BaseRequest.h"
16 #include "../Entities/Room.h"
17 
18 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
19 
20 #if defined(_MSC_VER)
21 #pragma warning(disable:4786) // STL library: disable warning 4786; this warning is generated due to a Microsoft bug
22 #endif
23 #include <list> // STL library: list object
24 #include <string> // STL library: string object
25 using namespace std; // STL library: declare the STL namespace
26 
27 using namespace Sfs2X::Entities;
28 
29 namespace Sfs2X {
30 namespace Requests {
31 
38  class DLLImportExport SpectatorToPlayerRequest : public BaseRequest
39  {
40  public:
41 
42  // -------------------------------------------------------------------
43  // Public methods
44  // -------------------------------------------------------------------
45 
50 
82  SpectatorToPlayerRequest(boost::shared_ptr<Room> targetRoom);
83 
84  virtual ~SpectatorToPlayerRequest();
85 
86  void Validate(boost::shared_ptr<SmartFox> sfs);
87 
88  void Execute (boost::shared_ptr<SmartFox> sfs);
89 
90  // -------------------------------------------------------------------
91  // Public members
92  // -------------------------------------------------------------------
93 
94  static boost::shared_ptr<string> KEY_ROOM_ID;
95 
96  static boost::shared_ptr<string> KEY_USER_ID;
97 
98  static boost::shared_ptr<string> KEY_PLAYER_ID;
99 
100  protected:
101 
102  // -------------------------------------------------------------------
103  // Protected methods
104  // -------------------------------------------------------------------
105 
106  // -------------------------------------------------------------------
107  // Protected members
108  // -------------------------------------------------------------------
109 
110  private:
111 
112  // -------------------------------------------------------------------
113  // Private methods
114  // -------------------------------------------------------------------
115  void Init(boost::shared_ptr<Room> targetRoom);
116 
117  // -------------------------------------------------------------------
118  // Private members
119  // -------------------------------------------------------------------
120  boost::shared_ptr<Room> room;
121  };
122 
123 } // namespace Requests
124 } // namespace Sfs2X
125 
126 #endif
Attempt to turn the current User from Spectator into a Player (in a Game Room)
Definition: SpectatorToPlayerRequest.h:38
STL namespace.
Definition: Buddy.h:30
Definition: SmartFox.cpp:24