Cleanup session changes and add on connection disconnected event

This commit is contained in:
puvvadar
2021-06-08 16:43:36 -07:00
parent fa55b495c4
commit cd5867d2fa
8 changed files with 76 additions and 25 deletions
@@ -45,6 +45,7 @@ namespace Multiplayer
AzNetworking::ByteBuffer<2048> m_userData;
};
using ClientDisconnectedEvent = AZ::Event<>;
using ConnectionAcquiredEvent = AZ::Event<MultiplayerAgentDatum>;
using SessionInitEvent = AZ::Event<AzNetworking::INetworkInterface*>;
using SessionShutdownEvent = AZ::Event<AzNetworking::INetworkInterface*>;
@@ -65,8 +66,12 @@ namespace Multiplayer
//! @param state The state of this connection
virtual void InitializeMultiplayer(MultiplayerAgentType state) = 0;
//! Adds a ClientDisconnectedEvent Handler which is invoked on the client when a disconnectio occurs
//! @param handler The ClientDisconnectedEvent Handler to add
virtual void AddClientDisconnectedHandler(ClientDisconnectedEvent::Handler& handler) = 0;
//! Adds a ConnectionAcquiredEvent Handler which is invoked when a new endpoint connects to the session.
//! @param handler The SessionInitEvent Handler to add
//! @param handler The ConnectionAcquiredEvent Handler to add
virtual void AddConnectionAcquiredHandler(ConnectionAcquiredEvent::Handler& handler) = 0;
//! Adds a SessionInitEvent Handler which is invoked when a new network session starts.