Fixes for 64-bit printfs

Signed-off-by: kberg-amzn <karlberg@amazon.com>
This commit is contained in:
kberg-amzn
2021-10-15 13:42:46 -07:00
parent 3040f74c41
commit 3a0805254b
3 changed files with 49 additions and 49 deletions
@@ -259,8 +259,8 @@ namespace Multiplayer
{
AZLOG_WARN
(
"Serializing extremely large entity (%u) - MaxPayload: %d NeededSize %d",
aznumeric_cast<uint32_t>(replicator->GetEntityHandle().GetNetEntityId()),
"Serializing extremely large entity (%llu) - MaxPayload: %d NeededSize %d",
aznumeric_cast<AZ::u64>(replicator->GetEntityHandle().GetNetEntityId()),
m_maxPayloadSize,
nextMessageSize
);
@@ -373,19 +373,19 @@ namespace Multiplayer
if (changedRemoteRole || changedLocalRole)
{
const uint32_t intEntityId = static_cast<uint32_t>(netBindComponent->GetNetEntityId());
const AZ::u64 intEntityId = static_cast<AZ::u64>(netBindComponent->GetNetEntityId());
const char* entityName = entityReplicator->GetEntityHandle().GetEntity()->GetName().c_str();
if (changedLocalRole)
{
const char* oldRoleString = GetEnumString(entityReplicator->GetRemoteNetworkRole());
const char* newRoleString = GetEnumString(remoteNetworkRole);
AZLOG(NET_ReplicatorRoles, "Replicator %s(%u) changed local role, old role = %s, new role = %s", entityName, intEntityId, oldRoleString, newRoleString);
AZLOG(NET_ReplicatorRoles, "Replicator %s(%llu) changed local role, old role = %s, new role = %s", entityName, intEntityId, oldRoleString, newRoleString);
}
if (changedRemoteRole)
{
const char* oldRoleString = GetEnumString(entityReplicator->GetBoundLocalNetworkRole());
const char* newRoleString = GetEnumString(netBindComponent->GetNetEntityRole());
AZLOG(NET_ReplicatorRoles, "Replicator %s(%u) changed remote role, old role = %s, new role = %s", entityName, intEntityId, oldRoleString, newRoleString);
AZLOG(NET_ReplicatorRoles, "Replicator %s(%llu) changed remote role, old role = %s, new role = %s", entityName, intEntityId, oldRoleString, newRoleString);
}
// If we changed roles, we need to reset everything
@@ -402,8 +402,8 @@ namespace Multiplayer
AZLOG
(
NET_RepDeletes,
"Reinited replicator for %u from remote host %s role %d",
entityHandle.GetNetEntityId(),
"Reinited replicator for netEntityId %llu from remote host %s role %d",
static_cast<AZ::u64>(entityHandle.GetNetEntityId()),
GetRemoteHostId().GetString().c_str(),
aznumeric_cast<int32_t>(remoteNetworkRole)
);
@@ -419,8 +419,8 @@ namespace Multiplayer
AZLOG
(
NET_RepDeletes,
"Added replicator for %u from remote host %s role %d",
entityHandle.GetNetEntityId(),
"Added replicator for netEntityId %llu from remote host %s role %d",
static_cast<AZ::u64>(entityHandle.GetNetEntityId()),
GetRemoteHostId().GetString().c_str(),
aznumeric_cast<int32_t>(remoteNetworkRole)
);
@@ -428,7 +428,7 @@ namespace Multiplayer
}
else
{
AZLOG_ERROR("Failed to add entity replicator, entity does not exist, entity id %u", entityHandle.GetNetEntityId());
AZLOG_ERROR("Failed to add entity replicator, entity does not exist, netEntityId %llu", static_cast<AZ::u64>(entityHandle.GetNetEntityId()));
AZ_Assert(false, "Failed to add entity replicator, entity does not exist");
}
return entityReplicator;
@@ -517,18 +517,18 @@ namespace Multiplayer
{
if (entityReplicator->IsMarkedForRemoval())
{
AZLOG(NET_RepDeletes, "Got a replicator delete message that is a duplicate id %u remote host %s", updateMessage.GetEntityId(), GetRemoteHostId().GetString().c_str());
AZLOG(NET_RepDeletes, "Got a replicator delete message that is a duplicate id %llu remote host %s", static_cast<AZ::u64>(updateMessage.GetEntityId()), GetRemoteHostId().GetString().c_str());
}
else if (entityReplicator->OwnsReplicatorLifetime())
{
// This can occur if we migrate entities quickly - if this is a replicator from C to A, A migrates to B, B then migrates to C, and A's delete replicator has not arrived at C
AZLOG(NET_RepDeletes, "Got a replicator delete message for a replicator we own id %u remote host %s", updateMessage.GetEntityId(), GetRemoteHostId().GetString().c_str());
AZLOG(NET_RepDeletes, "Got a replicator delete message for a replicator we own id %llu remote host %s", static_cast<AZ::u64>(updateMessage.GetEntityId()), GetRemoteHostId().GetString().c_str());
}
else
{
shouldDeleteEntity = true;
entityReplicator->MarkForRemoval();
AZLOG(NET_RepDeletes, "Deleting replicater for entity id %u remote host %s", updateMessage.GetEntityId(), GetRemoteHostId().GetString().c_str());
AZLOG(NET_RepDeletes, "Deleting replicater for entity id %llu remote host %s", static_cast<AZ::u64>(updateMessage.GetEntityId()), GetRemoteHostId().GetString().c_str());
}
}
@@ -540,17 +540,17 @@ namespace Multiplayer
{
if (updateMessage.GetWasMigrated())
{
AZLOG(NET_RepDeletes, "Leaving id %u using timeout remote host %s", entity.GetNetEntityId(), GetRemoteHostId().GetString().c_str());
AZLOG(NET_RepDeletes, "Leaving id %llu using timeout remote host %s", static_cast<AZ::u64>(entity.GetNetEntityId()), GetRemoteHostId().GetString().c_str());
}
else
{
AZLOG(NET_RepDeletes, "Deleting entity id %u remote host %s", entity.GetNetEntityId(), GetRemoteHostId().GetString().c_str());
AZLOG(NET_RepDeletes, "Deleting entity id %llu remote host %s", static_cast<AZ::u64>(entity.GetNetEntityId()), GetRemoteHostId().GetString().c_str());
GetNetworkEntityManager()->MarkForRemoval(entity);
}
}
else
{
AZLOG(NET_RepDeletes, "Trying to delete entity id %u remote host %s, but it has been removed", entity.GetNetEntityId(), GetRemoteHostId().GetString().c_str());
AZLOG(NET_RepDeletes, "Trying to delete entity id %llu remote host %s, but it has been removed", static_cast<AZ::u64>(entity.GetNetEntityId()), GetRemoteHostId().GetString().c_str());
}
}
@@ -606,9 +606,9 @@ namespace Multiplayer
AZ_Assert(localNetworkRole != NetEntityRole::Authority, "UpdateMessage trying to set local role to Authority, this should only happen via migration");
AZLOG_INFO
(
"EntityReplicationManager: Changing network role on entity %s(%u), old role %s new role %s",
"EntityReplicationManager: Changing network role on entity %s(%llu), old role %s new role %s",
replicatorEntity.GetEntity()->GetName().c_str(),
aznumeric_cast<uint32_t>(netEntityId),
aznumeric_cast<AZ::u64>(netEntityId),
GetEnumString(netBindComponent->GetNetEntityRole()),
GetEnumString(localNetworkRole)
);
@@ -720,9 +720,9 @@ namespace Multiplayer
AZLOG_WARN
(
"Dropping Packet and LocalServerToRemoteClient connection, unexpected packet "
"LocalShard=%s EntityId=%u RemoteNetworkRole=%u BoundLocalNetworkRole=%u ActualNetworkRole=%u IsMarkedForRemoval=%s",
"LocalShard=%s EntityId=%llu RemoteNetworkRole=%u BoundLocalNetworkRole=%u ActualNetworkRole=%u IsMarkedForRemoval=%s",
GetNetworkEntityManager()->GetHostId().GetString().c_str(),
aznumeric_cast<uint32_t>(entityReplicator->GetEntityHandle().GetNetEntityId()),
aznumeric_cast<AZ::u64>(entityReplicator->GetEntityHandle().GetNetEntityId()),
aznumeric_cast<uint32_t>(entityReplicator->GetRemoteNetworkRole()),
aznumeric_cast<uint32_t>(entityReplicator->GetBoundLocalNetworkRole()),
aznumeric_cast<uint32_t>(entityReplicator->GetNetBindComponent()->GetNetEntityRole()),
@@ -772,13 +772,13 @@ namespace Multiplayer
result = UpdateValidationResult::DropMessage;
if (updateMessage.GetIsDelete())
{
AZLOG(NET_RepDeletes, "EntityReplicationManager: Received old DeleteProxy message for entity id %u, sequence %d latest sequence %d from remote host %s",
updateMessage.GetEntityId(), (uint32_t)packetId, (uint32_t)propSubscriber->GetLastReceivedPacketId(), GetRemoteHostId().GetString().c_str());
AZLOG(NET_RepDeletes, "EntityReplicationManager: Received old DeleteProxy message for entity id %llu, sequence %d latest sequence %d from remote host %s",
(AZ::u64)updateMessage.GetEntityId(), (uint32_t)packetId, (uint32_t)propSubscriber->GetLastReceivedPacketId(), GetRemoteHostId().GetString().c_str());
}
else
{
AZLOG(NET_RepUpdate, "EntityReplicationManager: Received old PropertyChangeMessage message for entity id %u, sequence %d latest sequence %d from remote host %s",
updateMessage.GetEntityId(), (uint32_t)packetId, (uint32_t)propSubscriber->GetLastReceivedPacketId(), GetRemoteHostId().GetString().c_str());
AZLOG(NET_RepUpdate, "EntityReplicationManager: Received old PropertyChangeMessage message for entity id %llu, sequence %d latest sequence %d from remote host %s",
(AZ::u64)updateMessage.GetEntityId(), (uint32_t)packetId, (uint32_t)propSubscriber->GetLastReceivedPacketId(), GetRemoteHostId().GetString().c_str());
}
}
}
@@ -1213,7 +1213,7 @@ namespace Multiplayer
// Change the role on the replicator
AddEntityReplicator(entityHandle, NetEntityRole::Server);
AZLOG(NET_RepDeletes, "Handle Migration %u new authority from remote host %s", entityHandle.GetNetEntityId(), GetRemoteHostId().GetString().c_str());
AZLOG(NET_RepDeletes, "Handle Migration %llu new authority from remote host %s", static_cast<AZ::u64>(entityHandle.GetNetEntityId()), GetRemoteHostId().GetString().c_str());
return true;
}
@@ -103,8 +103,8 @@ namespace Multiplayer
AZ_Assert
(
m_boundLocalNetworkRole != m_remoteNetworkRole,
"Invalid configuration detected, bound local role must differ from remote network role Role: %d",
aznumeric_cast<int32_t>(m_boundLocalNetworkRole)
"Invalid configuration detected, bound local role must differ from remote network role: %s",
GetEnumString(m_boundLocalNetworkRole)
);
if (RemoteManagerOwnsEntityLifetime())
@@ -247,7 +247,7 @@ namespace Multiplayer
if (entity->GetState() != AZ::Entity::State::Init)
{
AZLOG_WARN("Trying to activate an entity that is not in the Init state (%u)", GetEntityHandle().GetNetEntityId());
AZLOG_WARN("Trying to activate an entity that is not in the Init state (%llu)", static_cast<AZ::u64>(GetEntityHandle().GetNetEntityId()));
}
entity->Activate();
@@ -430,9 +430,9 @@ namespace Multiplayer
AZLOG
(
NET_HierarchyActivationInfo,
"Hierchical entity %s asking for activation - waiting on the parent %u",
"Hierchical entity %s asking for activation - waiting on the parent %llu",
entity->GetName().c_str(),
aznumeric_cast<uint32_t>(parentId)
aznumeric_cast<AZ::u64>(parentId)
);
return false;
}
@@ -450,8 +450,8 @@ namespace Multiplayer
AZLOG
(
NET_RepDeletes,
"Sending delete replicator id %u migrated %d to remote host %s",
aznumeric_cast<uint32_t>(GetEntityHandle().GetNetEntityId()),
"Sending delete replicator id %llu migrated %d to remote host %s",
aznumeric_cast<AZ::u64>(GetEntityHandle().GetNetEntityId()),
WasMigrated() ? 1 : 0,
m_replicationManager.GetRemoteHostId().GetString().c_str()
);
@@ -620,8 +620,8 @@ namespace Multiplayer
{
AZLOG_ERROR
(
"Dropping RPC and Connection EntityId=%u LocalRole=%s RemoteRole=%s RpcDeliveryType=%u RpcName=%s IsReliable=%s IsMarkedForRemoval=%s",
aznumeric_cast<uint32_t>(m_entityHandle.GetNetEntityId()),
"Dropping RPC and Connection EntityId=%llu LocalRole=%s RemoteRole=%s RpcDeliveryType=%u RpcName=%s IsReliable=%s IsMarkedForRemoval=%s",
aznumeric_cast<AZ::u64>(m_entityHandle.GetNetEntityId()),
GetEnumString(GetBoundLocalNetworkRole()),
GetEnumString(GetRemoteNetworkRole()),
aznumeric_cast<uint32_t>(entityRpcMessage.GetRpcDeliveryType()),
@@ -637,8 +637,8 @@ namespace Multiplayer
AZLOG
(
NET_Rpc,
"Dropping RPC EntityId=%u LocalRole=%s RemoteRole=%s RpcDeliveryType=%u RpcName=%s IsReliable=%s IsMarkedForRemoval=%s",
aznumeric_cast<uint32_t>(m_entityHandle.GetNetEntityId()),
"Dropping RPC EntityId=%llu LocalRole=%s RemoteRole=%s RpcDeliveryType=%u RpcName=%s IsReliable=%s IsMarkedForRemoval=%s",
aznumeric_cast<AZ::u64>(m_entityHandle.GetNetEntityId()),
GetEnumString(GetBoundLocalNetworkRole()),
GetEnumString(GetRemoteNetworkRole()),
aznumeric_cast<uint32_t>(entityRpcMessage.GetRpcDeliveryType()),
@@ -661,8 +661,8 @@ namespace Multiplayer
{
AZLOG_WARN
(
"Dropping RPC since entity deleted EntityId=%u LocalRole=%s RemoteRole=%s RpcDeliveryType=%u RpcName=%s IsReliable=%s IsMarkedForRemoval=%s",
aznumeric_cast<uint32_t>(m_entityHandle.GetNetEntityId()),
"Dropping RPC since entity deleted EntityId=%llu LocalRole=%s RemoteRole=%s RpcDeliveryType=%u RpcName=%s IsReliable=%s IsMarkedForRemoval=%s",
aznumeric_cast<AZ::u64>(m_entityHandle.GetNetEntityId()),
GetEnumString(GetBoundLocalNetworkRole()),
GetEnumString(GetRemoteNetworkRole()),
aznumeric_cast<uint32_t>(entityRpcMessage.GetRpcDeliveryType()),
@@ -33,8 +33,8 @@ namespace Multiplayer
AZLOG
(
NET_AuthTracker,
"AuthTracker: Removing timeout for networkEntityId %u from %s, new owner is %s",
aznumeric_cast<uint32_t>(entityHandle.GetNetEntityId()),
"AuthTracker: Removing timeout for networkEntityId %llu from %s, new owner is %s",
aznumeric_cast<AZ::u64>(entityHandle.GetNetEntityId()),
timeoutData->second.m_previousOwner.GetString().c_str(),
newOwner.GetString().c_str()
);
@@ -48,8 +48,8 @@ namespace Multiplayer
AZLOG
(
NET_AuthTracker,
"AuthTracker: Assigning networkEntityId %u from %s to %s",
aznumeric_cast<uint32_t>(entityHandle.GetNetEntityId()),
"AuthTracker: Assigning networkEntityId %llu from %s to %s",
aznumeric_cast<AZ::u64>(entityHandle.GetNetEntityId()),
iter->second.back().GetString().c_str(),
newOwner.GetString().c_str()
);
@@ -59,8 +59,8 @@ namespace Multiplayer
AZLOG
(
NET_AuthTracker,
"AuthTracker: Assigning networkEntityId %u to %s",
aznumeric_cast<uint32_t>(entityHandle.GetNetEntityId()),
"AuthTracker: Assigning networkEntityId %llu to %s",
aznumeric_cast<AZ::u64>(entityHandle.GetNetEntityId()),
newOwner.GetString().c_str()
);
}
@@ -87,7 +87,7 @@ namespace Multiplayer
}
}
AZLOG(NET_AuthTracker, "AuthTracker: Removing networkEntityId %u from %s", aznumeric_cast<uint32_t>(entityHandle.GetNetEntityId()), previousOwner.GetString().c_str());
AZLOG(NET_AuthTracker, "AuthTracker: Removing networkEntityId %llu from %s", aznumeric_cast<AZ::u64>(entityHandle.GetNetEntityId()), previousOwner.GetString().c_str());
if (auto localEnt = entityHandle.GetEntity())
{
if (authorityStack.empty())
@@ -114,14 +114,14 @@ namespace Multiplayer
}
else
{
AZLOG(NET_AuthTracker, "AuthTracker: Skipping timeout for Autonomous networkEntityId %u", aznumeric_cast<uint32_t>(entityHandle.GetNetEntityId()));
AZLOG(NET_AuthTracker, "AuthTracker: Skipping timeout for Autonomous networkEntityId %llu", aznumeric_cast<AZ::u64>(entityHandle.GetNetEntityId()));
}
}
}
}
else
{
AZLOG(NET_AuthTracker, "AuthTracker: Remove authority called on networkEntityId that was never added %u", aznumeric_cast<uint32_t>(entityHandle.GetNetEntityId()));
AZLOG(NET_AuthTracker, "AuthTracker: Remove authority called on networkEntityId that was never added %llu", aznumeric_cast<AZ::u64>(entityHandle.GetNetEntityId()));
AZ_Assert(false, "AuthTracker: Remove authority called on entity that was never added");
}
}
@@ -205,8 +205,8 @@ namespace Multiplayer
{
AZLOG_ERROR
(
"Timed out entity id %u during migration previous owner %s, removing it",
aznumeric_cast<uint32_t>(entityHandle.GetNetEntityId()),
"Timed out entity id %llu during migration previous owner %s, removing it",
aznumeric_cast<AZ::u64>(entityHandle.GetNetEntityId()),
timeoutData->second.m_previousOwner.GetString().c_str()
);
m_networkEntityManager.MarkForRemoval(entityHandle);