From 74a876ae3becf56bf522084989189465bff5567b Mon Sep 17 00:00:00 2001 From: Vincent Liu <5900509+onecent1101@users.noreply.github.com> Date: Thu, 3 Feb 2022 11:53:00 -0800 Subject: [PATCH] Move multiplayer session interface out of AzFramework library (#7338) Signed-off-by: onecent1101 --- .../AzFramework/azframework_files.cmake | 11 -- .../Code/AWSGameLiftClient/CMakeLists.txt | 4 +- .../Request/AWSGameLiftAcceptMatchRequest.h | 6 +- .../AWSGameLiftCreateSessionOnQueueRequest.h | 6 +- .../Request/AWSGameLiftCreateSessionRequest.h | 6 +- .../Request/AWSGameLiftJoinSessionRequest.h | 6 +- .../AWSGameLiftMatchmakingRequestBus.h | 6 +- .../AWSGameLiftSearchSessionsRequest.h | 6 +- .../Request/AWSGameLiftSessionRequestBus.h | 6 +- .../AWSGameLiftStartMatchmakingRequest.h | 6 +- .../AWSGameLiftStopMatchmakingRequest.h | 6 +- .../AWSGameLiftClientLocalTicketTracker.cpp | 20 ++-- .../Source/AWSGameLiftClientManager.cpp | 104 +++++++++--------- .../Source/AWSGameLiftClientManager.h | 34 +++--- .../AWSGameLiftClientSystemComponent.cpp | 52 ++++----- .../AWSGameLiftAcceptMatchActivity.cpp | 2 +- .../Activity/AWSGameLiftAcceptMatchActivity.h | 2 +- .../AWSGameLiftCreateSessionActivity.cpp | 2 +- .../AWSGameLiftCreateSessionActivity.h | 2 +- ...WSGameLiftCreateSessionOnQueueActivity.cpp | 2 +- .../AWSGameLiftCreateSessionOnQueueActivity.h | 2 +- .../AWSGameLiftJoinSessionActivity.cpp | 10 +- .../Activity/AWSGameLiftJoinSessionActivity.h | 6 +- .../AWSGameLiftLeaveSessionActivity.cpp | 4 +- .../AWSGameLiftSearchSessionsActivity.cpp | 14 +-- .../AWSGameLiftSearchSessionsActivity.h | 8 +- .../AWSGameLiftStartMatchmakingActivity.cpp | 2 +- .../AWSGameLiftStartMatchmakingActivity.h | 2 +- .../AWSGameLiftStopMatchmakingActivity.cpp | 2 +- .../AWSGameLiftStopMatchmakingActivity.h | 2 +- .../Request/AWSGameLiftAcceptMatchRequest.cpp | 6 +- ...AWSGameLiftCreateSessionOnQueueRequest.cpp | 2 +- .../AWSGameLiftCreateSessionRequest.cpp | 2 +- .../Request/AWSGameLiftJoinSessionRequest.cpp | 6 +- .../AWSGameLiftSearchSessionsRequest.cpp | 8 +- .../AWSGameLiftStartMatchmakingRequest.cpp | 6 +- .../AWSGameLiftStopMatchmakingRequest.cpp | 6 +- .../Tests/AWSGameLiftClientManagerTest.cpp | 32 +++--- .../Tests/AWSGameLiftClientMocks.h | 36 +++--- .../AWSGameLiftAcceptMatchActivityTest.cpp | 2 +- .../AWSGameLiftCreateSessionActivityTest.cpp | 2 +- ...meLiftCreateSessionOnQueueActivityTest.cpp | 2 +- .../AWSGameLiftJoinSessionActivityTest.cpp | 4 +- .../AWSGameLiftSearchSessionsActivityTest.cpp | 4 +- ...WSGameLiftStartMatchmakingActivityTest.cpp | 2 +- ...AWSGameLiftStopMatchmakingActivityTest.cpp | 2 +- .../Code/AWSGameLiftServer/CMakeLists.txt | 4 +- .../Source/AWSGameLiftServerManager.cpp | 40 +++---- .../Source/AWSGameLiftServerManager.h | 14 +-- .../Tests/AWSGameLiftServerManagerTest.cpp | 62 +++++------ .../Tests/AWSGameLiftServerMocks.h | 2 +- .../Session}/IMatchmakingRequests.h | 6 +- .../Session/ISessionHandlingRequests.h | 4 +- .../Multiplayer}/Session/ISessionRequests.h | 6 +- .../Session}/MatchmakingNotifications.h | 4 +- .../Session}/MatchmakingRequests.h | 4 +- .../Multiplayer}/Session/SessionConfig.h | 4 +- .../Session/SessionNotifications.h | 4 +- .../Multiplayer}/Session/SessionRequests.h | 4 +- .../Source/MultiplayerSystemComponent.cpp | 40 +++---- .../Code/Source/MultiplayerSystemComponent.h | 16 +-- .../Source/Session}/MatchmakingRequests.cpp | 6 +- .../Code/Source}/Session/SessionConfig.cpp | 34 +++--- .../Code/Source}/Session/SessionRequests.cpp | 8 +- Gems/Multiplayer/Code/multiplayer_files.cmake | 11 ++ 65 files changed, 368 insertions(+), 368 deletions(-) rename {Code/Framework/AzFramework/AzFramework/Matchmaking => Gems/Multiplayer/Code/Include/Multiplayer/Session}/IMatchmakingRequests.h (97%) rename {Code/Framework/AzFramework/AzFramework => Gems/Multiplayer/Code/Include/Multiplayer}/Session/ISessionHandlingRequests.h (98%) rename {Code/Framework/AzFramework/AzFramework => Gems/Multiplayer/Code/Include/Multiplayer}/Session/ISessionRequests.h (97%) rename {Code/Framework/AzFramework/AzFramework/Matchmaking => Gems/Multiplayer/Code/Include/Multiplayer/Session}/MatchmakingNotifications.h (97%) rename {Code/Framework/AzFramework/AzFramework/Matchmaking => Gems/Multiplayer/Code/Include/Multiplayer/Session}/MatchmakingRequests.h (97%) rename {Code/Framework/AzFramework/AzFramework => Gems/Multiplayer/Code/Include/Multiplayer}/Session/SessionConfig.h (97%) rename {Code/Framework/AzFramework/AzFramework => Gems/Multiplayer/Code/Include/Multiplayer}/Session/SessionNotifications.h (98%) rename {Code/Framework/AzFramework/AzFramework => Gems/Multiplayer/Code/Include/Multiplayer}/Session/SessionRequests.h (98%) rename {Code/Framework/AzFramework/AzFramework/Matchmaking => Gems/Multiplayer/Code/Source/Session}/MatchmakingRequests.cpp (97%) rename {Code/Framework/AzFramework/AzFramework => Gems/Multiplayer/Code/Source}/Session/SessionConfig.cpp (85%) rename {Code/Framework/AzFramework/AzFramework => Gems/Multiplayer/Code/Source}/Session/SessionRequests.cpp (97%) diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 9693d75b06..4b45880c56 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -165,10 +165,6 @@ set(FILES Logging/MissingAssetLogger.cpp Logging/MissingAssetLogger.h Logging/MissingAssetNotificationBus.h - Matchmaking/IMatchmakingRequests.h - Matchmaking/MatchmakingRequests.cpp - Matchmaking/MatchmakingRequests.h - Matchmaking/MatchmakingNotifications.h Scene/Scene.h Scene/Scene.inl Scene/Scene.cpp @@ -182,13 +178,6 @@ set(FILES Script/ScriptDebugMsgReflection.h Script/ScriptRemoteDebugging.cpp Script/ScriptRemoteDebugging.h - Session/ISessionHandlingRequests.h - Session/ISessionRequests.h - Session/SessionRequests.cpp - Session/SessionRequests.h - Session/SessionConfig.cpp - Session/SessionConfig.h - Session/SessionNotifications.h StreamingInstall/StreamingInstall.h StreamingInstall/StreamingInstall.cpp StreamingInstall/StreamingInstallRequests.h diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/CMakeLists.txt b/Gems/AWSGameLift/Code/AWSGameLiftClient/CMakeLists.txt index bdc831c439..4435637c4b 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/CMakeLists.txt +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/CMakeLists.txt @@ -24,8 +24,8 @@ ly_add_target( BUILD_DEPENDENCIES PRIVATE AZ::AzCore - AZ::AzFramework Gem::AWSCore + Gem::Multiplayer.Static 3rdParty::AWSNativeSDK::GameLiftClient ) @@ -85,10 +85,10 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzCore - AZ::AzFramework AZ::AzTest Gem::AWSCore Gem::AWSGameLift.Client.Static + Gem::Multiplayer.Static 3rdParty::AWSNativeSDK::GameLiftClient AZ::AWSNativeSDKTestLibs ) diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftAcceptMatchRequest.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftAcceptMatchRequest.h index 415550b6bc..f5f2c6d04d 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftAcceptMatchRequest.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftAcceptMatchRequest.h @@ -8,7 +8,7 @@ #pragma once -#include +#include namespace AWSGameLift { @@ -17,10 +17,10 @@ namespace AWSGameLift //! Registers a player's acceptance or rejection of a proposed FlexMatch match. //! AcceptMatchRequest struct AWSGameLiftAcceptMatchRequest - : public AzFramework::AcceptMatchRequest + : public Multiplayer::AcceptMatchRequest { public: - AZ_RTTI(AWSGameLiftAcceptMatchRequest, "{8372B297-88E8-4C13-B31D-BE87236CA416}", AzFramework::AcceptMatchRequest); + AZ_RTTI(AWSGameLiftAcceptMatchRequest, "{8372B297-88E8-4C13-B31D-BE87236CA416}", Multiplayer::AcceptMatchRequest); static void Reflect(AZ::ReflectContext* context); AWSGameLiftAcceptMatchRequest() = default; diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftCreateSessionOnQueueRequest.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftCreateSessionOnQueueRequest.h index 24dfce1dfa..f867516427 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftCreateSessionOnQueueRequest.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftCreateSessionOnQueueRequest.h @@ -8,7 +8,7 @@ #pragma once -#include +#include namespace AWSGameLift { @@ -16,10 +16,10 @@ namespace AWSGameLift //! GameLift create session on queue request which corresponds to Amazon GameLift //! StartGameSessionPlacement struct AWSGameLiftCreateSessionOnQueueRequest - : public AzFramework::CreateSessionRequest + : public Multiplayer::CreateSessionRequest { public: - AZ_RTTI(AWSGameLiftCreateSessionOnQueueRequest, "{2B99E594-CE81-4EB0-8888-74EF4242B59F}", AzFramework::CreateSessionRequest); + AZ_RTTI(AWSGameLiftCreateSessionOnQueueRequest, "{2B99E594-CE81-4EB0-8888-74EF4242B59F}", Multiplayer::CreateSessionRequest); static void Reflect(AZ::ReflectContext* context); AWSGameLiftCreateSessionOnQueueRequest() = default; diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftCreateSessionRequest.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftCreateSessionRequest.h index 97ffd0b321..908efe6454 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftCreateSessionRequest.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftCreateSessionRequest.h @@ -8,7 +8,7 @@ #pragma once -#include +#include namespace AWSGameLift { @@ -16,10 +16,10 @@ namespace AWSGameLift //! GameLift create session on fleet request which corresponds to Amazon GameLift //! CreateGameSessionRequest struct AWSGameLiftCreateSessionRequest - : public AzFramework::CreateSessionRequest + : public Multiplayer::CreateSessionRequest { public: - AZ_RTTI(AWSGameLiftCreateSessionRequest, "{69612D5D-F899-4DEB-AD63-4C497ABC5C0D}", AzFramework::CreateSessionRequest); + AZ_RTTI(AWSGameLiftCreateSessionRequest, "{69612D5D-F899-4DEB-AD63-4C497ABC5C0D}", Multiplayer::CreateSessionRequest); static void Reflect(AZ::ReflectContext* context); AWSGameLiftCreateSessionRequest() = default; diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftJoinSessionRequest.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftJoinSessionRequest.h index 07d6da3870..2794c5cdd9 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftJoinSessionRequest.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftJoinSessionRequest.h @@ -8,7 +8,7 @@ #pragma once -#include +#include namespace AWSGameLift { @@ -17,10 +17,10 @@ namespace AWSGameLift //! Once player session has been created successfully in game session, gamelift client manager will //! signal Multiplayer Gem to setup networking connection. struct AWSGameLiftJoinSessionRequest - : public AzFramework::JoinSessionRequest + : public Multiplayer::JoinSessionRequest { public: - AZ_RTTI(AWSGameLiftJoinSessionRequest, "{6EED6D15-531A-4956-90D0-2EDA31AC9CBA}", AzFramework::JoinSessionRequest); + AZ_RTTI(AWSGameLiftJoinSessionRequest, "{6EED6D15-531A-4956-90D0-2EDA31AC9CBA}", Multiplayer::JoinSessionRequest); static void Reflect(AZ::ReflectContext* context); AWSGameLiftJoinSessionRequest() = default; diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftMatchmakingRequestBus.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftMatchmakingRequestBus.h index 8ab215d741..20fa08e950 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftMatchmakingRequestBus.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftMatchmakingRequestBus.h @@ -10,7 +10,7 @@ #include #include -#include +#include namespace AWSGameLift { @@ -23,7 +23,7 @@ namespace AWSGameLift static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; }; - using AWSGameLiftMatchmakingAsyncRequestBus = AZ::EBus; + using AWSGameLiftMatchmakingAsyncRequestBus = AZ::EBus; // IMatchmakingRequests EBus wrapper class AWSGameLiftMatchmakingRequests @@ -34,7 +34,7 @@ namespace AWSGameLift static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; }; - using AWSGameLiftMatchmakingRequestBus = AZ::EBus; + using AWSGameLiftMatchmakingRequestBus = AZ::EBus; //! IAWSGameLiftMatchmakingEventRequests //! GameLift Gem matchmaking event interfaces which is used to track matchmaking ticket event diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftSearchSessionsRequest.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftSearchSessionsRequest.h index 02f3638998..834e6c6d22 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftSearchSessionsRequest.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftSearchSessionsRequest.h @@ -8,7 +8,7 @@ #pragma once -#include +#include namespace AWSGameLift { @@ -16,10 +16,10 @@ namespace AWSGameLift //! GameLift search sessions request which corresponds to Amazon GameLift //! SearchSessionsRequest struct AWSGameLiftSearchSessionsRequest - : public AzFramework::SearchSessionsRequest + : public Multiplayer::SearchSessionsRequest { public: - AZ_RTTI(AWSGameLiftSearchSessionsRequest, "{864C91C0-CA53-4585-BF07-066C0DF3E198}", AzFramework::SearchSessionsRequest); + AZ_RTTI(AWSGameLiftSearchSessionsRequest, "{864C91C0-CA53-4585-BF07-066C0DF3E198}", Multiplayer::SearchSessionsRequest); static void Reflect(AZ::ReflectContext* context); AWSGameLiftSearchSessionsRequest() = default; diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftSessionRequestBus.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftSessionRequestBus.h index c99509ca3f..3c6c9135bc 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftSessionRequestBus.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftSessionRequestBus.h @@ -10,7 +10,7 @@ #include #include -#include +#include namespace AWSGameLift { @@ -23,7 +23,7 @@ namespace AWSGameLift static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; }; - using AWSGameLiftSessionAsyncRequestBus = AZ::EBus; + using AWSGameLiftSessionAsyncRequestBus = AZ::EBus; // ISessionRequests EBus wrapper class AWSGameLiftSessionRequests @@ -34,5 +34,5 @@ namespace AWSGameLift static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; }; - using AWSGameLiftSessionRequestBus = AZ::EBus; + using AWSGameLiftSessionRequestBus = AZ::EBus; } // namespace AWSGameLift diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftStartMatchmakingRequest.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftStartMatchmakingRequest.h index b2060032e8..295e966e88 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftStartMatchmakingRequest.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftStartMatchmakingRequest.h @@ -10,7 +10,7 @@ #include #include -#include +#include #include @@ -21,10 +21,10 @@ namespace AWSGameLift //! Uses FlexMatch to create a game match for a group of players based on custom matchmaking rules //! StartMatchmakingRequest struct AWSGameLiftStartMatchmakingRequest - : public AzFramework::StartMatchmakingRequest + : public Multiplayer::StartMatchmakingRequest { public: - AZ_RTTI(AWSGameLiftStartMatchmakingRequest, "{D273DF71-9C55-48C1-95F9-8D7B66B9CF3E}", AzFramework::StartMatchmakingRequest); + AZ_RTTI(AWSGameLiftStartMatchmakingRequest, "{D273DF71-9C55-48C1-95F9-8D7B66B9CF3E}", Multiplayer::StartMatchmakingRequest); static void Reflect(AZ::ReflectContext* context); AWSGameLiftStartMatchmakingRequest() = default; diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftStopMatchmakingRequest.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftStopMatchmakingRequest.h index 81d811d32d..3fb9c2a1a9 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftStopMatchmakingRequest.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Include/Request/AWSGameLiftStopMatchmakingRequest.h @@ -8,7 +8,7 @@ #pragma once -#include +#include namespace AWSGameLift { @@ -17,10 +17,10 @@ namespace AWSGameLift //! Cancels a matchmaking ticket or match backfill ticket that is currently being processed. //! StopMatchmakingRequest struct AWSGameLiftStopMatchmakingRequest - : public AzFramework::StopMatchmakingRequest + : public Multiplayer::StopMatchmakingRequest { public: - AZ_RTTI(AWSGameLiftStopMatchmakingRequest, "{2766BC03-9F84-4346-A52B-49129BBAF38B}", AzFramework::StopMatchmakingRequest); + AZ_RTTI(AWSGameLiftStopMatchmakingRequest, "{2766BC03-9F84-4346-A52B-49129BBAF38B}", Multiplayer::StopMatchmakingRequest); static void Reflect(AZ::ReflectContext* context); AWSGameLiftStopMatchmakingRequest() = default; diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientLocalTicketTracker.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientLocalTicketTracker.cpp index 2e978402cd..969f00de0e 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientLocalTicketTracker.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientLocalTicketTracker.cpp @@ -9,8 +9,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -97,7 +97,7 @@ namespace AWSGameLift AZ_TracePrintf(AWSGameLiftClientLocalTicketTrackerName, "Matchmaking ticket %s is complete.", ticket.GetTicketId().c_str()); RequestPlayerJoinMatch(ticket, playerId); - AzFramework::MatchmakingNotificationBus::Broadcast(&AzFramework::MatchmakingNotifications::OnMatchComplete); + Multiplayer::MatchmakingNotificationBus::Broadcast(&Multiplayer::MatchmakingNotifications::OnMatchComplete); m_status = TicketTrackerStatus::Idle; return; } @@ -107,7 +107,7 @@ namespace AWSGameLift { AZ_Warning(AWSGameLiftClientLocalTicketTrackerName, false, "Matchmaking ticket %s is not complete, %s", ticket.GetTicketId().c_str(), ticket.GetStatusMessage().c_str()); - AzFramework::MatchmakingNotificationBus::Broadcast(&AzFramework::MatchmakingNotifications::OnMatchFailure); + Multiplayer::MatchmakingNotificationBus::Broadcast(&Multiplayer::MatchmakingNotifications::OnMatchFailure); m_status = TicketTrackerStatus::Idle; return; } @@ -115,7 +115,7 @@ namespace AWSGameLift { AZ_TracePrintf(AWSGameLiftClientLocalTicketTrackerName, "Matchmaking ticket %s is pending on acceptance, %s.", ticket.GetTicketId().c_str(), ticket.GetStatusMessage().c_str()); - AzFramework::MatchmakingNotificationBus::Broadcast(&AzFramework::MatchmakingNotifications::OnMatchAcceptance); + Multiplayer::MatchmakingNotificationBus::Broadcast(&Multiplayer::MatchmakingNotifications::OnMatchAcceptance); } else { @@ -126,7 +126,7 @@ namespace AWSGameLift else { AZ_Error(AWSGameLiftClientLocalTicketTrackerName, false, "Unable to find expected ticket with id %s", ticketId.c_str()); - AzFramework::MatchmakingNotificationBus::Broadcast(&AzFramework::MatchmakingNotifications::OnMatchError); + Multiplayer::MatchmakingNotificationBus::Broadcast(&Multiplayer::MatchmakingNotifications::OnMatchError); } } else @@ -134,13 +134,13 @@ namespace AWSGameLift AZ_Error(AWSGameLiftClientLocalTicketTrackerName, false, AWSGameLiftErrorMessageTemplate, describeMatchmakingOutcome.GetError().GetExceptionName().c_str(), describeMatchmakingOutcome.GetError().GetMessage().c_str()); - AzFramework::MatchmakingNotificationBus::Broadcast(&AzFramework::MatchmakingNotifications::OnMatchError); + Multiplayer::MatchmakingNotificationBus::Broadcast(&Multiplayer::MatchmakingNotifications::OnMatchError); } } else { AZ_Error(AWSGameLiftClientLocalTicketTrackerName, false, AWSGameLiftClientMissingErrorMessage); - AzFramework::MatchmakingNotificationBus::Broadcast(&AzFramework::MatchmakingNotifications::OnMatchError); + Multiplayer::MatchmakingNotificationBus::Broadcast(&Multiplayer::MatchmakingNotifications::OnMatchError); } m_waitEvent.try_acquire_for(AZStd::chrono::milliseconds(m_pollingPeriodInMS)); } @@ -150,7 +150,7 @@ namespace AWSGameLift const Aws::GameLift::Model::MatchmakingTicket& ticket, const AZStd::string& playerId) { auto connectionInfo = ticket.GetGameSessionConnectionInfo(); - AzFramework::SessionConnectionConfig sessionConnectionConfig; + Multiplayer::SessionConnectionConfig sessionConnectionConfig; sessionConnectionConfig.m_ipAddress = connectionInfo.GetIpAddress().c_str(); for (auto matchedPlayer : connectionInfo.GetMatchedPlayerSessions()) { @@ -168,7 +168,7 @@ namespace AWSGameLift "Requesting and validating player session %s to connect to the match ...", sessionConnectionConfig.m_playerSessionId.c_str()); bool result = - AZ::Interface::Get()->RequestPlayerJoinSession(sessionConnectionConfig); + AZ::Interface::Get()->RequestPlayerJoinSession(sessionConnectionConfig); if (result) { AZ_TracePrintf(AWSGameLiftClientLocalTicketTrackerName, diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientManager.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientManager.cpp index f900310078..1134481f96 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientManager.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientManager.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include @@ -42,32 +42,32 @@ namespace AWSGameLift AZ::Interface::Register(this); AWSGameLiftRequestBus::Handler::BusConnect(); - AZ::Interface::Register(this); + AZ::Interface::Register(this); AWSGameLiftSessionAsyncRequestBus::Handler::BusConnect(); - AZ::Interface::Register(this); + AZ::Interface::Register(this); AWSGameLiftSessionRequestBus::Handler::BusConnect(); - AZ::Interface::Register(this); + AZ::Interface::Register(this); AWSGameLiftMatchmakingAsyncRequestBus::Handler::BusConnect(); - AZ::Interface::Register(this); + AZ::Interface::Register(this); AWSGameLiftMatchmakingRequestBus::Handler::BusConnect(); } void AWSGameLiftClientManager::DeactivateManager() { AWSGameLiftMatchmakingRequestBus::Handler::BusDisconnect(); - AZ::Interface::Unregister(this); + AZ::Interface::Unregister(this); AWSGameLiftMatchmakingAsyncRequestBus::Handler::BusDisconnect(); - AZ::Interface::Unregister(this); + AZ::Interface::Unregister(this); AWSGameLiftSessionRequestBus::Handler::BusDisconnect(); - AZ::Interface::Unregister(this); + AZ::Interface::Unregister(this); AWSGameLiftSessionAsyncRequestBus::Handler::BusDisconnect(); - AZ::Interface::Unregister(this); + AZ::Interface::Unregister(this); AWSGameLiftRequestBus::Handler::BusDisconnect(); AZ::Interface::Unregister(this); @@ -133,7 +133,7 @@ namespace AWSGameLift return AZ::Uuid::CreateRandom().ToString(includeBrackets, includeDashes); } - void AWSGameLiftClientManager::AcceptMatch(const AzFramework::AcceptMatchRequest& acceptMatchRequest) + void AWSGameLiftClientManager::AcceptMatch(const Multiplayer::AcceptMatchRequest& acceptMatchRequest) { if (AcceptMatchActivity::ValidateAcceptMatchRequest(acceptMatchRequest)) { @@ -143,12 +143,12 @@ namespace AWSGameLift } } - void AWSGameLiftClientManager::AcceptMatchAsync(const AzFramework::AcceptMatchRequest& acceptMatchRequest) + void AWSGameLiftClientManager::AcceptMatchAsync(const Multiplayer::AcceptMatchRequest& acceptMatchRequest) { if (!AcceptMatchActivity::ValidateAcceptMatchRequest(acceptMatchRequest)) { - AzFramework::MatchmakingAsyncRequestNotificationBus::Broadcast( - &AzFramework::MatchmakingAsyncRequestNotifications::OnAcceptMatchAsyncComplete); + Multiplayer::MatchmakingAsyncRequestNotificationBus::Broadcast( + &Multiplayer::MatchmakingAsyncRequestNotifications::OnAcceptMatchAsyncComplete); return; } @@ -161,15 +161,15 @@ namespace AWSGameLift { AcceptMatchActivity::AcceptMatch(gameliftStartMatchmakingRequest); - AzFramework::MatchmakingAsyncRequestNotificationBus::Broadcast( - &AzFramework::MatchmakingAsyncRequestNotifications::OnAcceptMatchAsyncComplete); + Multiplayer::MatchmakingAsyncRequestNotificationBus::Broadcast( + &Multiplayer::MatchmakingAsyncRequestNotifications::OnAcceptMatchAsyncComplete); }, true, jobContext); acceptMatchJob->Start(); } - AZStd::string AWSGameLiftClientManager::CreateSession(const AzFramework::CreateSessionRequest& createSessionRequest) + AZStd::string AWSGameLiftClientManager::CreateSession(const Multiplayer::CreateSessionRequest& createSessionRequest) { AZStd::string result = ""; if (CreateSessionActivity::ValidateCreateSessionRequest(createSessionRequest)) @@ -192,7 +192,7 @@ namespace AWSGameLift return result; } - void AWSGameLiftClientManager::CreateSessionAsync(const AzFramework::CreateSessionRequest& createSessionRequest) + void AWSGameLiftClientManager::CreateSessionAsync(const Multiplayer::CreateSessionRequest& createSessionRequest) { if (CreateSessionActivity::ValidateCreateSessionRequest(createSessionRequest)) { @@ -206,8 +206,8 @@ namespace AWSGameLift { AZStd::string result = CreateSessionActivity::CreateSession(gameliftCreateSessionRequest); - AzFramework::SessionAsyncRequestNotificationBus::Broadcast( - &AzFramework::SessionAsyncRequestNotifications::OnCreateSessionAsyncComplete, result); + Multiplayer::SessionAsyncRequestNotificationBus::Broadcast( + &Multiplayer::SessionAsyncRequestNotifications::OnCreateSessionAsyncComplete, result); }, true, jobContext); createSessionJob->Start(); @@ -224,8 +224,8 @@ namespace AWSGameLift { AZStd::string result = CreateSessionOnQueueActivity::CreateSessionOnQueue(gameliftCreateSessionOnQueueRequest); - AzFramework::SessionAsyncRequestNotificationBus::Broadcast( - &AzFramework::SessionAsyncRequestNotifications::OnCreateSessionAsyncComplete, result); + Multiplayer::SessionAsyncRequestNotificationBus::Broadcast( + &Multiplayer::SessionAsyncRequestNotifications::OnCreateSessionAsyncComplete, result); }, true, jobContext); createSessionOnQueueJob->Start(); @@ -233,12 +233,12 @@ namespace AWSGameLift else { AZ_Error(AWSGameLiftClientManagerName, false, AWSGameLiftCreateSessionRequestInvalidErrorMessage); - AzFramework::SessionAsyncRequestNotificationBus::Broadcast( - &AzFramework::SessionAsyncRequestNotifications::OnCreateSessionAsyncComplete, ""); + Multiplayer::SessionAsyncRequestNotificationBus::Broadcast( + &Multiplayer::SessionAsyncRequestNotifications::OnCreateSessionAsyncComplete, ""); } } - bool AWSGameLiftClientManager::JoinSession(const AzFramework::JoinSessionRequest& joinSessionRequest) + bool AWSGameLiftClientManager::JoinSession(const Multiplayer::JoinSessionRequest& joinSessionRequest) { bool result = false; if (JoinSessionActivity::ValidateJoinSessionRequest(joinSessionRequest)) @@ -252,12 +252,12 @@ namespace AWSGameLift return result; } - void AWSGameLiftClientManager::JoinSessionAsync(const AzFramework::JoinSessionRequest& joinSessionRequest) + void AWSGameLiftClientManager::JoinSessionAsync(const Multiplayer::JoinSessionRequest& joinSessionRequest) { if (!JoinSessionActivity::ValidateJoinSessionRequest(joinSessionRequest)) { - AzFramework::SessionAsyncRequestNotificationBus::Broadcast( - &AzFramework::SessionAsyncRequestNotifications::OnJoinSessionAsyncComplete, false); + Multiplayer::SessionAsyncRequestNotificationBus::Broadcast( + &Multiplayer::SessionAsyncRequestNotifications::OnJoinSessionAsyncComplete, false); return; } @@ -272,8 +272,8 @@ namespace AWSGameLift auto createPlayerSessionOutcome = JoinSessionActivity::CreatePlayerSession(gameliftJoinSessionRequest); bool result = JoinSessionActivity::RequestPlayerJoinSession(createPlayerSessionOutcome); - AzFramework::SessionAsyncRequestNotificationBus::Broadcast( - &AzFramework::SessionAsyncRequestNotifications::OnJoinSessionAsyncComplete, result); + Multiplayer::SessionAsyncRequestNotificationBus::Broadcast( + &Multiplayer::SessionAsyncRequestNotifications::OnJoinSessionAsyncComplete, result); }, true, jobContext); @@ -293,18 +293,18 @@ namespace AWSGameLift [this]() { LeaveSession(); - AzFramework::SessionAsyncRequestNotificationBus::Broadcast( - &AzFramework::SessionAsyncRequestNotifications::OnLeaveSessionAsyncComplete); + Multiplayer::SessionAsyncRequestNotificationBus::Broadcast( + &Multiplayer::SessionAsyncRequestNotifications::OnLeaveSessionAsyncComplete); }, true, jobContext); leaveSessionJob->Start(); } - AzFramework::SearchSessionsResponse AWSGameLiftClientManager::SearchSessions( - const AzFramework::SearchSessionsRequest& searchSessionsRequest) const + Multiplayer::SearchSessionsResponse AWSGameLiftClientManager::SearchSessions( + const Multiplayer::SearchSessionsRequest& searchSessionsRequest) const { - AzFramework::SearchSessionsResponse response; + Multiplayer::SearchSessionsResponse response; if (SearchSessionsActivity::ValidateSearchSessionsRequest(searchSessionsRequest)) { const AWSGameLiftSearchSessionsRequest& gameliftSearchSessionsRequest = @@ -315,12 +315,12 @@ namespace AWSGameLift return response; } - void AWSGameLiftClientManager::SearchSessionsAsync(const AzFramework::SearchSessionsRequest& searchSessionsRequest) const + void AWSGameLiftClientManager::SearchSessionsAsync(const Multiplayer::SearchSessionsRequest& searchSessionsRequest) const { if (!SearchSessionsActivity::ValidateSearchSessionsRequest(searchSessionsRequest)) { - AzFramework::SessionAsyncRequestNotificationBus::Broadcast( - &AzFramework::SessionAsyncRequestNotifications::OnSearchSessionsAsyncComplete, AzFramework::SearchSessionsResponse()); + Multiplayer::SessionAsyncRequestNotificationBus::Broadcast( + &Multiplayer::SessionAsyncRequestNotifications::OnSearchSessionsAsyncComplete, Multiplayer::SearchSessionsResponse()); return; } @@ -332,17 +332,17 @@ namespace AWSGameLift AZ::Job* searchSessionsJob = AZ::CreateJobFunction( [gameliftSearchSessionsRequest]() { - AzFramework::SearchSessionsResponse response = SearchSessionsActivity::SearchSessions(gameliftSearchSessionsRequest); + Multiplayer::SearchSessionsResponse response = SearchSessionsActivity::SearchSessions(gameliftSearchSessionsRequest); - AzFramework::SessionAsyncRequestNotificationBus::Broadcast( - &AzFramework::SessionAsyncRequestNotifications::OnSearchSessionsAsyncComplete, response); + Multiplayer::SessionAsyncRequestNotificationBus::Broadcast( + &Multiplayer::SessionAsyncRequestNotifications::OnSearchSessionsAsyncComplete, response); }, true, jobContext); searchSessionsJob->Start(); } - AZStd::string AWSGameLiftClientManager::StartMatchmaking(const AzFramework::StartMatchmakingRequest& startMatchmakingRequest) + AZStd::string AWSGameLiftClientManager::StartMatchmaking(const Multiplayer::StartMatchmakingRequest& startMatchmakingRequest) { AZStd::string response; if (StartMatchmakingActivity::ValidateStartMatchmakingRequest(startMatchmakingRequest)) @@ -355,12 +355,12 @@ namespace AWSGameLift return response; } - void AWSGameLiftClientManager::StartMatchmakingAsync(const AzFramework::StartMatchmakingRequest& startMatchmakingRequest) + void AWSGameLiftClientManager::StartMatchmakingAsync(const Multiplayer::StartMatchmakingRequest& startMatchmakingRequest) { if (!StartMatchmakingActivity::ValidateStartMatchmakingRequest(startMatchmakingRequest)) { - AzFramework::MatchmakingAsyncRequestNotificationBus::Broadcast( - &AzFramework::MatchmakingAsyncRequestNotifications::OnStartMatchmakingAsyncComplete, AZStd::string{}); + Multiplayer::MatchmakingAsyncRequestNotificationBus::Broadcast( + &Multiplayer::MatchmakingAsyncRequestNotifications::OnStartMatchmakingAsyncComplete, AZStd::string{}); return; } @@ -374,15 +374,15 @@ namespace AWSGameLift { AZStd::string response = StartMatchmakingActivity::StartMatchmaking(gameliftStartMatchmakingRequest); - AzFramework::MatchmakingAsyncRequestNotificationBus::Broadcast( - &AzFramework::MatchmakingAsyncRequestNotifications::OnStartMatchmakingAsyncComplete, response); + Multiplayer::MatchmakingAsyncRequestNotificationBus::Broadcast( + &Multiplayer::MatchmakingAsyncRequestNotifications::OnStartMatchmakingAsyncComplete, response); }, true, jobContext); startMatchmakingJob->Start(); } - void AWSGameLiftClientManager::StopMatchmaking(const AzFramework::StopMatchmakingRequest& stopMatchmakingRequest) + void AWSGameLiftClientManager::StopMatchmaking(const Multiplayer::StopMatchmakingRequest& stopMatchmakingRequest) { if (StopMatchmakingActivity::ValidateStopMatchmakingRequest(stopMatchmakingRequest)) { @@ -393,12 +393,12 @@ namespace AWSGameLift } } - void AWSGameLiftClientManager::StopMatchmakingAsync(const AzFramework::StopMatchmakingRequest& stopMatchmakingRequest) + void AWSGameLiftClientManager::StopMatchmakingAsync(const Multiplayer::StopMatchmakingRequest& stopMatchmakingRequest) { if (!StopMatchmakingActivity::ValidateStopMatchmakingRequest(stopMatchmakingRequest)) { - AzFramework::MatchmakingAsyncRequestNotificationBus::Broadcast( - &AzFramework::MatchmakingAsyncRequestNotifications::OnStopMatchmakingAsyncComplete); + Multiplayer::MatchmakingAsyncRequestNotificationBus::Broadcast( + &Multiplayer::MatchmakingAsyncRequestNotifications::OnStopMatchmakingAsyncComplete); return; } @@ -412,8 +412,8 @@ namespace AWSGameLift { StopMatchmakingActivity::StopMatchmaking(gameliftStopMatchmakingRequest); - AzFramework::MatchmakingAsyncRequestNotificationBus::Broadcast( - &AzFramework::MatchmakingAsyncRequestNotifications::OnStopMatchmakingAsyncComplete); + Multiplayer::MatchmakingAsyncRequestNotificationBus::Broadcast( + &Multiplayer::MatchmakingAsyncRequestNotifications::OnStopMatchmakingAsyncComplete); }, true, jobContext); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientManager.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientManager.h index f37152bc60..22fc9ceb3f 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientManager.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientManager.h @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include @@ -28,7 +28,7 @@ namespace AWSGameLift // MatchmakingNotificationBus EBus handler for scripting class AWSGameLiftMatchmakingNotificationBusHandler - : public AzFramework::MatchmakingNotificationBus::Handler + : public Multiplayer::MatchmakingNotificationBus::Handler , public AZ::BehaviorEBusHandler { public: @@ -61,7 +61,7 @@ namespace AWSGameLift // MatchmakingAsyncRequestNotificationBus EBus handler for scripting class AWSGameLiftMatchmakingAsyncRequestNotificationBusHandler - : public AzFramework::MatchmakingAsyncRequestNotificationBus::Handler + : public Multiplayer::MatchmakingAsyncRequestNotificationBus::Handler , public AZ::BehaviorEBusHandler { public: @@ -91,7 +91,7 @@ namespace AWSGameLift // SessionAsyncRequestNotificationBus EBus handler for scripting class AWSGameLiftSessionAsyncRequestNotificationBusHandler - : public AzFramework::SessionAsyncRequestNotificationBus::Handler + : public Multiplayer::SessionAsyncRequestNotificationBus::Handler , public AZ::BehaviorEBusHandler { public: @@ -109,7 +109,7 @@ namespace AWSGameLift Call(FN_OnCreateSessionAsyncComplete, createSessionReponse); } - void OnSearchSessionsAsyncComplete(const AzFramework::SearchSessionsResponse& searchSessionsResponse) override + void OnSearchSessionsAsyncComplete(const Multiplayer::SearchSessionsResponse& searchSessionsResponse) override { Call(FN_OnSearchSessionsAsyncComplete, searchSessionsResponse); } @@ -155,25 +155,25 @@ namespace AWSGameLift AZStd::string CreatePlayerId(bool includeBrackets, bool includeDashes) override; // AWSGameLiftMatchmakingAsyncRequestBus interface implementation - void AcceptMatchAsync(const AzFramework::AcceptMatchRequest& acceptMatchRequest) override; - void StartMatchmakingAsync(const AzFramework::StartMatchmakingRequest& startMatchmakingRequest) override; - void StopMatchmakingAsync(const AzFramework::StopMatchmakingRequest& stopMatchmakingRequest) override; + void AcceptMatchAsync(const Multiplayer::AcceptMatchRequest& acceptMatchRequest) override; + void StartMatchmakingAsync(const Multiplayer::StartMatchmakingRequest& startMatchmakingRequest) override; + void StopMatchmakingAsync(const Multiplayer::StopMatchmakingRequest& stopMatchmakingRequest) override; // AWSGameLiftSessionAsyncRequestBus interface implementation - void CreateSessionAsync(const AzFramework::CreateSessionRequest& createSessionRequest) override; - void JoinSessionAsync(const AzFramework::JoinSessionRequest& joinSessionRequest) override; - void SearchSessionsAsync(const AzFramework::SearchSessionsRequest& searchSessionsRequest) const override; + void CreateSessionAsync(const Multiplayer::CreateSessionRequest& createSessionRequest) override; + void JoinSessionAsync(const Multiplayer::JoinSessionRequest& joinSessionRequest) override; + void SearchSessionsAsync(const Multiplayer::SearchSessionsRequest& searchSessionsRequest) const override; void LeaveSessionAsync() override; // AWSGameLiftMatchmakingRequestBus interface implementation - void AcceptMatch(const AzFramework::AcceptMatchRequest& acceptMatchRequest) override; - AZStd::string StartMatchmaking(const AzFramework::StartMatchmakingRequest& startMatchmakingRequest) override; - void StopMatchmaking(const AzFramework::StopMatchmakingRequest& stopMatchmakingRequest) override; + void AcceptMatch(const Multiplayer::AcceptMatchRequest& acceptMatchRequest) override; + AZStd::string StartMatchmaking(const Multiplayer::StartMatchmakingRequest& startMatchmakingRequest) override; + void StopMatchmaking(const Multiplayer::StopMatchmakingRequest& stopMatchmakingRequest) override; // AWSGameLiftSessionRequestBus interface implementation - AZStd::string CreateSession(const AzFramework::CreateSessionRequest& createSessionRequest) override; - bool JoinSession(const AzFramework::JoinSessionRequest& joinSessionRequest) override; - AzFramework::SearchSessionsResponse SearchSessions(const AzFramework::SearchSessionsRequest& searchSessionsRequest) const override; + AZStd::string CreateSession(const Multiplayer::CreateSessionRequest& createSessionRequest) override; + bool JoinSession(const Multiplayer::JoinSessionRequest& joinSessionRequest) override; + Multiplayer::SearchSessionsResponse SearchSessions(const Multiplayer::SearchSessionsRequest& searchSessionsRequest) const override; void LeaveSession() override; }; } // namespace AWSGameLift diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientSystemComponent.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientSystemComponent.cpp index d256c6c33c..8ab00e8038 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientSystemComponent.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientSystemComponent.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include @@ -129,7 +129,7 @@ namespace AWSGameLift ->Event("StopMatchmakingAsync", &AWSGameLiftMatchmakingAsyncRequestBus::Events::StopMatchmakingAsync, { { { "StopMatchmakingRequest", "" } } }); - behaviorContext->EBus("AWSGameLiftMatchmakingAsyncRequestNotificationBus") + behaviorContext->EBus("AWSGameLiftMatchmakingAsyncRequestNotificationBus") ->Attribute(AZ::Script::Attributes::Category, "AWSGameLift/Matchmaking") ->Handler(); @@ -149,7 +149,7 @@ namespace AWSGameLift { "PlayerId", "" } } }) ->Event("StopPolling", &AWSGameLiftMatchmakingEventRequestBus::Events::StopPolling); - behaviorContext->EBus("AWSGameLiftMatchmakingNotificationBus") + behaviorContext->EBus("AWSGameLiftMatchmakingNotificationBus") ->Attribute(AZ::Script::Attributes::Category, "AWSGameLift/Matchmaking") ->Handler(); } @@ -175,7 +175,7 @@ namespace AWSGameLift { { { "SearchSessionsRequest", "" } } }) ->Event("LeaveSessionAsync", &AWSGameLiftSessionAsyncRequestBus::Events::LeaveSessionAsync); - behaviorContext->EBus("AWSGameLiftSessionAsyncRequestNotificationBus") + behaviorContext->EBus("AWSGameLiftSessionAsyncRequestNotificationBus") ->Attribute(AZ::Script::Attributes::Category, "AWSGameLift/Session") ->Handler(); @@ -190,10 +190,10 @@ namespace AWSGameLift void AWSGameLiftClientSystemComponent::ReflectCreateSessionRequest(AZ::ReflectContext* context) { - AzFramework::CreateSessionRequest::Reflect(context); + Multiplayer::CreateSessionRequest::Reflect(context); if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) { - behaviorContext->Class("CreateSessionRequest") + behaviorContext->Class("CreateSessionRequest") ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value) // Expose base type to BehaviorContext, but hide it to be used directly ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) @@ -204,34 +204,34 @@ namespace AWSGameLift void AWSGameLiftClientSystemComponent::ReflectSearchSessionsResponse(AZ::ReflectContext* context) { // As it is a common response type, reflection could be moved to AzFramework to avoid duplication - AzFramework::SessionConfig::Reflect(context); - AzFramework::SearchSessionsResponse::Reflect(context); + Multiplayer::SessionConfig::Reflect(context); + Multiplayer::SearchSessionsResponse::Reflect(context); if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) { - behaviorContext->Class("SessionConfig") + behaviorContext->Class("SessionConfig") ->Attribute(AZ::Script::Attributes::Category, "Session") ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value) - ->Property("CreationTime", BehaviorValueProperty(&AzFramework::SessionConfig::m_creationTime)) - ->Property("CreatorId", BehaviorValueProperty(&AzFramework::SessionConfig::m_creatorId)) - ->Property("CurrentPlayer", BehaviorValueProperty(&AzFramework::SessionConfig::m_currentPlayer)) - ->Property("DnsName", BehaviorValueProperty(&AzFramework::SessionConfig::m_dnsName)) - ->Property("IpAddress", BehaviorValueProperty(&AzFramework::SessionConfig::m_ipAddress)) - ->Property("MaxPlayer", BehaviorValueProperty(&AzFramework::SessionConfig::m_maxPlayer)) - ->Property("Port", BehaviorValueProperty(&AzFramework::SessionConfig::m_port)) - ->Property("SessionId", BehaviorValueProperty(&AzFramework::SessionConfig::m_sessionId)) - ->Property("SessionName", BehaviorValueProperty(&AzFramework::SessionConfig::m_sessionName)) - ->Property("SessionProperties", BehaviorValueProperty(&AzFramework::SessionConfig::m_sessionProperties)) - ->Property("MatchmakingData", BehaviorValueProperty(&AzFramework::SessionConfig::m_matchmakingData)) - ->Property("Status", BehaviorValueProperty(&AzFramework::SessionConfig::m_status)) - ->Property("StatusReason", BehaviorValueProperty(&AzFramework::SessionConfig::m_statusReason)) - ->Property("TerminationTime", BehaviorValueProperty(&AzFramework::SessionConfig::m_terminationTime)) + ->Property("CreationTime", BehaviorValueProperty(&Multiplayer::SessionConfig::m_creationTime)) + ->Property("CreatorId", BehaviorValueProperty(&Multiplayer::SessionConfig::m_creatorId)) + ->Property("CurrentPlayer", BehaviorValueProperty(&Multiplayer::SessionConfig::m_currentPlayer)) + ->Property("DnsName", BehaviorValueProperty(&Multiplayer::SessionConfig::m_dnsName)) + ->Property("IpAddress", BehaviorValueProperty(&Multiplayer::SessionConfig::m_ipAddress)) + ->Property("MaxPlayer", BehaviorValueProperty(&Multiplayer::SessionConfig::m_maxPlayer)) + ->Property("Port", BehaviorValueProperty(&Multiplayer::SessionConfig::m_port)) + ->Property("SessionId", BehaviorValueProperty(&Multiplayer::SessionConfig::m_sessionId)) + ->Property("SessionName", BehaviorValueProperty(&Multiplayer::SessionConfig::m_sessionName)) + ->Property("SessionProperties", BehaviorValueProperty(&Multiplayer::SessionConfig::m_sessionProperties)) + ->Property("MatchmakingData", BehaviorValueProperty(&Multiplayer::SessionConfig::m_matchmakingData)) + ->Property("Status", BehaviorValueProperty(&Multiplayer::SessionConfig::m_status)) + ->Property("StatusReason", BehaviorValueProperty(&Multiplayer::SessionConfig::m_statusReason)) + ->Property("TerminationTime", BehaviorValueProperty(&Multiplayer::SessionConfig::m_terminationTime)) ; - behaviorContext->Class("SearchSessionsResponse") + behaviorContext->Class("SearchSessionsResponse") ->Attribute(AZ::Script::Attributes::Category, "Session") ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value) - ->Property("NextToken", BehaviorValueProperty(&AzFramework::SearchSessionsResponse::m_nextToken)) - ->Property("SessionConfigs", BehaviorValueProperty(&AzFramework::SearchSessionsResponse::m_sessionConfigs)) + ->Property("NextToken", BehaviorValueProperty(&Multiplayer::SearchSessionsResponse::m_nextToken)) + ->Property("SessionConfigs", BehaviorValueProperty(&Multiplayer::SearchSessionsResponse::m_sessionConfigs)) ; } } diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftAcceptMatchActivity.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftAcceptMatchActivity.cpp index dbeced1728..1a39b5c944 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftAcceptMatchActivity.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftAcceptMatchActivity.cpp @@ -69,7 +69,7 @@ namespace AWSGameLift } } - bool ValidateAcceptMatchRequest(const AzFramework::AcceptMatchRequest& AcceptMatchRequest) + bool ValidateAcceptMatchRequest(const Multiplayer::AcceptMatchRequest& AcceptMatchRequest) { auto gameliftAcceptMatchRequest = azrtti_cast(&AcceptMatchRequest); bool isValid = gameliftAcceptMatchRequest && diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftAcceptMatchActivity.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftAcceptMatchActivity.h index ac4012c347..a3b637168a 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftAcceptMatchActivity.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftAcceptMatchActivity.h @@ -26,6 +26,6 @@ namespace AWSGameLift void AcceptMatch(const AWSGameLiftAcceptMatchRequest& AcceptMatchRequest); // Validate AcceptMatchRequest and check required request parameters - bool ValidateAcceptMatchRequest(const AzFramework::AcceptMatchRequest& AcceptMatchRequest); + bool ValidateAcceptMatchRequest(const Multiplayer::AcceptMatchRequest& AcceptMatchRequest); } // namespace AcceptMatchActivity } // namespace AWSGameLift diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionActivity.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionActivity.cpp index ee93f022a1..8b2182488f 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionActivity.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionActivity.cpp @@ -99,7 +99,7 @@ namespace AWSGameLift return result; } - bool ValidateCreateSessionRequest(const AzFramework::CreateSessionRequest& createSessionRequest) + bool ValidateCreateSessionRequest(const Multiplayer::CreateSessionRequest& createSessionRequest) { auto gameliftCreateSessionRequest = azrtti_cast(&createSessionRequest); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionActivity.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionActivity.h index af236dbfa4..103231a0ed 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionActivity.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionActivity.h @@ -25,7 +25,7 @@ namespace AWSGameLift AZStd::string CreateSession(const AWSGameLiftCreateSessionRequest& createSessionRequest); // Validate CreateSessionRequest and check required request parameters - bool ValidateCreateSessionRequest(const AzFramework::CreateSessionRequest& createSessionRequest); + bool ValidateCreateSessionRequest(const Multiplayer::CreateSessionRequest& createSessionRequest); } // namespace CreateSessionActivity } // namespace AWSGameLift diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionOnQueueActivity.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionOnQueueActivity.cpp index 8e8d7e23c5..d1cd7a2a39 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionOnQueueActivity.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionOnQueueActivity.cpp @@ -87,7 +87,7 @@ namespace AWSGameLift return result; } - bool ValidateCreateSessionOnQueueRequest(const AzFramework::CreateSessionRequest& createSessionRequest) + bool ValidateCreateSessionOnQueueRequest(const Multiplayer::CreateSessionRequest& createSessionRequest) { auto gameliftCreateSessionOnQueueRequest = azrtti_cast(&createSessionRequest); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionOnQueueActivity.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionOnQueueActivity.h index 5f16bf0b31..014431ef3f 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionOnQueueActivity.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionOnQueueActivity.h @@ -26,7 +26,7 @@ namespace AWSGameLift AZStd::string CreateSessionOnQueue(const AWSGameLiftCreateSessionOnQueueRequest& createSessionOnQueueRequest); // Validate CreateSessionOnQueueRequest and check required request parameters - bool ValidateCreateSessionOnQueueRequest(const AzFramework::CreateSessionRequest& createSessionRequest); + bool ValidateCreateSessionOnQueueRequest(const Multiplayer::CreateSessionRequest& createSessionRequest); } // namespace CreateSessionOnQueueActivity } // namespace AWSGameLift diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftJoinSessionActivity.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftJoinSessionActivity.cpp index 71ef9e9737..f93f9e5378 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftJoinSessionActivity.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftJoinSessionActivity.cpp @@ -39,10 +39,10 @@ namespace AWSGameLift return request; } - AzFramework::SessionConnectionConfig BuildSessionConnectionConfig( + Multiplayer::SessionConnectionConfig BuildSessionConnectionConfig( const Aws::GameLift::Model::CreatePlayerSessionOutcome& createPlayerSessionOutcome) { - AzFramework::SessionConnectionConfig sessionConnectionConfig; + Multiplayer::SessionConnectionConfig sessionConnectionConfig; auto createPlayerSessionResult = createPlayerSessionOutcome.GetResult(); // TODO: AWSNativeSDK needs to be updated to support this attribute, and it is a must have for TLS certificate enabled fleet //sessionConnectionConfig.m_dnsName = createPlayerSessionResult.GetPlayerSession().GetDnsName().c_str(); @@ -95,10 +95,10 @@ namespace AWSGameLift bool result = false; if (createPlayerSessionOutcome.IsSuccess()) { - auto clientRequestHandler = AZ::Interface::Get(); + auto clientRequestHandler = AZ::Interface::Get(); if (clientRequestHandler) { - AzFramework::SessionConnectionConfig sessionConnectionConfig = + Multiplayer::SessionConnectionConfig sessionConnectionConfig = BuildSessionConnectionConfig(createPlayerSessionOutcome); AZ_TracePrintf(AWSGameLiftJoinSessionActivityName, @@ -114,7 +114,7 @@ namespace AWSGameLift return result; } - bool ValidateJoinSessionRequest(const AzFramework::JoinSessionRequest& joinSessionRequest) + bool ValidateJoinSessionRequest(const Multiplayer::JoinSessionRequest& joinSessionRequest) { auto gameliftJoinSessionRequest = azrtti_cast(&joinSessionRequest); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftJoinSessionActivity.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftJoinSessionActivity.h index b011f4877b..8e79ee961c 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftJoinSessionActivity.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftJoinSessionActivity.h @@ -8,7 +8,7 @@ #pragma once -#include +#include #include @@ -31,7 +31,7 @@ namespace AWSGameLift const AWSGameLiftJoinSessionRequest& joinSessionRequest); // Build session connection config by using CreatePlayerSessionOutcome - AzFramework::SessionConnectionConfig BuildSessionConnectionConfig( + Multiplayer::SessionConnectionConfig BuildSessionConnectionConfig( const Aws::GameLift::Model::CreatePlayerSessionOutcome& createPlayerSessionOutcome); // Create CreatePlayerSessionRequest and make a CreatePlayerSession call through GameLift client @@ -43,7 +43,7 @@ namespace AWSGameLift const Aws::GameLift::Model::CreatePlayerSessionOutcome& createPlayerSessionOutcome); // Validate JoinSessionRequest and check required request parameters - bool ValidateJoinSessionRequest(const AzFramework::JoinSessionRequest& joinSessionRequest); + bool ValidateJoinSessionRequest(const Multiplayer::JoinSessionRequest& joinSessionRequest); } // namespace JoinSessionActivity } // namespace AWSGameLift diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftLeaveSessionActivity.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftLeaveSessionActivity.cpp index fd3b3d6ebc..38f5c39377 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftLeaveSessionActivity.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftLeaveSessionActivity.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include @@ -18,7 +18,7 @@ namespace AWSGameLift { void LeaveSession() { - auto clientRequestHandler = AZ::Interface::Get(); + auto clientRequestHandler = AZ::Interface::Get(); if (clientRequestHandler) { AZ_TracePrintf(AWSGameLiftLeaveSessionActivityName, "Requesting player to leave the current session ..."); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftSearchSessionsActivity.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftSearchSessionsActivity.cpp index b7917e6d59..e755f52cd2 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftSearchSessionsActivity.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftSearchSessionsActivity.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -67,10 +67,10 @@ namespace AWSGameLift return request; } - AzFramework::SearchSessionsResponse SearchSessions( + Multiplayer::SearchSessionsResponse SearchSessions( const AWSGameLiftSearchSessionsRequest& searchSessionsRequest) { - AzFramework::SearchSessionsResponse response; + Multiplayer::SearchSessionsResponse response; auto gameliftClient = AZ::Interface::Get()->GetGameLiftClient(); if (!gameliftClient) @@ -98,15 +98,15 @@ namespace AWSGameLift return response; } - AzFramework::SearchSessionsResponse ParseResponse( + Multiplayer::SearchSessionsResponse ParseResponse( const Aws::GameLift::Model::SearchGameSessionsResult& gameLiftSearchSessionsResult) { - AzFramework::SearchSessionsResponse response; + Multiplayer::SearchSessionsResponse response; response.m_nextToken = gameLiftSearchSessionsResult.GetNextToken().c_str(); for (const Aws::GameLift::Model::GameSession& gameSession : gameLiftSearchSessionsResult.GetGameSessions()) { - AzFramework::SessionConfig session; + Multiplayer::SessionConfig session; session.m_creationTime = gameSession.GetCreationTime().Millis(); session.m_creatorId = gameSession.GetCreatorId().c_str(); session.m_currentPlayer = gameSession.GetCurrentPlayerSessionCount(); @@ -133,7 +133,7 @@ namespace AWSGameLift return response; }; - bool ValidateSearchSessionsRequest(const AzFramework::SearchSessionsRequest& searchSessionsRequest) + bool ValidateSearchSessionsRequest(const Multiplayer::SearchSessionsRequest& searchSessionsRequest) { auto gameliftSearchSessionsRequest = azrtti_cast(&searchSessionsRequest); if (gameliftSearchSessionsRequest && diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftSearchSessionsActivity.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftSearchSessionsActivity.h index d5bcda992c..10095448d3 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftSearchSessionsActivity.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftSearchSessionsActivity.h @@ -25,14 +25,14 @@ namespace AWSGameLift const AWSGameLiftSearchSessionsRequest& searchSessionsRequest); // Create SearchGameSessionsRequest and make a SeachGameSessions call through GameLift client - AzFramework::SearchSessionsResponse SearchSessions( + Multiplayer::SearchSessionsResponse SearchSessions( const AWSGameLiftSearchSessionsRequest& searchSessionsRequest); - // Convert from Aws::GameLift::Model::SearchGameSessionsResult to AzFramework::SearchSessionsResponse. - AzFramework::SearchSessionsResponse ParseResponse( + // Convert from Aws::GameLift::Model::SearchGameSessionsResult to Multiplayer::SearchSessionsResponse. + Multiplayer::SearchSessionsResponse ParseResponse( const Aws::GameLift::Model::SearchGameSessionsResult& gameLiftSearchSessionsResult); // Validate SearchSessionsRequest and check required request parameters - bool ValidateSearchSessionsRequest(const AzFramework::SearchSessionsRequest& searchSessionsRequest); + bool ValidateSearchSessionsRequest(const Multiplayer::SearchSessionsRequest& searchSessionsRequest); } // namespace SearchSessionsActivity } // namespace AWSGameLift diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStartMatchmakingActivity.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStartMatchmakingActivity.cpp index 6f6c7fccc0..5c436ea9e3 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStartMatchmakingActivity.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStartMatchmakingActivity.cpp @@ -110,7 +110,7 @@ namespace AWSGameLift return result; } - bool ValidateStartMatchmakingRequest(const AzFramework::StartMatchmakingRequest& startMatchmakingRequest) + bool ValidateStartMatchmakingRequest(const Multiplayer::StartMatchmakingRequest& startMatchmakingRequest) { auto gameliftStartMatchmakingRequest = azrtti_cast(&startMatchmakingRequest); bool isValid = gameliftStartMatchmakingRequest && diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStartMatchmakingActivity.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStartMatchmakingActivity.h index f736e318fb..190f690434 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStartMatchmakingActivity.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStartMatchmakingActivity.h @@ -26,6 +26,6 @@ namespace AWSGameLift AZStd::string StartMatchmaking(const AWSGameLiftStartMatchmakingRequest& startMatchmakingRequest); // Validate StartMatchmakingRequest and check required request parameters - bool ValidateStartMatchmakingRequest(const AzFramework::StartMatchmakingRequest& startMatchmakingRequest); + bool ValidateStartMatchmakingRequest(const Multiplayer::StartMatchmakingRequest& startMatchmakingRequest); } // namespace StartMatchmakingActivity } // namespace AWSGameLift diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStopMatchmakingActivity.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStopMatchmakingActivity.cpp index 022861570a..f67f0dffd7 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStopMatchmakingActivity.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStopMatchmakingActivity.cpp @@ -59,7 +59,7 @@ namespace AWSGameLift } } - bool ValidateStopMatchmakingRequest(const AzFramework::StopMatchmakingRequest& StopMatchmakingRequest) + bool ValidateStopMatchmakingRequest(const Multiplayer::StopMatchmakingRequest& StopMatchmakingRequest) { auto gameliftStopMatchmakingRequest = azrtti_cast(&StopMatchmakingRequest); bool isValid = gameliftStopMatchmakingRequest && (!gameliftStopMatchmakingRequest->m_ticketId.empty()); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStopMatchmakingActivity.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStopMatchmakingActivity.h index b5f19d35df..81903b11e0 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStopMatchmakingActivity.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStopMatchmakingActivity.h @@ -26,6 +26,6 @@ namespace AWSGameLift void StopMatchmaking(const AWSGameLiftStopMatchmakingRequest& stopMatchmakingRequest); // Validate StopMatchmakingRequest and check required request parameters - bool ValidateStopMatchmakingRequest(const AzFramework::StopMatchmakingRequest& stopMatchmakingRequest); + bool ValidateStopMatchmakingRequest(const Multiplayer::StopMatchmakingRequest& stopMatchmakingRequest); } // namespace StopMatchmakingActivity } // namespace AWSGameLift diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftAcceptMatchRequest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftAcceptMatchRequest.cpp index 0d5f2c7198..a52467052e 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftAcceptMatchRequest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftAcceptMatchRequest.cpp @@ -16,11 +16,11 @@ namespace AWSGameLift { void AWSGameLiftAcceptMatchRequest::Reflect(AZ::ReflectContext* context) { - AzFramework::AcceptMatchRequest::Reflect(context); + Multiplayer::AcceptMatchRequest::Reflect(context); if (auto serializeContext = azrtti_cast(context)) { - serializeContext->Class() + serializeContext->Class() ->Version(0); if (AZ::EditContext* editContext = serializeContext->GetEditContext()) @@ -33,7 +33,7 @@ namespace AWSGameLift if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) { - behaviorContext->Class("AcceptMatchRequest") + behaviorContext->Class("AcceptMatchRequest") ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value) // Expose base type to BehaviorContext, but hide it to be used directly ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftCreateSessionOnQueueRequest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftCreateSessionOnQueueRequest.cpp index a6cb024ba8..b28669f0f3 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftCreateSessionOnQueueRequest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftCreateSessionOnQueueRequest.cpp @@ -18,7 +18,7 @@ namespace AWSGameLift { if (auto serializeContext = azrtti_cast(context)) { - serializeContext->Class() + serializeContext->Class() ->Version(0) ->Field("queueName", &AWSGameLiftCreateSessionOnQueueRequest::m_queueName) ->Field("placementId", &AWSGameLiftCreateSessionOnQueueRequest::m_placementId) diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftCreateSessionRequest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftCreateSessionRequest.cpp index 1c9669e474..53a7203f46 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftCreateSessionRequest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftCreateSessionRequest.cpp @@ -18,7 +18,7 @@ namespace AWSGameLift { if (auto serializeContext = azrtti_cast(context)) { - serializeContext->Class() + serializeContext->Class() ->Version(0) ->Field("aliasId", &AWSGameLiftCreateSessionRequest::m_aliasId) ->Field("fleetId", &AWSGameLiftCreateSessionRequest::m_fleetId) diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftJoinSessionRequest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftJoinSessionRequest.cpp index 7d23a4b581..47dfa05012 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftJoinSessionRequest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftJoinSessionRequest.cpp @@ -15,11 +15,11 @@ namespace AWSGameLift { void AWSGameLiftJoinSessionRequest::Reflect(AZ::ReflectContext* context) { - AzFramework::JoinSessionRequest::Reflect(context); + Multiplayer::JoinSessionRequest::Reflect(context); if (auto serializeContext = azrtti_cast(context)) { - serializeContext->Class() + serializeContext->Class() ->Version(0) ; @@ -34,7 +34,7 @@ namespace AWSGameLift if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) { - behaviorContext->Class("JoinSessionRequest") + behaviorContext->Class("JoinSessionRequest") ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value) // Expose base type to BehaviorContext, but hide it to be used directly ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftSearchSessionsRequest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftSearchSessionsRequest.cpp index b78320dc32..56aa8bce5c 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftSearchSessionsRequest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftSearchSessionsRequest.cpp @@ -12,17 +12,17 @@ #include #include #include -#include +#include namespace AWSGameLift { void AWSGameLiftSearchSessionsRequest::Reflect(AZ::ReflectContext* context) { - AzFramework::SearchSessionsRequest::Reflect(context); + Multiplayer::SearchSessionsRequest::Reflect(context); if (auto serializeContext = azrtti_cast(context)) { - serializeContext->Class() + serializeContext->Class() ->Version(0) ->Field("aliasId", &AWSGameLiftSearchSessionsRequest::m_aliasId) ->Field("fleetId", &AWSGameLiftSearchSessionsRequest::m_fleetId) @@ -47,7 +47,7 @@ namespace AWSGameLift if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) { - behaviorContext->Class("SearchSessionsRequest") + behaviorContext->Class("SearchSessionsRequest") ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value) // Expose base type to BehaviorContext, but hide it to be used directly ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftStartMatchmakingRequest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftStartMatchmakingRequest.cpp index 3ec98d554f..162db200a8 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftStartMatchmakingRequest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftStartMatchmakingRequest.cpp @@ -16,12 +16,12 @@ namespace AWSGameLift { void AWSGameLiftStartMatchmakingRequest::Reflect(AZ::ReflectContext* context) { - AzFramework::StartMatchmakingRequest::Reflect(context); + Multiplayer::StartMatchmakingRequest::Reflect(context); AWSGameLiftPlayer::Reflect(context); if (auto serializeContext = azrtti_cast(context)) { - serializeContext->Class() + serializeContext->Class() ->Version(0) ->Field("configurationName", &AWSGameLiftStartMatchmakingRequest::m_configurationName) ->Field("players", &AWSGameLiftStartMatchmakingRequest::m_players); @@ -40,7 +40,7 @@ namespace AWSGameLift if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) { - behaviorContext->Class("StartMatchmakingRequest") + behaviorContext->Class("StartMatchmakingRequest") ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value) // Expose base type to BehaviorContext, but hide it to be used directly ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftStopMatchmakingRequest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftStopMatchmakingRequest.cpp index c462d45da7..babbeba7e8 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftStopMatchmakingRequest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Request/AWSGameLiftStopMatchmakingRequest.cpp @@ -16,11 +16,11 @@ namespace AWSGameLift { void AWSGameLiftStopMatchmakingRequest::Reflect(AZ::ReflectContext* context) { - AzFramework::StopMatchmakingRequest::Reflect(context); + Multiplayer::StopMatchmakingRequest::Reflect(context); if (auto serializeContext = azrtti_cast(context)) { - serializeContext->Class() + serializeContext->Class() ->Version(0); if (AZ::EditContext* editContext = serializeContext->GetEditContext()) @@ -33,7 +33,7 @@ namespace AWSGameLift if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) { - behaviorContext->Class("StopMatchmakingRequest") + behaviorContext->Class("StopMatchmakingRequest") ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value) // Expose base type to BehaviorContext, but hide it to be used directly ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/AWSGameLiftClientManagerTest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/AWSGameLiftClientManagerTest.cpp index 6ce0cb8f64..405eab613e 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/AWSGameLiftClientManagerTest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/AWSGameLiftClientManagerTest.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include @@ -201,9 +201,9 @@ protected: return Aws::GameLift::Model::SearchGameSessionsOutcome(result); } - AzFramework::SearchSessionsResponse GetValidSearchSessionsResponse() + Multiplayer::SearchSessionsResponse GetValidSearchSessionsResponse() { - AzFramework::SessionConfig sessionConfig; + Multiplayer::SessionConfig sessionConfig; sessionConfig.m_creationTime = 0; sessionConfig.m_terminationTime = 0; sessionConfig.m_creatorId = "dummyCreatorId"; @@ -220,7 +220,7 @@ protected: // TODO: Update the AWS Native SDK to set the new game session attributes. // sessionConfig.m_dnsName = "dummyDnsName"; - AzFramework::SearchSessionsResponse response; + Multiplayer::SearchSessionsResponse response; response.m_nextToken = "dummyNextToken"; response.m_sessionConfigs = { sessionConfig }; @@ -344,7 +344,7 @@ TEST_F(AWSGameLiftClientManagerTest, CreateSession_CallWithoutClientSetup_GetEmp TEST_F(AWSGameLiftClientManagerTest, CreateSession_CallWithInvalidRequest_GetEmptyResponse) { AZ_TEST_START_TRACE_SUPPRESSION; - auto response = m_gameliftClientManager->CreateSession(AzFramework::CreateSessionRequest()); + auto response = m_gameliftClientManager->CreateSession(Multiplayer::CreateSessionRequest()); AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message EXPECT_TRUE(response == ""); } @@ -381,7 +381,7 @@ TEST_F(AWSGameLiftClientManagerTest, CreateSessionAsync_CallWithInvalidRequest_G AZ_TEST_START_TRACE_SUPPRESSION; SessionAsyncRequestNotificationsHandlerMock sessionHandlerMock; EXPECT_CALL(sessionHandlerMock, OnCreateSessionAsyncComplete(AZStd::string())).Times(1); - m_gameliftClientManager->CreateSessionAsync(AzFramework::CreateSessionRequest()); + m_gameliftClientManager->CreateSessionAsync(Multiplayer::CreateSessionRequest()); AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message } @@ -513,7 +513,7 @@ TEST_F(AWSGameLiftClientManagerTest, JoinSession_CallWithoutClientSetup_GetFalse TEST_F(AWSGameLiftClientManagerTest, JoinSession_CallWithInvalidRequest_GetFalseResponse) { AZ_TEST_START_TRACE_SUPPRESSION; - auto response = m_gameliftClientManager->JoinSession(AzFramework::JoinSessionRequest()); + auto response = m_gameliftClientManager->JoinSession(Multiplayer::JoinSessionRequest()); AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message EXPECT_FALSE(response); } @@ -590,7 +590,7 @@ TEST_F(AWSGameLiftClientManagerTest, JoinSessionAsync_CallWithInvalidRequest_Get AZ_TEST_START_TRACE_SUPPRESSION; SessionAsyncRequestNotificationsHandlerMock sessionHandlerMock; EXPECT_CALL(sessionHandlerMock, OnJoinSessionAsyncComplete(false)).Times(1); - m_gameliftClientManager->JoinSessionAsync(AzFramework::JoinSessionRequest()); + m_gameliftClientManager->JoinSessionAsync(Multiplayer::JoinSessionRequest()); AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message } @@ -698,7 +698,7 @@ TEST_F(AWSGameLiftClientManagerTest, SearchSessions_CallWithValidRequestAndSucce .Times(1) .WillOnce(::testing::Return(outcome)); - AzFramework::SearchSessionsResponse expectedResponse = GetValidSearchSessionsResponse(); + Multiplayer::SearchSessionsResponse expectedResponse = GetValidSearchSessionsResponse(); auto result = m_gameliftClientManager->SearchSessions(request); EXPECT_TRUE(result.m_sessionConfigs.size() != 0); } @@ -713,7 +713,7 @@ TEST_F(AWSGameLiftClientManagerTest, SearchSessionsAsync_CallWithoutClientSetup_ SessionAsyncRequestNotificationsHandlerMock sessionHandlerMock; EXPECT_CALL(sessionHandlerMock, - OnSearchSessionsAsyncComplete(SearchSessionsResponseMatcher(AzFramework::SearchSessionsResponse()))).Times(1); + OnSearchSessionsAsyncComplete(SearchSessionsResponseMatcher(Multiplayer::SearchSessionsResponse()))).Times(1); AZ_TEST_START_TRACE_SUPPRESSION; m_gameliftClientManager->SearchSessionsAsync(request); @@ -725,9 +725,9 @@ TEST_F(AWSGameLiftClientManagerTest, SearchSessionsAsync_CallWithInvalidRequest_ AZ_TEST_START_TRACE_SUPPRESSION; SessionAsyncRequestNotificationsHandlerMock sessionHandlerMock; EXPECT_CALL(sessionHandlerMock, - OnSearchSessionsAsyncComplete(SearchSessionsResponseMatcher(AzFramework::SearchSessionsResponse()))).Times(1); + OnSearchSessionsAsyncComplete(SearchSessionsResponseMatcher(Multiplayer::SearchSessionsResponse()))).Times(1); - m_gameliftClientManager->SearchSessionsAsync(AzFramework::SearchSessionsRequest()); + m_gameliftClientManager->SearchSessionsAsync(Multiplayer::SearchSessionsRequest()); AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message } @@ -746,7 +746,7 @@ TEST_F(AWSGameLiftClientManagerTest, SearchSessionsAsync_CallWithValidRequestAnd SessionAsyncRequestNotificationsHandlerMock sessionHandlerMock; EXPECT_CALL(sessionHandlerMock, - OnSearchSessionsAsyncComplete(SearchSessionsResponseMatcher(AzFramework::SearchSessionsResponse()))).Times(1); + OnSearchSessionsAsyncComplete(SearchSessionsResponseMatcher(Multiplayer::SearchSessionsResponse()))).Times(1); AZ_TEST_START_TRACE_SUPPRESSION; m_gameliftClientManager->SearchSessionsAsync(request); @@ -765,7 +765,7 @@ TEST_F(AWSGameLiftClientManagerTest, SearchSessionsAsync_CallWithValidRequestAnd .Times(1) .WillOnce(::testing::Return(outcome)); - AzFramework::SearchSessionsResponse expectedResponse = GetValidSearchSessionsResponse(); + Multiplayer::SearchSessionsResponse expectedResponse = GetValidSearchSessionsResponse(); SessionAsyncRequestNotificationsHandlerMock sessionHandlerMock; EXPECT_CALL(sessionHandlerMock, OnSearchSessionsAsyncComplete(SearchSessionsResponseMatcher(expectedResponse))).Times(1); @@ -926,7 +926,7 @@ TEST_F(AWSGameLiftClientManagerTest, StopMatchmaking_CallWithoutClientSetup_GetE TEST_F(AWSGameLiftClientManagerTest, StopMatchmaking_CallWithInvalidRequest_GetError) { AZ_TEST_START_TRACE_SUPPRESSION; - m_gameliftClientManager->StopMatchmaking(AzFramework::StopMatchmakingRequest()); + m_gameliftClientManager->StopMatchmaking(Multiplayer::StopMatchmakingRequest()); AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message } @@ -1029,7 +1029,7 @@ TEST_F(AWSGameLiftClientManagerTest, AcceptMatch_CallWithoutClientSetup_GetError TEST_F(AWSGameLiftClientManagerTest, AcceptMatch_CallWithInvalidRequest_GetError) { AZ_TEST_START_TRACE_SUPPRESSION; - m_gameliftClientManager->AcceptMatch(AzFramework::AcceptMatchRequest()); + m_gameliftClientManager->AcceptMatch(Multiplayer::AcceptMatchRequest()); AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message } diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/AWSGameLiftClientMocks.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/AWSGameLiftClientMocks.h index d685f61d30..0950e38463 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/AWSGameLiftClientMocks.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/AWSGameLiftClientMocks.h @@ -9,10 +9,10 @@ #pragma once #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -58,17 +58,17 @@ public: }; class MatchmakingAsyncRequestNotificationsHandlerMock - : public AzFramework::MatchmakingAsyncRequestNotificationBus::Handler + : public Multiplayer::MatchmakingAsyncRequestNotificationBus::Handler { public: MatchmakingAsyncRequestNotificationsHandlerMock() { - AzFramework::MatchmakingAsyncRequestNotificationBus::Handler::BusConnect(); + Multiplayer::MatchmakingAsyncRequestNotificationBus::Handler::BusConnect(); } ~MatchmakingAsyncRequestNotificationsHandlerMock() { - AzFramework::MatchmakingAsyncRequestNotificationBus::Handler::BusDisconnect(); + Multiplayer::MatchmakingAsyncRequestNotificationBus::Handler::BusDisconnect(); } MOCK_METHOD0(OnAcceptMatchAsyncComplete, void()); @@ -77,17 +77,17 @@ public: }; class MatchmakingNotificationsHandlerMock - : public AzFramework::MatchmakingNotificationBus::Handler + : public Multiplayer::MatchmakingNotificationBus::Handler { public: MatchmakingNotificationsHandlerMock() { - AzFramework::MatchmakingNotificationBus::Handler::BusConnect(); + Multiplayer::MatchmakingNotificationBus::Handler::BusConnect(); } ~MatchmakingNotificationsHandlerMock() { - AzFramework::MatchmakingNotificationBus::Handler::BusDisconnect(); + Multiplayer::MatchmakingNotificationBus::Handler::BusDisconnect(); } void OnMatchAcceptance() override @@ -117,39 +117,39 @@ public: }; class SessionAsyncRequestNotificationsHandlerMock - : public AzFramework::SessionAsyncRequestNotificationBus::Handler + : public Multiplayer::SessionAsyncRequestNotificationBus::Handler { public: SessionAsyncRequestNotificationsHandlerMock() { - AzFramework::SessionAsyncRequestNotificationBus::Handler::BusConnect(); + Multiplayer::SessionAsyncRequestNotificationBus::Handler::BusConnect(); } ~SessionAsyncRequestNotificationsHandlerMock() { - AzFramework::SessionAsyncRequestNotificationBus::Handler::BusDisconnect(); + Multiplayer::SessionAsyncRequestNotificationBus::Handler::BusDisconnect(); } MOCK_METHOD1(OnCreateSessionAsyncComplete, void(const AZStd::string&)); - MOCK_METHOD1(OnSearchSessionsAsyncComplete, void(const AzFramework::SearchSessionsResponse&)); + MOCK_METHOD1(OnSearchSessionsAsyncComplete, void(const Multiplayer::SearchSessionsResponse&)); MOCK_METHOD1(OnJoinSessionAsyncComplete, void(bool)); MOCK_METHOD0(OnLeaveSessionAsyncComplete, void()); }; class SessionHandlingClientRequestsMock - : public AzFramework::ISessionHandlingClientRequests + : public Multiplayer::ISessionHandlingClientRequests { public: SessionHandlingClientRequestsMock() { - AZ::Interface::Register(this); + AZ::Interface::Register(this); } virtual ~SessionHandlingClientRequestsMock() { - AZ::Interface::Unregister(this); + AZ::Interface::Unregister(this); } - MOCK_METHOD1(RequestPlayerJoinSession, bool(const AzFramework::SessionConnectionConfig&)); + MOCK_METHOD1(RequestPlayerJoinSession, bool(const Multiplayer::SessionConnectionConfig&)); MOCK_METHOD0(RequestPlayerLeaveSession, void()); }; diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftAcceptMatchActivityTest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftAcceptMatchActivityTest.cpp index af78ca8c0c..50ed0b526d 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftAcceptMatchActivityTest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftAcceptMatchActivityTest.cpp @@ -35,7 +35,7 @@ TEST_F(AWSGameLiftAcceptMatchActivityTest, BuildAWSGameLiftAcceptMatchRequest_Ca TEST_F(AWSGameLiftAcceptMatchActivityTest, ValidateAcceptMatchRequest_CallWithBaseType_GetFalseResult) { AZ_TEST_START_TRACE_SUPPRESSION; - auto result = AcceptMatchActivity::ValidateAcceptMatchRequest(AzFramework::AcceptMatchRequest()); + auto result = AcceptMatchActivity::ValidateAcceptMatchRequest(Multiplayer::AcceptMatchRequest()); EXPECT_FALSE(result); AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message } diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftCreateSessionActivityTest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftCreateSessionActivityTest.cpp index fcf867138b..6940a3eb01 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftCreateSessionActivityTest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftCreateSessionActivityTest.cpp @@ -39,7 +39,7 @@ TEST_F(AWSGameLiftCreateSessionActivityTest, BuildAWSGameLiftCreateGameSessionRe TEST_F(AWSGameLiftCreateSessionActivityTest, ValidateCreateSessionRequest_CallWithBaseType_GetFalseResult) { - auto result = CreateSessionActivity::ValidateCreateSessionRequest(AzFramework::CreateSessionRequest()); + auto result = CreateSessionActivity::ValidateCreateSessionRequest(Multiplayer::CreateSessionRequest()); EXPECT_FALSE(result); } diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftCreateSessionOnQueueActivityTest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftCreateSessionOnQueueActivityTest.cpp index 4845586e47..b60b091a2f 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftCreateSessionOnQueueActivityTest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftCreateSessionOnQueueActivityTest.cpp @@ -35,7 +35,7 @@ TEST_F(AWSGameLiftCreateSessionOnQueueActivityTest, BuildAWSGameLiftCreateGameSe TEST_F(AWSGameLiftCreateSessionOnQueueActivityTest, ValidateCreateSessionOnQueueRequest_CallWithBaseType_GetFalseResult) { - auto result = CreateSessionOnQueueActivity::ValidateCreateSessionOnQueueRequest(AzFramework::CreateSessionRequest()); + auto result = CreateSessionOnQueueActivity::ValidateCreateSessionOnQueueRequest(Multiplayer::CreateSessionRequest()); EXPECT_FALSE(result); } diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftJoinSessionActivityTest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftJoinSessionActivityTest.cpp index 33b03649c7..664baa55cb 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftJoinSessionActivityTest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftJoinSessionActivityTest.cpp @@ -6,7 +6,7 @@ * */ -#include +#include #include #include @@ -47,7 +47,7 @@ TEST_F(AWSGameLiftJoinSessionActivityTest, BuildSessionConnectionConfig_Call_Get TEST_F(AWSGameLiftJoinSessionActivityTest, ValidateJoinSessionRequest_CallWithBaseType_GetFalseResult) { AZ_TEST_START_TRACE_SUPPRESSION; - auto result = JoinSessionActivity::ValidateJoinSessionRequest(AzFramework::JoinSessionRequest()); + auto result = JoinSessionActivity::ValidateJoinSessionRequest(Multiplayer::JoinSessionRequest()); AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message EXPECT_FALSE(result); } diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftSearchSessionsActivityTest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftSearchSessionsActivityTest.cpp index 0d3c8c137b..d627731a02 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftSearchSessionsActivityTest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftSearchSessionsActivityTest.cpp @@ -6,7 +6,7 @@ * */ -#include +#include #include #include @@ -45,7 +45,7 @@ TEST_F(AWSGameLiftSearchSessionsActivityTest, BuildAWSGameLiftSearchGameSessions TEST_F(AWSGameLiftSearchSessionsActivityTest, ValidateSearchSessionsRequest_CallWithBaseType_GetFalseResult) { AZ_TEST_START_TRACE_SUPPRESSION; - auto result = SearchSessionsActivity::ValidateSearchSessionsRequest(AzFramework::SearchSessionsRequest()); + auto result = SearchSessionsActivity::ValidateSearchSessionsRequest(Multiplayer::SearchSessionsRequest()); AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message EXPECT_FALSE(result); } diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftStartMatchmakingActivityTest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftStartMatchmakingActivityTest.cpp index 6da932828c..66b253c33d 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftStartMatchmakingActivityTest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftStartMatchmakingActivityTest.cpp @@ -49,7 +49,7 @@ TEST_F(AWSGameLiftStartMatchmakingActivityTest, BuildAWSGameLiftStartMatchmaking TEST_F(AWSGameLiftStartMatchmakingActivityTest, ValidateStartMatchmakingRequest_CallWithBaseType_GetFalseResult) { AZ_TEST_START_TRACE_SUPPRESSION; - auto result = StartMatchmakingActivity::ValidateStartMatchmakingRequest(AzFramework::StartMatchmakingRequest()); + auto result = StartMatchmakingActivity::ValidateStartMatchmakingRequest(Multiplayer::StartMatchmakingRequest()); EXPECT_FALSE(result); AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message } diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftStopMatchmakingActivityTest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftStopMatchmakingActivityTest.cpp index ba0e40c7e6..6c99f59240 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftStopMatchmakingActivityTest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftStopMatchmakingActivityTest.cpp @@ -26,7 +26,7 @@ TEST_F(AWSGameLiftStopMatchmakingActivityTest, BuildAWSGameLiftStopMatchmakingRe TEST_F(AWSGameLiftStopMatchmakingActivityTest, ValidateStopMatchmakingRequest_CallWithoutTicketId_GetFalseResult) { AZ_TEST_START_TRACE_SUPPRESSION; - auto result = StopMatchmakingActivity::ValidateStopMatchmakingRequest(AzFramework::StopMatchmakingRequest()); + auto result = StopMatchmakingActivity::ValidateStopMatchmakingRequest(Multiplayer::StopMatchmakingRequest()); EXPECT_FALSE(result); AZ_TEST_STOP_TRACE_SUPPRESSION(1); // capture 1 error message } diff --git a/Gems/AWSGameLift/Code/AWSGameLiftServer/CMakeLists.txt b/Gems/AWSGameLift/Code/AWSGameLiftServer/CMakeLists.txt index d05ec46b52..9702130c04 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftServer/CMakeLists.txt +++ b/Gems/AWSGameLift/Code/AWSGameLiftServer/CMakeLists.txt @@ -25,7 +25,7 @@ ly_add_target( BUILD_DEPENDENCIES PRIVATE AZ::AzCore - AZ::AzFramework + Gem::Multiplayer.Static 3rdParty::AWSGameLiftServerSDK ) @@ -62,8 +62,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzCore - AZ::AzFramework AZ::AzTest + Gem::Multiplayer.Static Gem::AWSGameLift.Server.Static 3rdParty::AWSGameLiftServerSDK ) diff --git a/Gems/AWSGameLift/Code/AWSGameLiftServer/Source/AWSGameLiftServerManager.cpp b/Gems/AWSGameLift/Code/AWSGameLiftServer/Source/AWSGameLiftServerManager.cpp index 0ef028219c..898aa54c98 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftServer/Source/AWSGameLiftServerManager.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftServer/Source/AWSGameLiftServerManager.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include namespace AWSGameLift { @@ -50,7 +50,7 @@ namespace AWSGameLift AZ::Interface::Unregister(this); } - bool AWSGameLiftServerManager::AddConnectedPlayer(const AzFramework::PlayerConnectionConfig& playerConnectionConfig) + bool AWSGameLiftServerManager::AddConnectedPlayer(const Multiplayer::PlayerConnectionConfig& playerConnectionConfig) { AZStd::lock_guard lock(m_gameliftMutex); if (m_connectedPlayers.contains(playerConnectionConfig.m_playerConnectionId)) @@ -100,9 +100,9 @@ namespace AWSGameLift return serverProcessDesc; } - AzFramework::SessionConfig AWSGameLiftServerManager::BuildSessionConfig(const Aws::GameLift::Server::Model::GameSession& gameSession) + Multiplayer::SessionConfig AWSGameLiftServerManager::BuildSessionConfig(const Aws::GameLift::Server::Model::GameSession& gameSession) { - AzFramework::SessionConfig sessionConfig; + Multiplayer::SessionConfig sessionConfig; sessionConfig.m_dnsName = gameSession.GetDnsName().c_str(); AZStd::string propertiesOutput = ""; @@ -437,9 +437,9 @@ namespace AWSGameLift void AWSGameLiftServerManager::HandleDestroySession() { // No further request should be handled by GameLift server manager at this point - if (AZ::Interface::Get()) + if (AZ::Interface::Get()) { - AZ::Interface::Unregister(this); + AZ::Interface::Unregister(this); } AZ_TracePrintf(AWSGameLiftServerManagerName, "Server process is scheduled to be shut down at %s", @@ -448,7 +448,7 @@ namespace AWSGameLift // Send notifications to handler(s) to gracefully shut down the server process. bool destroySessionResult = true; AZ::EBusReduceResult> result(destroySessionResult); - AzFramework::SessionNotificationBus::BroadcastResult(result, &AzFramework::SessionNotifications::OnDestroySessionBegin); + Multiplayer::SessionNotificationBus::BroadcastResult(result, &Multiplayer::SessionNotifications::OnDestroySessionBegin); if (!destroySessionResult) { @@ -461,7 +461,7 @@ namespace AWSGameLift if (processEndingOutcome.IsSuccess()) { AZ_TracePrintf(AWSGameLiftServerManagerName, "ProcessEnding request against Amazon GameLift service succeeded."); - AzFramework::SessionNotificationBus::Broadcast(&AzFramework::SessionNotifications::OnDestroySessionEnd); + Multiplayer::SessionNotificationBus::Broadcast(&Multiplayer::SessionNotifications::OnDestroySessionEnd); } else { @@ -470,7 +470,7 @@ namespace AWSGameLift } } - void AWSGameLiftServerManager::HandlePlayerLeaveSession(const AzFramework::PlayerConnectionConfig& playerConnectionConfig) + void AWSGameLiftServerManager::HandlePlayerLeaveSession(const Multiplayer::PlayerConnectionConfig& playerConnectionConfig) { AZStd::string playerSessionId = ""; RemoveConnectedPlayer(playerConnectionConfig.m_playerConnectionId, playerSessionId); @@ -536,12 +536,12 @@ namespace AWSGameLift void AWSGameLiftServerManager::OnStartGameSession(const Aws::GameLift::Server::Model::GameSession& gameSession) { UpdateGameSessionData(gameSession); - AzFramework::SessionConfig sessionConfig = BuildSessionConfig(gameSession); + Multiplayer::SessionConfig sessionConfig = BuildSessionConfig(gameSession); bool createSessionResult = true; AZ::EBusReduceResult> result(createSessionResult); - AzFramework::SessionNotificationBus::BroadcastResult( - result, &AzFramework::SessionNotifications::OnCreateSessionBegin, sessionConfig); + Multiplayer::SessionNotificationBus::BroadcastResult( + result, &Multiplayer::SessionNotifications::OnCreateSessionBegin, sessionConfig); if (createSessionResult) { @@ -552,11 +552,11 @@ namespace AWSGameLift { AZ_TracePrintf(AWSGameLiftServerManagerName, "ActivateGameSession request against Amazon GameLift service succeeded."); // Register server manager as handler once game session has been activated - if (!AZ::Interface::Get()) + if (!AZ::Interface::Get()) { - AZ::Interface::Register(this); + AZ::Interface::Register(this); } - AzFramework::SessionNotificationBus::Broadcast(&AzFramework::SessionNotifications::OnCreateSessionEnd); + Multiplayer::SessionNotificationBus::Broadcast(&Multiplayer::SessionNotifications::OnCreateSessionEnd); } else { @@ -583,16 +583,16 @@ namespace AWSGameLift { bool healthCheckResult = true; AZ::EBusReduceResult> result(healthCheckResult); - AzFramework::SessionNotificationBus::BroadcastResult(result, &AzFramework::SessionNotifications::OnSessionHealthCheck); + Multiplayer::SessionNotificationBus::BroadcastResult(result, &Multiplayer::SessionNotifications::OnSessionHealthCheck); return m_serverSDKInitialized && healthCheckResult; } void AWSGameLiftServerManager::OnUpdateGameSession(const Aws::GameLift::Server::Model::UpdateGameSession& updateGameSession) { - AzFramework::SessionConfig sessionConfig = BuildSessionConfig(updateGameSession.GetGameSession()); + Multiplayer::SessionConfig sessionConfig = BuildSessionConfig(updateGameSession.GetGameSession()); Aws::GameLift::Server::Model::UpdateReason updateReason = updateGameSession.GetUpdateReason(); - AzFramework::SessionNotificationBus::Broadcast(&AzFramework::SessionNotifications::OnUpdateSessionBegin, + Multiplayer::SessionNotificationBus::Broadcast(&Multiplayer::SessionNotifications::OnUpdateSessionBegin, sessionConfig, Aws::GameLift::Server::Model::UpdateReasonMapper::GetNameForUpdateReason(updateReason).c_str()); // Update game session data locally @@ -601,7 +601,7 @@ namespace AWSGameLift UpdateGameSessionData(updateGameSession.GetGameSession()); } - AzFramework::SessionNotificationBus::Broadcast(&AzFramework::SessionNotifications::OnUpdateSessionEnd); + Multiplayer::SessionNotificationBus::Broadcast(&Multiplayer::SessionNotifications::OnUpdateSessionEnd); } bool AWSGameLiftServerManager::RemoveConnectedPlayer(uint32_t playerConnectionId, AZStd::string& outPlayerSessionId) @@ -713,7 +713,7 @@ namespace AWSGameLift } } - bool AWSGameLiftServerManager::ValidatePlayerJoinSession(const AzFramework::PlayerConnectionConfig& playerConnectionConfig) + bool AWSGameLiftServerManager::ValidatePlayerJoinSession(const Multiplayer::PlayerConnectionConfig& playerConnectionConfig) { uint32_t playerConnectionId = playerConnectionConfig.m_playerConnectionId; AZStd::string playerSessionId = playerConnectionConfig.m_playerSessionId; diff --git a/Gems/AWSGameLift/Code/AWSGameLiftServer/Source/AWSGameLiftServerManager.h b/Gems/AWSGameLift/Code/AWSGameLiftServer/Source/AWSGameLiftServerManager.h index 6e7ce4e005..673172dc9a 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftServer/Source/AWSGameLiftServerManager.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftServer/Source/AWSGameLiftServerManager.h @@ -16,8 +16,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -37,7 +37,7 @@ namespace AWSGameLift //! Manage the server process for hosting game sessions via GameLiftServerSDK. class AWSGameLiftServerManager : public AWSGameLiftServerRequestBus::Handler - , public AzFramework::ISessionHandlingProviderRequests + , public Multiplayer::ISessionHandlingProviderRequests { public: static constexpr const char AWSGameLiftServerManagerName[] = "AWSGameLiftServerManager"; @@ -117,8 +117,8 @@ namespace AWSGameLift // ISessionHandlingProviderRequests interface implementation void HandleDestroySession() override; - bool ValidatePlayerJoinSession(const AzFramework::PlayerConnectionConfig& playerConnectionConfig) override; - void HandlePlayerLeaveSession(const AzFramework::PlayerConnectionConfig& playerConnectionConfig) override; + bool ValidatePlayerJoinSession(const Multiplayer::PlayerConnectionConfig& playerConnectionConfig) override; + void HandlePlayerLeaveSession(const Multiplayer::PlayerConnectionConfig& playerConnectionConfig) override; AZ::IO::Path GetExternalSessionCertificate() override; AZ::IO::Path GetInternalSessionCertificate() override; @@ -126,7 +126,7 @@ namespace AWSGameLift void SetGameLiftServerSDKWrapper(AZStd::unique_ptr gameLiftServerSDKWrapper); //! Add connected player session id. - bool AddConnectedPlayer(const AzFramework::PlayerConnectionConfig& playerConnectionConfig); + bool AddConnectedPlayer(const Multiplayer::PlayerConnectionConfig& playerConnectionConfig); //! Get active server player data from lazy loaded game session for server match backfill AZStd::vector GetActiveServerMatchBackfillPlayers(); @@ -157,7 +157,7 @@ namespace AWSGameLift void BuildStopMatchBackfillRequest(const AZStd::string& ticketId, Aws::GameLift::Server::Model::StopMatchBackfillRequest& outRequest); //! Build session config by using AWS GameLift Server GameSession Model. - AzFramework::SessionConfig BuildSessionConfig(const Aws::GameLift::Server::Model::GameSession& gameSession); + Multiplayer::SessionConfig BuildSessionConfig(const Aws::GameLift::Server::Model::GameSession& gameSession); //! Check whether matchmaking data is in proper format bool IsMatchmakingDataValid(); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftServer/Tests/AWSGameLiftServerManagerTest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftServer/Tests/AWSGameLiftServerManagerTest.cpp index 96d6a69d96..4f69fd7d4c 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftServer/Tests/AWSGameLiftServerManagerTest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftServer/Tests/AWSGameLiftServerManagerTest.cpp @@ -11,8 +11,8 @@ #include #include -#include -#include +#include +#include namespace UnitTest { @@ -154,25 +154,25 @@ R"({ } class SessionNotificationsHandlerMock - : public AzFramework::SessionNotificationBus::Handler + : public Multiplayer::SessionNotificationBus::Handler { public: SessionNotificationsHandlerMock() { - AzFramework::SessionNotificationBus::Handler::BusConnect(); + Multiplayer::SessionNotificationBus::Handler::BusConnect(); } ~SessionNotificationsHandlerMock() { - AzFramework::SessionNotificationBus::Handler::BusDisconnect(); + Multiplayer::SessionNotificationBus::Handler::BusDisconnect(); } MOCK_METHOD0(OnSessionHealthCheck, bool()); - MOCK_METHOD1(OnCreateSessionBegin, bool(const AzFramework::SessionConfig&)); + MOCK_METHOD1(OnCreateSessionBegin, bool(const Multiplayer::SessionConfig&)); MOCK_METHOD0(OnCreateSessionEnd, void()); MOCK_METHOD0(OnDestroySessionBegin, bool()); MOCK_METHOD0(OnDestroySessionEnd, void()); - MOCK_METHOD2(OnUpdateSessionBegin, void(const AzFramework::SessionConfig&, const AZStd::string&)); + MOCK_METHOD2(OnUpdateSessionBegin, void(const Multiplayer::SessionConfig&, const AZStd::string&)); MOCK_METHOD0(OnUpdateSessionEnd, void()); }; @@ -255,9 +255,9 @@ R"({ { m_serverManager->InitializeGameLiftServerSDK(); m_serverManager->NotifyGameLiftProcessReady(); - if (!AZ::Interface::Get()) + if (!AZ::Interface::Get()) { - AZ::Interface::Register(m_serverManager.get()); + AZ::Interface::Register(m_serverManager.get()); } SessionNotificationsHandlerMock handlerMock; @@ -270,16 +270,16 @@ R"({ m_serverManager->m_gameLiftServerSDKWrapperMockPtr->m_onProcessTerminateFunc(); AZ_TEST_STOP_TRACE_SUPPRESSION(1); - EXPECT_FALSE(AZ::Interface::Get()); + EXPECT_FALSE(AZ::Interface::Get()); } TEST_F(GameLiftServerManagerTest, OnProcessTerminate_OnDestroySessionBeginReturnsTrue_TerminationNotificationSent) { m_serverManager->InitializeGameLiftServerSDK(); m_serverManager->NotifyGameLiftProcessReady(); - if (!AZ::Interface::Get()) + if (!AZ::Interface::Get()) { - AZ::Interface::Register(m_serverManager.get()); + AZ::Interface::Register(m_serverManager.get()); } SessionNotificationsHandlerMock handlerMock; @@ -292,16 +292,16 @@ R"({ m_serverManager->m_gameLiftServerSDKWrapperMockPtr->m_onProcessTerminateFunc(); - EXPECT_FALSE(AZ::Interface::Get()); + EXPECT_FALSE(AZ::Interface::Get()); } TEST_F(GameLiftServerManagerTest, OnProcessTerminate_OnDestroySessionBeginReturnsTrue_TerminationNotificationSentButFail) { m_serverManager->InitializeGameLiftServerSDK(); m_serverManager->NotifyGameLiftProcessReady(); - if (!AZ::Interface::Get()) + if (!AZ::Interface::Get()) { - AZ::Interface::Register(m_serverManager.get()); + AZ::Interface::Register(m_serverManager.get()); } SessionNotificationsHandlerMock handlerMock; @@ -316,7 +316,7 @@ R"({ m_serverManager->m_gameLiftServerSDKWrapperMockPtr->m_onProcessTerminateFunc(); AZ_TEST_STOP_TRACE_SUPPRESSION(1); - EXPECT_FALSE(AZ::Interface::Get()); + EXPECT_FALSE(AZ::Interface::Get()); } TEST_F(GameLiftServerManagerTest, OnHealthCheck_OnSessionHealthCheckReturnsTrue_CallbackFunctionReturnsTrue) @@ -379,7 +379,7 @@ R"({ testProperty.SetValue("testValue"); testSession.AddGameProperties(testProperty); m_serverManager->m_gameLiftServerSDKWrapperMockPtr->m_onStartGameSessionFunc(testSession); - EXPECT_TRUE(AZ::Interface::Get()); + EXPECT_TRUE(AZ::Interface::Get()); m_serverManager->HandleDestroySession(); } @@ -465,14 +465,14 @@ R"({ TEST_F(GameLiftServerManagerTest, ValidatePlayerJoinSession_CallWithInvalidConnectionConfig_GetFalseResultAndExpectedErrorLog) { AZ_TEST_START_TRACE_SUPPRESSION; - auto result = m_serverManager->ValidatePlayerJoinSession(AzFramework::PlayerConnectionConfig()); + auto result = m_serverManager->ValidatePlayerJoinSession(Multiplayer::PlayerConnectionConfig()); AZ_TEST_STOP_TRACE_SUPPRESSION(1); EXPECT_FALSE(result); } TEST_F(GameLiftServerManagerTest, ValidatePlayerJoinSession_CallWithDuplicatedConnectionId_GetFalseResultAndExpectedErrorLog) { - AzFramework::PlayerConnectionConfig connectionConfig1; + Multiplayer::PlayerConnectionConfig connectionConfig1; connectionConfig1.m_playerConnectionId = 123; connectionConfig1.m_playerSessionId = "dummyPlayerSessionId1"; GenericOutcome successOutcome(nullptr); @@ -480,7 +480,7 @@ R"({ .Times(1) .WillOnce(Return(successOutcome)); m_serverManager->ValidatePlayerJoinSession(connectionConfig1); - AzFramework::PlayerConnectionConfig connectionConfig2; + Multiplayer::PlayerConnectionConfig connectionConfig2; connectionConfig2.m_playerConnectionId = 123; connectionConfig2.m_playerSessionId = "dummyPlayerSessionId2"; AZ_TEST_START_TRACE_SUPPRESSION; @@ -491,7 +491,7 @@ R"({ TEST_F(GameLiftServerManagerTest, ValidatePlayerJoinSession_CallWithValidConnectionConfigButErrorOutcome_GetFalseResultAndExpectedErrorLog) { - AzFramework::PlayerConnectionConfig connectionConfig; + Multiplayer::PlayerConnectionConfig connectionConfig; connectionConfig.m_playerConnectionId = 123; connectionConfig.m_playerSessionId = "dummyPlayerSessionId1"; EXPECT_CALL(*(m_serverManager->m_gameLiftServerSDKWrapperMockPtr), AcceptPlayerSession(testing::_)).Times(1); @@ -503,7 +503,7 @@ R"({ TEST_F(GameLiftServerManagerTest, ValidatePlayerJoinSession_CallWithValidConnectionConfigAndSuccessOutcome_GetTrueResult) { - AzFramework::PlayerConnectionConfig connectionConfig; + Multiplayer::PlayerConnectionConfig connectionConfig; connectionConfig.m_playerConnectionId = 123; connectionConfig.m_playerSessionId = "dummyPlayerSessionId1"; GenericOutcome successOutcome(nullptr); @@ -516,7 +516,7 @@ R"({ TEST_F(GameLiftServerManagerTest, ValidatePlayerJoinSession_CallWithFirstErrorSecondSuccess_GetFirstFalseSecondTrueResult) { - AzFramework::PlayerConnectionConfig connectionConfig1; + Multiplayer::PlayerConnectionConfig connectionConfig1; connectionConfig1.m_playerConnectionId = 123; connectionConfig1.m_playerSessionId = "dummyPlayerSessionId1"; GenericOutcome successOutcome(nullptr); @@ -530,7 +530,7 @@ R"({ auto result = m_serverManager->ValidatePlayerJoinSession(connectionConfig1); AZ_TEST_STOP_TRACE_SUPPRESSION(1); EXPECT_FALSE(result); - AzFramework::PlayerConnectionConfig connectionConfig2; + Multiplayer::PlayerConnectionConfig connectionConfig2; connectionConfig2.m_playerConnectionId = 123; connectionConfig2.m_playerSessionId = "dummyPlayerSessionId2"; result = m_serverManager->ValidatePlayerJoinSession(connectionConfig2); @@ -549,7 +549,7 @@ R"({ for (int index = 0; index < testThreadNumber; index++) { testThreadPool.emplace_back(AZStd::thread([&]() { - AzFramework::PlayerConnectionConfig connectionConfig; + Multiplayer::PlayerConnectionConfig connectionConfig; connectionConfig.m_playerConnectionId = 123; connectionConfig.m_playerSessionId = "dummyPlayerSessionId"; auto result = m_serverManager->ValidatePlayerJoinSession(connectionConfig); @@ -571,19 +571,19 @@ R"({ EXPECT_CALL(*(m_serverManager->m_gameLiftServerSDKWrapperMockPtr), RemovePlayerSession(testing::_)).Times(0); AZ_TEST_START_TRACE_SUPPRESSION; - m_serverManager->HandlePlayerLeaveSession(AzFramework::PlayerConnectionConfig()); + m_serverManager->HandlePlayerLeaveSession(Multiplayer::PlayerConnectionConfig()); AZ_TEST_STOP_TRACE_SUPPRESSION(1); } TEST_F(GameLiftServerManagerTest, HandlePlayerLeaveSession_CallWithNonExistentPlayerConnectionId_GetExpectedErrorLog) { - AzFramework::PlayerConnectionConfig connectionConfig; + Multiplayer::PlayerConnectionConfig connectionConfig; connectionConfig.m_playerConnectionId = 123; connectionConfig.m_playerSessionId = "dummyPlayerSessionId"; auto result = m_serverManager->AddConnectedTestPlayer(connectionConfig); EXPECT_TRUE(result); - AzFramework::PlayerConnectionConfig connectionConfig1; + Multiplayer::PlayerConnectionConfig connectionConfig1; connectionConfig1.m_playerConnectionId = 456; connectionConfig1.m_playerSessionId = "dummyPlayerSessionId"; @@ -596,7 +596,7 @@ R"({ TEST_F(GameLiftServerManagerTest, HandlePlayerLeaveSession_CallWithValidConnectionConfigButErrorOutcome_GetExpectedErrorLog) { - AzFramework::PlayerConnectionConfig connectionConfig; + Multiplayer::PlayerConnectionConfig connectionConfig; connectionConfig.m_playerConnectionId = 123; connectionConfig.m_playerSessionId = "dummyPlayerSessionId"; auto result = m_serverManager->AddConnectedTestPlayer(connectionConfig); @@ -615,7 +615,7 @@ R"({ TEST_F(GameLiftServerManagerTest, HandlePlayerLeaveSession_CallWithValidConnectionConfigAndSuccessOutcome_RemovePlayerSessionNotificationSent) { - AzFramework::PlayerConnectionConfig connectionConfig; + Multiplayer::PlayerConnectionConfig connectionConfig; connectionConfig.m_playerConnectionId = 123; connectionConfig.m_playerSessionId = "dummyPlayerSessionId"; auto result = m_serverManager->AddConnectedTestPlayer(connectionConfig); @@ -631,7 +631,7 @@ R"({ TEST_F(GameLiftServerManagerTest, HandlePlayerLeaveSession_CallWithMultithread_OnlyOneNotificationIsSent) { - AzFramework::PlayerConnectionConfig connectionConfig; + Multiplayer::PlayerConnectionConfig connectionConfig; connectionConfig.m_playerConnectionId = 123; connectionConfig.m_playerSessionId = "dummyPlayerSessionId"; auto result = m_serverManager->AddConnectedTestPlayer(connectionConfig); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftServer/Tests/AWSGameLiftServerMocks.h b/Gems/AWSGameLift/Code/AWSGameLiftServer/Tests/AWSGameLiftServerMocks.h index 7ab9c51cd1..37f7d5595e 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftServer/Tests/AWSGameLiftServerMocks.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftServer/Tests/AWSGameLiftServerMocks.h @@ -95,7 +95,7 @@ namespace UnitTest UpdateGameSessionData(m_testGameSession); } - bool AddConnectedTestPlayer(const AzFramework::PlayerConnectionConfig& playerConnectionConfig) + bool AddConnectedTestPlayer(const Multiplayer::PlayerConnectionConfig& playerConnectionConfig) { return AddConnectedPlayer(playerConnectionConfig); } diff --git a/Code/Framework/AzFramework/AzFramework/Matchmaking/IMatchmakingRequests.h b/Gems/Multiplayer/Code/Include/Multiplayer/Session/IMatchmakingRequests.h similarity index 97% rename from Code/Framework/AzFramework/AzFramework/Matchmaking/IMatchmakingRequests.h rename to Gems/Multiplayer/Code/Include/Multiplayer/Session/IMatchmakingRequests.h index ccf9acdf8b..fff1c2f0af 100644 --- a/Code/Framework/AzFramework/AzFramework/Matchmaking/IMatchmakingRequests.h +++ b/Gems/Multiplayer/Code/Include/Multiplayer/Session/IMatchmakingRequests.h @@ -10,9 +10,9 @@ #include #include -#include +#include -namespace AzFramework +namespace Multiplayer { //! IMatchmakingRequests //! Pure virtual session interface class to abstract the details of session handling from application code. @@ -87,4 +87,4 @@ namespace AzFramework virtual void OnStopMatchmakingAsyncComplete() = 0; }; using MatchmakingAsyncRequestNotificationBus = AZ::EBus; -} // namespace AzFramework +} // namespace Multiplayer diff --git a/Code/Framework/AzFramework/AzFramework/Session/ISessionHandlingRequests.h b/Gems/Multiplayer/Code/Include/Multiplayer/Session/ISessionHandlingRequests.h similarity index 98% rename from Code/Framework/AzFramework/AzFramework/Session/ISessionHandlingRequests.h rename to Gems/Multiplayer/Code/Include/Multiplayer/Session/ISessionHandlingRequests.h index 188ea7b994..022d1743b3 100644 --- a/Code/Framework/AzFramework/AzFramework/Session/ISessionHandlingRequests.h +++ b/Gems/Multiplayer/Code/Include/Multiplayer/Session/ISessionHandlingRequests.h @@ -12,7 +12,7 @@ #include #include -namespace AzFramework +namespace Multiplayer { //! SessionConnectionConfig //! The properties for handling join session request. @@ -91,4 +91,4 @@ namespace AzFramework //! empty string. virtual AZ::IO::Path GetInternalSessionCertificate() = 0; }; -} // namespace AzFramework +} // namespace Multiplayer diff --git a/Code/Framework/AzFramework/AzFramework/Session/ISessionRequests.h b/Gems/Multiplayer/Code/Include/Multiplayer/Session/ISessionRequests.h similarity index 97% rename from Code/Framework/AzFramework/AzFramework/Session/ISessionRequests.h rename to Gems/Multiplayer/Code/Include/Multiplayer/Session/ISessionRequests.h index 8b985a3187..d4a5737546 100644 --- a/Code/Framework/AzFramework/AzFramework/Session/ISessionRequests.h +++ b/Gems/Multiplayer/Code/Include/Multiplayer/Session/ISessionRequests.h @@ -11,9 +11,9 @@ #include #include #include -#include +#include -namespace AzFramework +namespace Multiplayer { //! ISessionRequests //! Pure virtual session interface class to abstract the details of session handling from application code. @@ -101,4 +101,4 @@ namespace AzFramework virtual void OnLeaveSessionAsyncComplete() = 0; }; using SessionAsyncRequestNotificationBus = AZ::EBus; -} // namespace AzFramework +} // namespace Multiplayer diff --git a/Code/Framework/AzFramework/AzFramework/Matchmaking/MatchmakingNotifications.h b/Gems/Multiplayer/Code/Include/Multiplayer/Session/MatchmakingNotifications.h similarity index 97% rename from Code/Framework/AzFramework/AzFramework/Matchmaking/MatchmakingNotifications.h rename to Gems/Multiplayer/Code/Include/Multiplayer/Session/MatchmakingNotifications.h index 0ec52c7215..70ff67ff21 100644 --- a/Code/Framework/AzFramework/AzFramework/Matchmaking/MatchmakingNotifications.h +++ b/Gems/Multiplayer/Code/Include/Multiplayer/Session/MatchmakingNotifications.h @@ -11,7 +11,7 @@ #include #include -namespace AzFramework +namespace Multiplayer { //! MatchmakingNotifications //! The matchmaking notifications to listen for performing required operations @@ -43,4 +43,4 @@ namespace AzFramework virtual void OnMatchFailure() = 0; }; using MatchmakingNotificationBus = AZ::EBus; -} // namespace AzFramework +} // namespace Multiplayer diff --git a/Code/Framework/AzFramework/AzFramework/Matchmaking/MatchmakingRequests.h b/Gems/Multiplayer/Code/Include/Multiplayer/Session/MatchmakingRequests.h similarity index 97% rename from Code/Framework/AzFramework/AzFramework/Matchmaking/MatchmakingRequests.h rename to Gems/Multiplayer/Code/Include/Multiplayer/Session/MatchmakingRequests.h index 5f5dcc0643..b07b7a55f8 100644 --- a/Code/Framework/AzFramework/AzFramework/Matchmaking/MatchmakingRequests.h +++ b/Gems/Multiplayer/Code/Include/Multiplayer/Session/MatchmakingRequests.h @@ -17,7 +17,7 @@ namespace AZ class ReflectContext; } -namespace AzFramework +namespace Multiplayer { //! AcceptMatchRequest //! The container for AcceptMatch request parameters. @@ -64,4 +64,4 @@ namespace AzFramework //! A unique identifier for a matchmaking ticket AZStd::string m_ticketId; }; -} // namespace AzFramework +} // namespace Multiplayer diff --git a/Code/Framework/AzFramework/AzFramework/Session/SessionConfig.h b/Gems/Multiplayer/Code/Include/Multiplayer/Session/SessionConfig.h similarity index 97% rename from Code/Framework/AzFramework/AzFramework/Session/SessionConfig.h rename to Gems/Multiplayer/Code/Include/Multiplayer/Session/SessionConfig.h index f951cf58fa..3ed5ab891a 100644 --- a/Code/Framework/AzFramework/AzFramework/Session/SessionConfig.h +++ b/Gems/Multiplayer/Code/Include/Multiplayer/Session/SessionConfig.h @@ -12,7 +12,7 @@ #include #include -namespace AzFramework +namespace Multiplayer { //! SessionConfig //! Properties describing a session. @@ -66,4 +66,4 @@ namespace AzFramework //! Provides additional information about session status. AZStd::string m_statusReason; }; -} // namespace AzFramework +} // namespace Multiplayer diff --git a/Code/Framework/AzFramework/AzFramework/Session/SessionNotifications.h b/Gems/Multiplayer/Code/Include/Multiplayer/Session/SessionNotifications.h similarity index 98% rename from Code/Framework/AzFramework/AzFramework/Session/SessionNotifications.h rename to Gems/Multiplayer/Code/Include/Multiplayer/Session/SessionNotifications.h index cf1382aeba..90abfaded5 100644 --- a/Code/Framework/AzFramework/AzFramework/Session/SessionNotifications.h +++ b/Gems/Multiplayer/Code/Include/Multiplayer/Session/SessionNotifications.h @@ -10,7 +10,7 @@ #include -namespace AzFramework +namespace Multiplayer { struct SessionConfig; @@ -68,4 +68,4 @@ namespace AzFramework virtual void OnUpdateSessionEnd() = 0; }; using SessionNotificationBus = AZ::EBus; -} // namespace AzFramework +} // namespace Multiplayer diff --git a/Code/Framework/AzFramework/AzFramework/Session/SessionRequests.h b/Gems/Multiplayer/Code/Include/Multiplayer/Session/SessionRequests.h similarity index 98% rename from Code/Framework/AzFramework/AzFramework/Session/SessionRequests.h rename to Gems/Multiplayer/Code/Include/Multiplayer/Session/SessionRequests.h index d806e6fefa..75abd52f29 100644 --- a/Code/Framework/AzFramework/AzFramework/Session/SessionRequests.h +++ b/Gems/Multiplayer/Code/Include/Multiplayer/Session/SessionRequests.h @@ -17,7 +17,7 @@ namespace AZ class ReflectContext; } -namespace AzFramework +namespace Multiplayer { struct SessionConfig; @@ -104,4 +104,4 @@ namespace AzFramework //! Developer-defined information related to a player. AZStd::string m_playerData; }; -} // namespace AzFramework +} // namespace Multiplayer diff --git a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp index dcad230f71..dad584d3e8 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include @@ -30,8 +32,6 @@ #include #include #include -#include -#include #include #include #include @@ -184,13 +184,13 @@ namespace Multiplayer void MultiplayerSystemComponent::Activate() { AZ::TickBus::Handler::BusConnect(); - AzFramework::SessionNotificationBus::Handler::BusConnect(); + SessionNotificationBus::Handler::BusConnect(); m_networkInterface = AZ::Interface::Get()->CreateNetworkInterface(AZ::Name(MpNetworkInterfaceName), sv_protocol, TrustZone::ExternalClientToServer, *this); if (AZ::Interface::Get()) { m_consoleCommandHandler.Connect(AZ::Interface::Get()->GetConsoleCommandInvokedEvent()); } - AZ::Interface::Register(this); + AZ::Interface::Register(this); //! Register our gems multiplayer components to assign NetComponentIds RegisterMultiplayerComponents(); @@ -198,10 +198,10 @@ namespace Multiplayer void MultiplayerSystemComponent::Deactivate() { - AZ::Interface::Unregister(this); + AZ::Interface::Unregister(this); m_consoleCommandHandler.Disconnect(); AZ::Interface::Get()->DestroyNetworkInterface(AZ::Name(MpNetworkInterfaceName)); - AzFramework::SessionNotificationBus::Handler::BusDisconnect(); + SessionNotificationBus::Handler::BusDisconnect(); AZ::TickBus::Handler::BusDisconnect(); m_networkEntityManager.Reset(); @@ -251,14 +251,14 @@ namespace Multiplayer // Signal session management, do this after uninitializing state if (agentType == MultiplayerAgentType::DedicatedServer || agentType == MultiplayerAgentType::ClientServer) { - if (AZ::Interface::Get() != nullptr) + if (AZ::Interface::Get() != nullptr) { - AZ::Interface::Get()->HandleDestroySession(); + AZ::Interface::Get()->HandleDestroySession(); } } } - bool MultiplayerSystemComponent::RequestPlayerJoinSession(const AzFramework::SessionConnectionConfig& config) + bool MultiplayerSystemComponent::RequestPlayerJoinSession(const SessionConnectionConfig& config) { m_pendingConnectionTickets.push(config.m_playerSessionId); AZStd::string hostname = config.m_dnsName.empty() ? config.m_ipAddress : config.m_dnsName; @@ -280,13 +280,13 @@ namespace Multiplayer return true; } - bool MultiplayerSystemComponent::OnCreateSessionBegin(const AzFramework::SessionConfig& sessionConfig) + bool MultiplayerSystemComponent::OnCreateSessionBegin(const SessionConfig& sessionConfig) { // Check if session manager has a certificate for us and pass it along if so - if (AZ::Interface::Get() != nullptr) + if (AZ::Interface::Get() != nullptr) { AZ::CVarFixedString externalCertPath = AZ::CVarFixedString( - AZ::Interface::Get()->GetExternalSessionCertificate().c_str()); + AZ::Interface::Get()->GetExternalSessionCertificate().c_str()); if (!externalCertPath.empty()) { AZ::CVarFixedString commandString = "net_SslExternalCertificateFile " + externalCertPath; @@ -294,7 +294,7 @@ namespace Multiplayer } AZ::CVarFixedString internalCertPath = AZ::CVarFixedString( - AZ::Interface::Get()->GetInternalSessionCertificate().c_str()); + AZ::Interface::Get()->GetInternalSessionCertificate().c_str()); if (!internalCertPath.empty()) { AZ::CVarFixedString commandString = "net_SslInternalCertificateFile " + internalCertPath; @@ -335,7 +335,7 @@ namespace Multiplayer { } - void MultiplayerSystemComponent::OnUpdateSessionBegin(const AzFramework::SessionConfig& sessionConfig, const AZStd::string& updateReason) + void MultiplayerSystemComponent::OnUpdateSessionBegin(const SessionConfig& sessionConfig, const AZStd::string& updateReason) { AZ_UNUSED(sessionConfig); AZ_UNUSED(updateReason); @@ -496,12 +496,12 @@ namespace Multiplayer ) { // Validate our session with the provider if any - if (AZ::Interface::Get() != nullptr) + if (AZ::Interface::Get() != nullptr) { - AzFramework::PlayerConnectionConfig config; + PlayerConnectionConfig config; config.m_playerConnectionId = aznumeric_cast(connection->GetConnectionId()); config.m_playerSessionId = packet.GetTicket(); - if (!AZ::Interface::Get()->ValidatePlayerJoinSession(config)) + if (!AZ::Interface::Get()->ValidatePlayerJoinSession(config)) { auto visitor = [](IConnection& connection) { connection.Disconnect(DisconnectReason::TerminatedByUser, TerminationEndpoint::Local); }; m_networkInterface->GetConnectionSet().VisitConnections(visitor); @@ -780,13 +780,13 @@ namespace Multiplayer else if (m_agentType == MultiplayerAgentType::DedicatedServer || m_agentType == MultiplayerAgentType::ClientServer) { // Signal to session management that a user has left the server - if (AZ::Interface::Get() != nullptr && + if (AZ::Interface::Get() != nullptr && connection->GetConnectionRole() == ConnectionRole::Acceptor) { - AzFramework::PlayerConnectionConfig config; + PlayerConnectionConfig config; config.m_playerConnectionId = aznumeric_cast(connection->GetConnectionId()); config.m_playerSessionId = reinterpret_cast(connection->GetUserData())->GetProviderTicket(); - AZ::Interface::Get()->HandlePlayerLeaveSession(config); + AZ::Interface::Get()->HandlePlayerLeaveSession(config); } } diff --git a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h index 47238cc729..990ff86bbc 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h +++ b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h @@ -9,6 +9,8 @@ #pragma once #include +#include +#include #include #include #include @@ -21,8 +23,6 @@ #include #include #include -#include -#include #include namespace AzFramework @@ -41,8 +41,8 @@ namespace Multiplayer class MultiplayerSystemComponent final : public AZ::Component , public AZ::TickBus::Handler - , public AzFramework::SessionNotificationBus::Handler - , public AzFramework::ISessionHandlingClientRequests + , public SessionNotificationBus::Handler + , public ISessionHandlingClientRequests , public AzNetworking::IConnectionListener , public IMultiplayer { @@ -63,14 +63,14 @@ namespace Multiplayer void Deactivate() override; //! @} - //! AzFramework::SessionNotificationBus::Handler overrides. + //! SessionNotificationBus::Handler overrides. //! @{ bool OnSessionHealthCheck() override; - bool OnCreateSessionBegin(const AzFramework::SessionConfig& sessionConfig) override; + bool OnCreateSessionBegin(const SessionConfig& sessionConfig) override; void OnCreateSessionEnd() override; bool OnDestroySessionBegin() override; void OnDestroySessionEnd() override; - void OnUpdateSessionBegin(const AzFramework::SessionConfig& sessionConfig, const AZStd::string& updateReason) override; + void OnUpdateSessionBegin(const SessionConfig& sessionConfig, const AZStd::string& updateReason) override; void OnUpdateSessionEnd() override; //! @} @@ -101,7 +101,7 @@ namespace Multiplayer //! ISessionHandlingClientRequests interface //! @{ - bool RequestPlayerJoinSession(const AzFramework::SessionConnectionConfig& sessionConnectionConfig) override; + bool RequestPlayerJoinSession(const SessionConnectionConfig& sessionConnectionConfig) override; void RequestPlayerLeaveSession() override; //! @} diff --git a/Code/Framework/AzFramework/AzFramework/Matchmaking/MatchmakingRequests.cpp b/Gems/Multiplayer/Code/Source/Session/MatchmakingRequests.cpp similarity index 97% rename from Code/Framework/AzFramework/AzFramework/Matchmaking/MatchmakingRequests.cpp rename to Gems/Multiplayer/Code/Source/Session/MatchmakingRequests.cpp index b6c8c55fa4..4da2d7749e 100644 --- a/Code/Framework/AzFramework/AzFramework/Matchmaking/MatchmakingRequests.cpp +++ b/Gems/Multiplayer/Code/Source/Session/MatchmakingRequests.cpp @@ -9,9 +9,9 @@ #include #include #include -#include +#include -namespace AzFramework +namespace Multiplayer { void AcceptMatchRequest::Reflect(AZ::ReflectContext* context) { @@ -75,4 +75,4 @@ namespace AzFramework } } } -} // namespace AzFramework +} // namespace Multiplayer diff --git a/Code/Framework/AzFramework/AzFramework/Session/SessionConfig.cpp b/Gems/Multiplayer/Code/Source/Session/SessionConfig.cpp similarity index 85% rename from Code/Framework/AzFramework/AzFramework/Session/SessionConfig.cpp rename to Gems/Multiplayer/Code/Source/Session/SessionConfig.cpp index 0856ddeed6..87a220d34a 100644 --- a/Code/Framework/AzFramework/AzFramework/Session/SessionConfig.cpp +++ b/Gems/Multiplayer/Code/Source/Session/SessionConfig.cpp @@ -8,9 +8,9 @@ #include #include -#include +#include -namespace AzFramework +namespace Multiplayer { void SessionConfig::Reflect(AZ::ReflectContext* context) { @@ -39,35 +39,35 @@ namespace AzFramework editContext->Class("SessionConfig", "Properties describing a session") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) - ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_creationTime, + ->DataElement(AZ::Edit::UIHandlers::Default, &Multiplayer::SessionConfig::m_creationTime, "CreationTime", "A time stamp indicating when this session was created. Format is a number expressed in Unix time as milliseconds.") - ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_terminationTime, + ->DataElement(AZ::Edit::UIHandlers::Default, &Multiplayer::SessionConfig::m_terminationTime, "TerminationTime", "A time stamp indicating when this data object was terminated. Same format as creation time.") - ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_creatorId, + ->DataElement(AZ::Edit::UIHandlers::Default, &Multiplayer::SessionConfig::m_creatorId, "CreatorId", "A unique identifier for a player or entity creating the session.") - ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_sessionProperties, + ->DataElement(AZ::Edit::UIHandlers::Default, &Multiplayer::SessionConfig::m_sessionProperties, "SessionProperties", "A collection of custom properties for a session.") - ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_matchmakingData, + ->DataElement(AZ::Edit::UIHandlers::Default, &Multiplayer::SessionConfig::m_matchmakingData, "MatchmakingData", "The matchmaking process information that was used to create the session.") - ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_sessionId, + ->DataElement(AZ::Edit::UIHandlers::Default, &Multiplayer::SessionConfig::m_sessionId, "SessionId", "A unique identifier for the session.") - ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_sessionName, + ->DataElement(AZ::Edit::UIHandlers::Default, &Multiplayer::SessionConfig::m_sessionName, "SessionName", "A descriptive label that is associated with a session.") - ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_dnsName, + ->DataElement(AZ::Edit::UIHandlers::Default, &Multiplayer::SessionConfig::m_dnsName, "DnsName", "The DNS identifier assigned to the instance that is running the session.") - ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_ipAddress, + ->DataElement(AZ::Edit::UIHandlers::Default, &Multiplayer::SessionConfig::m_ipAddress, "IpAddress", "The IP address of the session.") - ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_port, + ->DataElement(AZ::Edit::UIHandlers::Default, &Multiplayer::SessionConfig::m_port, "Port", "The port number for the session.") - ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_maxPlayer, + ->DataElement(AZ::Edit::UIHandlers::Default, &Multiplayer::SessionConfig::m_maxPlayer, "MaxPlayer", "The maximum number of players that can be connected simultaneously to the session.") - ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_currentPlayer, + ->DataElement(AZ::Edit::UIHandlers::Default, &Multiplayer::SessionConfig::m_currentPlayer, "CurrentPlayer", "Number of players currently in the session.") - ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_status, + ->DataElement(AZ::Edit::UIHandlers::Default, &Multiplayer::SessionConfig::m_status, "Status", "Current status of the session.") - ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_statusReason, + ->DataElement(AZ::Edit::UIHandlers::Default, &Multiplayer::SessionConfig::m_statusReason, "StatusReason", "Provides additional information about session status."); } } } -} // namespace AzFramework +} // namespace Multiplayer diff --git a/Code/Framework/AzFramework/AzFramework/Session/SessionRequests.cpp b/Gems/Multiplayer/Code/Source/Session/SessionRequests.cpp similarity index 97% rename from Code/Framework/AzFramework/AzFramework/Session/SessionRequests.cpp rename to Gems/Multiplayer/Code/Source/Session/SessionRequests.cpp index a7ffaa2491..895078daa8 100644 --- a/Code/Framework/AzFramework/AzFramework/Session/SessionRequests.cpp +++ b/Gems/Multiplayer/Code/Source/Session/SessionRequests.cpp @@ -9,10 +9,10 @@ #include #include #include -#include -#include +#include +#include -namespace AzFramework +namespace Multiplayer { void CreateSessionRequest::Reflect(AZ::ReflectContext* context) { @@ -124,4 +124,4 @@ namespace AzFramework } } } -} // namespace AzFramework +} // namespace Multiplayer diff --git a/Gems/Multiplayer/Code/multiplayer_files.cmake b/Gems/Multiplayer/Code/multiplayer_files.cmake index 9c83af49a3..35a75797b6 100644 --- a/Gems/Multiplayer/Code/multiplayer_files.cmake +++ b/Gems/Multiplayer/Code/multiplayer_files.cmake @@ -58,6 +58,14 @@ set(FILES Include/Multiplayer/NetworkTime/RewindableObject.h Include/Multiplayer/NetworkTime/RewindableObject.inl Include/Multiplayer/ReplicationWindows/IReplicationWindow.h + Include/Multiplayer/Session/IMatchmakingRequests.h + Include/Multiplayer/Session/ISessionHandlingRequests.h + Include/Multiplayer/Session/ISessionRequests.h + Include/Multiplayer/Session/MatchmakingRequests.h + Include/Multiplayer/Session/MatchmakingNotifications.h + Include/Multiplayer/Session/SessionRequests.h + Include/Multiplayer/Session/SessionConfig.h + Include/Multiplayer/Session/SessionNotifications.h Include/Multiplayer/AutoGen/AutoComponentTypes_Header.jinja Include/Multiplayer/AutoGen/AutoComponentTypes_Source.jinja Include/Multiplayer/AutoGen/AutoComponent_Common.jinja @@ -131,4 +139,7 @@ set(FILES Source/ReplicationWindows/NullReplicationWindow.h Source/ReplicationWindows/ServerToClientReplicationWindow.cpp Source/ReplicationWindows/ServerToClientReplicationWindow.h + Source/Session/MatchmakingRequests.cpp + Source/Session/SessionRequests.cpp + Source/Session/SessionConfig.cpp )