Expose matchmaking event polling APIs and add required session notifications (#4636)

* Expose matchmaking event polling APIs and add required session notifications

Signed-off-by: onecent1101 <liug@amazon.com>
This commit is contained in:
Vincent Liu
2021-10-18 12:47:55 -07:00
committed by GitHub
parent eac14901b0
commit a534fccc9b
14 changed files with 173 additions and 85 deletions
@@ -94,4 +94,41 @@ namespace AWSGameLift
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
};
using AWSGameLiftMatchmakingRequestBus = AZ::EBus<AzFramework::IMatchmakingRequests, AWSGameLiftMatchmakingRequests>;
//! IAWSGameLiftMatchmakingEventRequests
//! GameLift Gem matchmaking event interfaces which is used to track matchmaking ticket event
//! Developer should define the way to poll matchmaking ticket event and behavior based on the ticket status
//! Use AWSGameLiftClientLocalTicketTracker as an example, it uses continuous polling to query matchmaking ticket:
//! StartPolling - local ticket tracker starts monitor process for matchmaking ticket, and joins player
//! to the match once ticket is complete
//! StopPolling - local ticket tracker cancels ongoing matchmaking ticket and stops monitoring process
class IAWSGameLiftMatchmakingEventRequests
{
public:
AZ_RTTI(IAWSGameLiftMatchmakingEventRequests, "{C2DA440E-74E0-411E-813D-5880B50B0C9E}");
IAWSGameLiftMatchmakingEventRequests() = default;
virtual ~IAWSGameLiftMatchmakingEventRequests() = default;
//! StartPolling
//! Request to start process for polling matchmaking ticket based on given ticket id and player Id
//! @param ticketId The requested matchmaking ticket id
//! @param playerId The requested matchmaking player id
virtual void StartPolling(const AZStd::string& ticketId, const AZStd::string& playerId) = 0;
//! StopPolling
//! Request to stop process for polling matchmaking ticket
virtual void StopPolling() = 0;
};
// IAWSGameLiftMatchmakingEventRequests EBus wrapper for scripting
class AWSGameLiftMatchmakingEventRequests
: public AZ::EBusTraits
{
public:
using MutexType = AZStd::recursive_mutex;
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
};
using AWSGameLiftMatchmakingEventRequestBus = AZ::EBus<IAWSGameLiftMatchmakingEventRequests, AWSGameLiftMatchmakingEventRequests>;
} // namespace AWSGameLift