/* * 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 #include #include #include #include #include namespace MultiplayerSample { using namespace AzNetworking; void MultiplayerSampleSystemComponent::Reflect(AZ::ReflectContext* context) { if (AZ::SerializeContext* serialize = azrtti_cast(context)) { serialize->Class() ->Version(0) ; if (AZ::EditContext* ec = serialize->GetEditContext()) { ec->Class("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; } }