MultiplayerGem.cpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <MultiplayerToolsSystemComponent.h>
  9. #include <AzNetworking/Framework/NetworkingSystemComponent.h>
  10. #include <Multiplayer/Components/NetBindComponent.h>
  11. #include <Multiplayer/Components/SimplePlayerSpawnerComponent.h>
  12. #include <Source/MultiplayerGem.h>
  13. #include <Source/MultiplayerSystemComponent.h>
  14. #include <Source/MultiplayerStatSystemComponent.h>
  15. #include <Source/AutoGen/AutoComponentTypes.h>
  16. namespace Multiplayer
  17. {
  18. MultiplayerModule::MultiplayerModule()
  19. : AZ::Module()
  20. {
  21. m_descriptors.insert(
  22. m_descriptors.end(),
  23. {
  24. MultiplayerSystemComponent::CreateDescriptor(),
  25. MultiplayerStatSystemComponent::CreateDescriptor(),
  26. NetBindComponent::CreateDescriptor(),
  27. SimplePlayerSpawnerComponent::CreateDescriptor(),
  28. #ifdef MULTIPLAYER_EDITOR
  29. MultiplayerToolsSystemComponent::CreateDescriptor(),
  30. #endif
  31. });
  32. CreateComponentDescriptors(m_descriptors);
  33. }
  34. AZ::ComponentTypeList MultiplayerModule::GetRequiredSystemComponents() const
  35. {
  36. return AZ::ComponentTypeList{
  37. azrtti_typeid<MultiplayerSystemComponent>(),
  38. azrtti_typeid<MultiplayerStatSystemComponent>(),
  39. #ifdef MULTIPLAYER_EDITOR
  40. azrtti_typeid<MultiplayerToolsSystemComponent>(),
  41. #endif
  42. };
  43. }
  44. } // namespace Multiplayer
  45. #if !defined(MULTIPLAYER_EDITOR)
  46. #if defined(AZ_MONOLITHIC_BUILD)
  47. #if defined(O3DE_GEM_NAME)
  48. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME, _Client), Multiplayer::MultiplayerModule)
  49. #else
  50. AZ_DECLARE_MODULE_CLASS(Gem_Multiplayer_Client, Multiplayer::MultiplayerModule)
  51. #endif
  52. #if defined(O3DE_GEM_NAME)
  53. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME, _Server), Multiplayer::MultiplayerModule)
  54. #else
  55. AZ_DECLARE_MODULE_CLASS(Gem_Multiplayer_Server, Multiplayer::MultiplayerModule)
  56. #endif
  57. #endif
  58. #if defined(O3DE_GEM_NAME)
  59. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME), Multiplayer::MultiplayerModule)
  60. #else
  61. AZ_DECLARE_MODULE_CLASS(Gem_Multiplayer, Multiplayer::MultiplayerModule)
  62. #endif
  63. #endif