Emergency 20 Dokumentation  4.2.0
NetworkHost.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 //[-------------------------------------------------------]
14 
15 
16 //[-------------------------------------------------------]
17 //[ Forward declarations ]
18 //[-------------------------------------------------------]
19 namespace qsf
20 {
21  namespace game
22  {
23  class Client;
24  }
25 }
26 
27 
28 //[-------------------------------------------------------]
29 //[ Namespace ]
30 //[-------------------------------------------------------]
31 namespace em5
32 {
33  namespace multiplayer
34  {
35  namespace client
36  {
37 
38 
39  //[-------------------------------------------------------]
40  //[ Classes ]
41  //[-------------------------------------------------------]
47  {
48 
49 
50  //[-------------------------------------------------------]
51  //[ Public methods ]
52  //[-------------------------------------------------------]
53  public:
58  explicit NetworkHost();
59 
64  virtual ~NetworkHost();
65 
66 
67  //[-------------------------------------------------------]
68  //[ Public virtual em5::multiplayer::client::HostBase methods ]
69  //[-------------------------------------------------------]
70  public:
71  virtual bool connect(const std::string& hostOrIpAddress, uint16 port) override;
72  virtual bool sendData(const qsf::game::BitStream& bitStream) override;
73  virtual void shutdown() override;
74 
75 
76  //[-------------------------------------------------------]
77  //[ Private methods ]
78  //[-------------------------------------------------------]
79  private:
80  void onGameClientConnected();
81  void onGameClientDisconnected();
82  void onGameClientUnexpectedDisconnected();
83  void onGameClientConnectFailed();
84  void onGameClientPacketReceived(const qsf::game::BitStream& bitStream, uint32 sequenceNumber);
85 
86 
87  //[-------------------------------------------------------]
88  //[ Private data ]
89  //[-------------------------------------------------------]
90  private:
91  qsf::game::Client* mClientConnection;
92 
93 
94  };
95 
96 
97 //[-------------------------------------------------------]
98 //[ Namespace ]
99 //[-------------------------------------------------------]
100  } // client
101  } // multiplayer
102 } // em5
Definition: ActionPriority.h:13
unsigned int uint32
Definition: PlatformTypes.h:181
EMERGENCY 5 multiplayer network host (client side multiplayer host instance)
Definition: NetworkHost.h:46
#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
Game bit stream class (just a wrapper for linnet bit stream)
Definition: BitStream.h:40
Definition: PickupPersonByParamedicAction.h:21
unsigned short uint16
Definition: PlatformTypes.h:178
Game client class.
Definition: Client.h:49