123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- /*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
- #pragma once
- #include <AzCore/Component/Component.h>
- #include <AzCore/std/smart_ptr/unique_ptr.h>
- #include <AWSGameLiftClientLocalTicketTracker.h>
- #include <AWSGameLiftClientManager.h>
- #include <Request/IAWSGameLiftInternalRequests.h>
- namespace AWSGameLift
- {
- //! Gem client system component. Responsible for creating the gamelift client manager.
- class AWSGameLiftClientSystemComponent
- : public AZ::Component
- , public IAWSGameLiftInternalRequests
- {
- public:
- AZ_COMPONENT(AWSGameLiftClientSystemComponent, "{d481c15c-732a-4eea-9853-4965ed1bc2be}");
- AWSGameLiftClientSystemComponent();
- virtual ~AWSGameLiftClientSystemComponent() = default;
- static void Reflect(AZ::ReflectContext* context);
- static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
- static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
- static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
- static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
- // IAWSGameLiftInternalRequests interface implementation
- AZStd::shared_ptr<Aws::GameLift::GameLiftClient> GetGameLiftClient() const override;
- void SetGameLiftClient(AZStd::shared_ptr<Aws::GameLift::GameLiftClient> gameliftClient) override;
- protected:
- ////////////////////////////////////////////////////////////////////////
- // AZ::Component interface implementation
- void Init() override;
- void Activate() override;
- void Deactivate() override;
- ////////////////////////////////////////////////////////////////////////
- void SetGameLiftClientManager(AZStd::unique_ptr<AWSGameLiftClientManager> gameliftManager);
- void SetGameLiftClientTicketTracker(AZStd::unique_ptr<AWSGameLiftClientLocalTicketTracker> gameliftTicketTracker);
- private:
- static void ReflectGameLiftMatchmaking(AZ::ReflectContext* context);
- static void ReflectGameLiftSession(AZ::ReflectContext* context);
- static void ReflectCreateSessionRequest(AZ::ReflectContext* context);
- static void ReflectSearchSessionsResponse(AZ::ReflectContext* context);
- AZStd::shared_ptr<Aws::GameLift::GameLiftClient> m_gameliftClient;
- AZStd::unique_ptr<AWSGameLiftClientManager> m_gameliftManager;
- AZStd::unique_ptr<AWSGameLiftClientLocalTicketTracker> m_gameliftTicketTracker;
- };
- } // namespace AWSGameLift
|