Fix positional desync of network objects plus related log spam
Signed-off-by: puvvadar <puvvadar@amazon.com>
This commit is contained in:
+14
-11
@@ -123,20 +123,23 @@ namespace Multiplayer
|
||||
|
||||
bool PropertyPublisher::PrepareUpdateEntityRecord()
|
||||
{
|
||||
// If we reach the maximum outstanding records, reset the replication state
|
||||
bool didPrepare = true;
|
||||
if (m_sentRecords.size() >= net_EntityReplicatorRecordsMax)
|
||||
{
|
||||
return PrepareAddEntityRecord();
|
||||
// If we reach the maximum outstanding records, reset the replication state
|
||||
didPrepare = PrepareAddEntityRecord();
|
||||
}
|
||||
|
||||
// We need to clear out old records, and build up a list of everything that has changed since the last acked packet
|
||||
m_sentRecords.push_front(m_pendingRecord);
|
||||
auto iter = m_sentRecords.begin();
|
||||
++iter; // Consider everything after the record we are going to send
|
||||
for (; iter != m_sentRecords.end(); ++iter)
|
||||
else
|
||||
{
|
||||
// Sequence wasn't acked, so we need to send these bits again
|
||||
m_pendingRecord.Append(*iter);
|
||||
// We need to clear out old records, and build up a list of everything that has changed since the last acked packet
|
||||
m_sentRecords.push_front(m_pendingRecord);
|
||||
auto iter = m_sentRecords.begin();
|
||||
++iter; // Consider everything after the record we are going to send
|
||||
for (; iter != m_sentRecords.end(); ++iter)
|
||||
{
|
||||
// Sequence wasn't acked, so we need to send these bits again
|
||||
m_pendingRecord.Append(*iter);
|
||||
}
|
||||
}
|
||||
|
||||
// Don't send predictable properties back to the Autonomous unless we correct them
|
||||
@@ -145,7 +148,7 @@ namespace Multiplayer
|
||||
m_pendingRecord.Subtract(m_netBindComponent->GetPredictableRecord());
|
||||
}
|
||||
|
||||
return true;
|
||||
return didPrepare;
|
||||
}
|
||||
|
||||
bool PropertyPublisher::PrepareDeleteEntityRecord()
|
||||
|
||||
@@ -191,6 +191,8 @@ namespace Multiplayer
|
||||
|
||||
bool ReplicationRecord::ContainsAuthorityToClientBits() const
|
||||
{
|
||||
// Check != Authority here since several modes require information about client updates
|
||||
// (i.e. Autonomous when performing corrections)
|
||||
return (m_remoteNetEntityRole != NetEntityRole::Authority)
|
||||
|| (m_remoteNetEntityRole == NetEntityRole::InvalidRole);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user