1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- /*
- * 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
- *
- */
- #include "MultiplayerSampleSystemComponent.h"
- #include <AzCore/Console/ILogger.h>
- #include <AzCore/Serialization/SerializeContext.h>
- #include <AzCore/Serialization/EditContext.h>
- #include <AzCore/Serialization/EditContextConstants.inl>
- #include <AzNetworking/Framework/INetworking.h>
- #include <Source/AutoGen/AutoComponentTypes.h>
- namespace MultiplayerSample
- {
- using namespace AzNetworking;
- void MultiplayerSampleSystemComponent::Reflect(AZ::ReflectContext* context)
- {
- if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
- {
- serialize->Class<MultiplayerSampleSystemComponent, AZ::Component>()
- ->Version(0)
- ;
- if (AZ::EditContext* ec = serialize->GetEditContext())
- {
- ec->Class<MultiplayerSampleSystemComponent>("MultiplayerSample", "[Description of functionality provided by this System Component]")
- ->ClassElement(AZ::Edit::ClassElements::EditorData, "")
- ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System"))
- ->Attribute(AZ::Edit::Attributes::AutoExpand, true)
- ;
- }
- }
- }
- void MultiplayerSampleSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
- {
- provided.push_back(AZ_CRC_CE("MultiplayerSampleService"));
- }
- void MultiplayerSampleSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
- {
- incompatible.push_back(AZ_CRC_CE("MultiplayerSampleService"));
- }
- void MultiplayerSampleSystemComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required)
- {
- required.push_back(AZ_CRC_CE("NetworkingService"));
- required.push_back(AZ_CRC_CE("MultiplayerService"));
- }
- void MultiplayerSampleSystemComponent::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent)
- {
- AZ_UNUSED(dependent);
- }
- void MultiplayerSampleSystemComponent::Init()
- {
- ;
- }
- void MultiplayerSampleSystemComponent::Activate()
- {
- AZ::TickBus::Handler::BusConnect();
- //! Register our gems multiplayer components to assign NetComponentIds
- RegisterMultiplayerComponents();
- }
- void MultiplayerSampleSystemComponent::Deactivate()
- {
- AZ::TickBus::Handler::BusDisconnect();
- }
- void MultiplayerSampleSystemComponent::OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time)
- {
- ;
- }
- int MultiplayerSampleSystemComponent::GetTickOrder()
- {
- // Tick immediately after the multiplayer system component
- return AZ::TICK_PLACEMENT + 2;
- }
- }
|