Refactor INetworkDriver::PopEvent to use network event as output parameter rather than raw pointer

#1992
This commit is contained in:
Wojtek Figat
2023-11-28 11:24:17 +01:00
parent fd938e8284
commit 35ebdb0ffe
11 changed files with 51 additions and 55 deletions

View File

@@ -43,24 +43,28 @@ API_ENUM(Namespace="FlaxEngine.Networking") enum class NetworkEventType
API_STRUCT(Namespace="FlaxEngine.Networking") struct FLAXENGINE_API NetworkEvent
{
DECLARE_SCRIPTING_TYPE_MINIMAL(NetworkEvent);
public:
/// <summary>
/// The type of the received event.
/// </summary>
API_FIELD();
NetworkEventType EventType;
API_FIELD() NetworkEventType EventType;
/// <summary>
/// The message when this event is an "message" event - not valid in any other cases.
/// If this is an message-event, make sure to return the message using RecycleMessage function of the peer after processing it!
/// </summary>
API_FIELD();
NetworkMessage Message;
API_FIELD() NetworkMessage Message;
/// <summary>
/// The connected of the client that has sent message, connected, disconnected or got a timeout.
/// </summary>
/// <remarks>Only valid when event has been received on server-peer.</remarks>
API_FIELD();
NetworkConnection Sender;
API_FIELD() NetworkConnection Sender;
};
template<>
struct TIsPODType<NetworkEvent>
{
enum { Value = true };
};