Rename interfaces for clarity

monroegm-disable-blank-issue-2
puvvadar 5 years ago
parent 03989f77bb
commit 6f4c0c2ce8

@ -45,14 +45,14 @@ namespace AzFramework
AZStd::string m_playerSessionId;
};
//! ISessionLocalUserRequests
//! Requests made to the local user to manage their connection to a session
class ISessionLocalUserRequests
//! ISessionHandlingClientRequests
//! Requests made to the client to manage their connection to a session
class ISessionHandlingClientRequests
{
public:
AZ_RTTI(ISessionLocalUserRequests, "{41DE6BD3-72BC-4443-BFF9-5B1B9396657A}");
ISessionLocalUserRequests() = default;
virtual ~ISessionLocalUserRequests() = default;
AZ_RTTI(ISessionHandlingClientRequests, "{41DE6BD3-72BC-4443-BFF9-5B1B9396657A}");
ISessionHandlingClientRequests() = default;
virtual ~ISessionHandlingClientRequests() = default;
// Request the player join session
// @param sessionConnectionConfig The required properties to handle the player join session process
@ -65,12 +65,12 @@ namespace AzFramework
//! ISessionProviderRequests
//! Requests made to the service providing server/fleet management by the server
class ISessionProviderRequests
class ISessionHandlingProviderRequests
{
public:
AZ_RTTI(ISessionProviderRequests, "{4F0C17BA-F470-4242-A8CB-EC7EA805257C}");
ISessionProviderRequests() = default;
virtual ~ISessionProviderRequests() = default;
AZ_RTTI(ISessionHandlingProviderRequests, "{4F0C17BA-F470-4242-A8CB-EC7EA805257C}");
ISessionHandlingProviderRequests() = default;
virtual ~ISessionHandlingProviderRequests() = default;
// Handle the destroy session process
virtual void HandleDestroySession() = 0;

@ -157,6 +157,7 @@ namespace Multiplayer
m_networkInterface = AZ::Interface<INetworking>::Get()->CreateNetworkInterface(AZ::Name(MPNetworkInterfaceName), sv_protocol, TrustZone::ExternalClientToServer, *this);
m_consoleCommandHandler.Connect(AZ::Interface<AZ::IConsole>::Get()->GetConsoleCommandInvokedEvent());
AZ::Interface<IMultiplayer>::Register(this);
AZ::Interface<AzFramework::ISessionHandlingClientRequests>::Register(this);
//! Register our gems multiplayer components to assign NetComponentIds
RegisterMultiplayerComponents();
@ -164,6 +165,7 @@ namespace Multiplayer
void MultiplayerSystemComponent::Deactivate()
{
AZ::Interface<AzFramework::ISessionHandlingClientRequests>::Unregister(this);
AZ::Interface<IMultiplayer>::Unregister(this);
AzFramework::SessionNotificationBus::Handler::BusDisconnect();
AZ::TickBus::Handler::BusDisconnect();
@ -195,14 +197,14 @@ namespace Multiplayer
bool MultiplayerSystemComponent::OnCreateSessionBegin(const AzFramework::SessionConfig& sessionConfig)
{
// Check if session manager has a certificate for us and pass it along if so
AZ::CVarFixedString externalCertPath = AZ::CVarFixedString(AZ::Interface<AzFramework::ISessionProviderRequests>::Get()->GetExternalSessionCertificate());
AZ::CVarFixedString externalCertPath = AZ::CVarFixedString(AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Get()->GetExternalSessionCertificate());
if (!externalCertPath.empty())
{
AZ::CVarFixedString commandString = "net_SslExternalCertificateFile " + externalCertPath;
AZ::Interface<AZ::IConsole>::Get()->PerformCommand(commandString.c_str());
}
AZ::CVarFixedString internalCertPath = AZ::CVarFixedString(AZ::Interface<AzFramework::ISessionProviderRequests>::Get()->GetInternalSessionCertificate());
AZ::CVarFixedString internalCertPath = AZ::CVarFixedString(AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Get()->GetInternalSessionCertificate());
if (!internalCertPath.empty())
{
AZ::CVarFixedString commandString = "net_SslInternalCertificateFile " + internalCertPath;
@ -533,7 +535,7 @@ namespace Multiplayer
AzFramework::PlayerConnectionConfig config;
config.m_playerConnectionId = aznumeric_cast<uint32_t>(connection->GetConnectionId());
config.m_playerSessionId = AZStd::to_string(config.m_playerConnectionId);
AZ::Interface<AzFramework::ISessionProviderRequests>::Get()->ValidatePlayerJoinSession(config);
AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Get()->ValidatePlayerJoinSession(config);
}
// Hosts will spawn a new default player prefab for the user that just connected
@ -610,7 +612,7 @@ namespace Multiplayer
AzFramework::PlayerConnectionConfig config;
config.m_playerConnectionId = aznumeric_cast<uint32_t>(connection->GetConnectionId());
config.m_playerSessionId = AZStd::to_string(config.m_playerConnectionId);
AZ::Interface<AzFramework::ISessionProviderRequests>::Get()->HandlePlayerLeaveSession(config);
AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Get()->HandlePlayerLeaveSession(config);
}
}
@ -620,7 +622,7 @@ namespace Multiplayer
{
if (m_networkInterface->GetConnectionSet().GetConnectionCount() == 0)
{
AZ::Interface<AzFramework::ISessionProviderRequests>::Get()->HandleDestroySession();
AZ::Interface<AzFramework::ISessionHandlingProviderRequests>::Get()->HandleDestroySession();
}
}
}

@ -46,7 +46,7 @@ namespace Multiplayer
: public AZ::Component
, public AZ::TickBus::Handler
, public AzFramework::SessionNotificationBus::Handler
, public AzFramework::ISessionLocalUserRequests
, public AzFramework::ISessionHandlingClientRequests
, public AzNetworking::IConnectionListener
, public IMultiplayer
{
@ -98,7 +98,7 @@ namespace Multiplayer
void OnDisconnect(AzNetworking::IConnection* connection, AzNetworking::DisconnectReason reason, AzNetworking::TerminationEndpoint endpoint) override;
//! @}
//! ISessionLocalUserRequests interface
//! ISessionHandlingClientRequests interface
//! @{
bool RequestPlayerJoinSession(const AzFramework::SessionConnectionConfig& sessionConnectionConfig) override;
void RequestPlayerLeaveSession() override;

Loading…
Cancel
Save