Emergency 20 Dokumentation  4.2.0
MultiplayerProxyTypes.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"
14 
16 
17 
18 //[-------------------------------------------------------]
19 //[ Namespace ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23  namespace multiplayer
24  {
25  namespace proxy
26  {
27 
28 
29  //[-------------------------------------------------------]
30  //[ Global definitions ]
31  //[-------------------------------------------------------]
32  enum class MessageType : uint8
33  {
34  INVALID,
35  CREATESESSION, // Send by a connected client when it wants to create a session
36  CREATESESSION_RESPONSE, // Send to the connected client as response to its create a session request
37  CONNECTTOSESSION, // Send by a connected client when it wants to connect to an existing session
38  CONNECTTOSESSION_RESPONSE, // Send to the connected client as response to its connect to session request
39  DISCONNECT_FROM_CURRENT_SESSION, // Send by a connected client when it wants to disconnect from the current connected session
40  // Also send by the proxy when the current session gets terminated
41  CLIENT_CONNECTED_TO_SESSION, // Send to the session creator when an client connects to the session
42  CLIENT_DISCONNECT_FROM_SESSSION, // Send by the session creator when an client should be disconnected from the session.
43  // This message is also send by the proxy when the clients disconnects from the proxy while connected to a session or client sends disconnect from current session message
44  DATA, // Send by connected clients which are part of a session
45  // When the message comes from the session creator then this data is send to all session clients except the session creator
46  // When the message is send from a client which is not the session creator then the data is only send to the session creator
48  };
49 
51  {
52  SUCCESS,
56  };
57 
59  {
60  SUCCESS,
62  };
63 
72  struct DataBase
73  {
74  // TODO(sw) Currently empty
75  };
76 
77  struct CreateSessionData : public DataBase
78  {
79  // TODO(sw) Currently empty
80  };
81 
83  {
86  };
87 
89  {
91  };
92 
94  {
98  };
99 
101  {
102  uint8 mProxySessionClientId; // The id of the client known by the proxy which connected to a session
103  };
104 
106  {
107  uint8 mProxySessionClientId; // The id of the client known by the proxy which disconnected from a session
108  };
109 
110  struct DataData : public DataBase
111  {
112  uint8 mProxySessionClientId; // The id of the client known by the proxy to which the data should be send (qsf::getUninitialized value when all clients should get the data)
113  // When the data is send from a client then this value is the id of the sending client
115  };
116 
117 
118 //[-------------------------------------------------------]
119 //[ Namespace ]
120 //[-------------------------------------------------------]
121  } // proxy
122  } // multiplayer
123 } // em5
Definition: ActionPriority.h:13
ConnectionResultType mResult
Definition: MultiplayerProxyTypes.h:95
Definition: MultiplayerProxyTypes.h:77
Definition: MultiplayerProxyTypes.h:105
Base struct for proxy messages.
Definition: MultiplayerProxyTypes.h:72
CreateSessionResultType
Definition: MultiplayerProxyTypes.h:58
uint64 mSessionId
Definition: MultiplayerProxyTypes.h:85
uint8 mProxySessionClientId
Definition: MultiplayerProxyTypes.h:97
qsf::game::BitStream dataBitStream
Definition: MultiplayerProxyTypes.h:114
uint64 mSessionId
Definition: MultiplayerProxyTypes.h:90
uint64_t uint64
Definition: PlatformTypes.h:184
uint8 mProxySessionClientId
Definition: MultiplayerProxyTypes.h:102
uint64 mSessionId
Definition: MultiplayerProxyTypes.h:96
ConnectionResultType
Definition: MultiplayerProxyTypes.h:50
Game bit stream class (just a wrapper for linnet bit stream)
Definition: BitStream.h:40
uint8 mProxySessionClientId
Definition: MultiplayerProxyTypes.h:112
Definition: MultiplayerProxyTypes.h:82
MessageType
Definition: MultiplayerProxyTypes.h:32
Definition: MultiplayerProxyTypes.h:100
Definition: MultiplayerProxyTypes.h:110
CreateSessionResultType mResult
Definition: MultiplayerProxyTypes.h:84
Definition: MultiplayerProxyTypes.h:88
Definition: MultiplayerProxyTypes.h:93
unsigned char uint8
Definition: PlatformTypes.h:175
uint8 mProxySessionClientId
Definition: MultiplayerProxyTypes.h:107