SmartFoxServer 2X C++ API
PlayerToSpectatorRequest.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of PlayerToSpectatorRequest
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __PlayerToSpectatorRequest__
12 #define __PlayerToSpectatorRequest__
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 namespace Sfs2X {
28 namespace Requests {
29 
36  class DLLImportExport PlayerToSpectatorRequest : public BaseRequest
37  {
38  public:
39 
40  // -------------------------------------------------------------------
41  // Public methods
42  // -------------------------------------------------------------------
47 
79  PlayerToSpectatorRequest(boost::shared_ptr<Room> targetRoom);
80 
81  virtual ~PlayerToSpectatorRequest();
82 
83  void Validate(boost::shared_ptr<SmartFox> sfs);
84 
85  void Execute (boost::shared_ptr<SmartFox> sfs);
86 
87  // -------------------------------------------------------------------
88  // Public members
89  // -------------------------------------------------------------------
90 
91  static boost::shared_ptr<string> KEY_ROOM_ID;
92 
93  static boost::shared_ptr<string> KEY_USER_ID;
94 
95  protected:
96 
97  // -------------------------------------------------------------------
98  // Protected methods
99  // -------------------------------------------------------------------
100 
101  // -------------------------------------------------------------------
102  // Protected members
103  // -------------------------------------------------------------------
104 
105  private:
106 
107  // -------------------------------------------------------------------
108  // Private methods
109  // -------------------------------------------------------------------
110  void Init(boost::shared_ptr<Room> targetRoom);
111 
112  // -------------------------------------------------------------------
113  // Private members
114  // -------------------------------------------------------------------
115  boost::shared_ptr<Room> room;
116  };
117 
118 } // namespace Requests
119 } // namespace Sfs2X
120 
121 #endif
STL namespace.
Attempt to turn the current User from Player to a Spectator (in a Game Room)
Definition: PlayerToSpectatorRequest.h:36
Definition: SmartFox.cpp:24