MPSGameLiftClientSystemComponent.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * 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.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0 OR MIT
  5. *
  6. */
  7. #pragma once
  8. #include <AzCore/Component/Component.h>
  9. #include <AzCore/Console/IConsole.h>
  10. namespace MPSGameLift
  11. {
  12. class MPSGameLiftClientSystemComponent
  13. : public AZ::Component
  14. {
  15. public:
  16. AZ_COMPONENT(MPSGameLiftClientSystemComponent, "{939D9813-2DCA-4625-B4E1-E63A6A652A26}");
  17. static void Reflect(AZ::ReflectContext* context);
  18. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  19. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  20. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  21. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  22. protected:
  23. // AZ::Component interface implementation
  24. void Init() override;
  25. void Activate() override;
  26. void Deactivate() override;
  27. void JoinSession(const AZ::ConsoleCommandContainer& consoleFunctionParameters);
  28. AZ_CONSOLEFUNC(MPSGameLiftClientSystemComponent, JoinSession, AZ::ConsoleFunctorFlags::DontReplicate, "Join an existing game session");
  29. private:
  30. void JoinSessionInternal(AZStd::string_view sessionId, const AZ::Uuid& playerId);
  31. AZ::Uuid m_playerId = AZ::Uuid::Create(); // Unique identifier for the current player inside the game session
  32. };
  33. }