Ver código fonte

Merge pull request #185 from aws-lumberyard-dev/mps_is_netrole_authauto

Update IsAuth/Auto naming
puvvadar 3 anos atrás
pai
commit
efd986b83b

+ 2 - 2
Gem/Code/Source/Components/NetworkPlayerMovementComponent.cpp

@@ -37,7 +37,7 @@ namespace MultiplayerSample
             m_updateAI.Enqueue(AZ::TimeMs{ 0 }, true);
             m_networkAiComponentController = GetNetworkAiComponentController();
         }
-        else if (IsAutonomous())
+        else if (IsNetEntityRoleAutonomous())
         {
             StartingPointInput::InputEventNotificationBus::MultiHandler::BusConnect(MoveFwdEventId);
             StartingPointInput::InputEventNotificationBus::MultiHandler::BusConnect(MoveBackEventId);
@@ -55,7 +55,7 @@ namespace MultiplayerSample
 
     void NetworkPlayerMovementComponentController::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
     {
-        if (IsAutonomous() && !m_aiEnabled)
+        if (IsNetEntityRoleAutonomous() && !m_aiEnabled)
         {
             StartingPointInput::InputEventNotificationBus::MultiHandler::BusDisconnect(MoveFwdEventId);
             StartingPointInput::InputEventNotificationBus::MultiHandler::BusDisconnect(MoveBackEventId);

+ 1 - 1
Gem/Code/Source/Components/NetworkRandomComponent.cpp

@@ -41,7 +41,7 @@ namespace MultiplayerSample
     NetworkRandomComponentController::NetworkRandomComponentController(NetworkRandomComponent& parent)
         : NetworkRandomComponentControllerBase(parent)
     {
-        if (IsAuthority())
+        if (IsNetEntityRoleAuthority())
         {
             // Setup seed on authority for proxies to pull
             AZ::BetterPseudoRandom seedGenerator;

+ 1 - 1
Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp

@@ -29,7 +29,7 @@ namespace MultiplayerSample
         aimAngles.SetZ(GetEntity()->GetTransform()->GetLocalRotation().GetZ());
         SetSyncAimImmediate(true);
 
-        if (IsAutonomous())
+        if (IsNetEntityRoleAutonomous())
         {
             m_aiEnabled = FindComponent<NetworkAiComponent>()->GetEnabled();
             if (!m_aiEnabled)

+ 3 - 3
Gem/Code/Source/Components/NetworkWeaponsComponent.cpp

@@ -296,7 +296,7 @@ namespace MultiplayerSample
             m_updateAI.Enqueue(AZ::TimeMs{ 0 }, true);
             m_networkAiComponentController = GetNetworkAiComponentController();
         }
-        else if (IsAutonomous())
+        else if (IsNetEntityRoleAutonomous())
         {
             StartingPointInput::InputEventNotificationBus::MultiHandler::BusConnect(DrawEventId);
             StartingPointInput::InputEventNotificationBus::MultiHandler::BusConnect(FirePrimaryEventId);
@@ -306,7 +306,7 @@ namespace MultiplayerSample
 
     void NetworkWeaponsComponentController::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
     {
-        if (IsAutonomous() && !m_aiEnabled)
+        if (IsNetEntityRoleAutonomous() && !m_aiEnabled)
         {
             StartingPointInput::InputEventNotificationBus::MultiHandler::BusDisconnect(DrawEventId);
             StartingPointInput::InputEventNotificationBus::MultiHandler::BusDisconnect(FirePrimaryEventId);
@@ -409,7 +409,7 @@ namespace MultiplayerSample
                 GetParent().ActivateWeaponWithParams(
                     aznumeric_cast<WeaponIndex>(weaponIndexInt), weaponState, fireParams, validateActivations);
 
-                if (IsAuthority())
+                if (IsNetEntityRoleAuthority())
                 {
                     SetActivationParams(weaponIndexInt, fireParams);
                     SetActivationCounts(weaponIndexInt, weaponState.m_activationCount);