Emergency 20 Dokumentation  4.2.0
ProxyHost.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
13 #include "em5/Export.h"
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23  namespace multiplayer
24  {
25  namespace proxy
26  {
28  }
29  }
30 }
31 
32 
33 //[-------------------------------------------------------]
34 //[ Namespace ]
35 //[-------------------------------------------------------]
36 namespace em5
37 {
38  namespace multiplayer
39  {
40  namespace client
41  {
42 
43 
44  //[-------------------------------------------------------]
45  //[ Classes ]
46  //[-------------------------------------------------------]
52  {
53 
54 
55  //[-------------------------------------------------------]
56  //[ Public methods ]
57  //[-------------------------------------------------------]
58  public:
63  explicit ProxyHost(proxy::MultiplayerProxyClient& connection, uint64 sessionId);
64 
69  virtual ~ProxyHost();
70 
71 
72  //[-------------------------------------------------------]
73  //[ Public virtual em5::multiplayer::client::HostBase methods ]
74  //[-------------------------------------------------------]
75  public:
76  virtual bool connect(const std::string& hostOrIpAddress, uint16 port) override;
77  virtual bool sendData(const qsf::game::BitStream& bitStream) override;
78  virtual void shutdown() override;
79 
80 
81  //[-------------------------------------------------------]
82  //[ Private methods ]
83  //[-------------------------------------------------------]
84  private:
85  void onGameClientPacketReceived(const proxy::DataData& data);
86  void onConnectedToSession(proxy::ConnectionResultType result);
87  void onDisconnected();
88 
89 
90  //[-------------------------------------------------------]
91  //[ Private data ]
92  //[-------------------------------------------------------]
93  private:
94  proxy::MultiplayerProxyClient& mClientConnection;
95  uint64 mProxySessionId; //< Holds the session id to which the proxy host should connect to
96 
97  boost::signals2::connection mReceivedDataConnection;
98  boost::signals2::connection mConnectedConnection;
99  boost::signals2::connection mDisconnectedConnection;
100 
101 
102  };
103 
104 
105 //[-------------------------------------------------------]
106 //[ Namespace ]
107 //[-------------------------------------------------------]
108  } // client
109  } // multiplayer
110 } // em5
Definition: ActionPriority.h:13
#define EM5_API_EXPORT
Definition: Export.h:28
EMERGENCY 5 multiplayer host base class (represents an host on the client side)
Definition: HostBase.h:50
uint64_t uint64
Definition: PlatformTypes.h:184
ConnectionResultType
Definition: MultiplayerProxyTypes.h:50
Game bit stream class (just a wrapper for linnet bit stream)
Definition: BitStream.h:40
EMERGENCY 5 multiplayer network host via proxy (client side multiplayer host instance) ...
Definition: ProxyHost.h:51
unsigned short uint16
Definition: PlatformTypes.h:178
Definition: MultiplayerProxyTypes.h:110
EMERGENCY 5 multiplayer proxy client class.
Definition: MultiplayerProxyClient.h:37