Merge remote-tracking branch 'origin/development' into MultiplayerDesyncsAndCorrectionFixes

This commit is contained in:
kberg-amzn
2021-08-13 09:58:21 -07:00
1520 changed files with 32775 additions and 48031 deletions
@@ -105,14 +105,14 @@ namespace Multiplayer
template <typename TYPE>
inline void SerializeNetworkPropertyHelper
(
AzNetworking::ISerializer& serializer,
bool modifyRecord,
AzNetworking::FixedSizeBitsetView& bitset,
int32_t bitIndex,
TYPE& value,
const char* name,
NetComponentId componentId,
PropertyIndex propertyIndex,
AzNetworking::ISerializer& serializer,
bool modifyRecord,
AzNetworking::FixedSizeBitsetView& bitset,
int32_t bitIndex,
TYPE& value,
const char* name,
NetComponentId componentId,
PropertyIndex propertyIndex,
MultiplayerStats& stats
)
{
@@ -0,0 +1,28 @@
/*
* 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
*
*/
#pragma once
namespace Multiplayer
{
//! @class IMultiplayerDebug
//! @brief IMultiplayerDebug provides access to multiplayer debug overlays
class IMultiplayerDebug
{
public:
AZ_RTTI(IMultiplayerDebug, "{C5EB7F3A-E19F-4921-A604-C9BDC910123C}");
virtual ~IMultiplayerDebug() = default;
//! Enables printing of debug text over entities that have significant amount of traffic.
virtual void ShowEntityBandwidthDebugOverlay() = 0;
//! Disables printing of debug text over entities that have significant amount of traffic.
virtual void HideEntityBandwidthDebugOverlay() = 0;
};
}
@@ -50,10 +50,13 @@ namespace Multiplayer
AZStd::vector<ComponentStats> m_componentStats;
void ReserveComponentStats(NetComponentId netComponentId, uint16_t propertyCount, uint16_t rpcCount);
void RecordEntitySerializeStart(AzNetworking::SerializerMode mode, AZ::EntityId entityId, const char* entityName);
void RecordComponentSerializeEnd(AzNetworking::SerializerMode mode, NetComponentId netComponentId);
void RecordEntitySerializeStop(AzNetworking::SerializerMode mode, AZ::EntityId entityId, const char* entityName);
void RecordPropertySent(NetComponentId netComponentId, PropertyIndex propertyId, uint32_t totalBytes);
void RecordPropertyReceived(NetComponentId netComponentId, PropertyIndex propertyId, uint32_t totalBytes);
void RecordRpcSent(NetComponentId netComponentId, RpcIndex rpcId, uint32_t totalBytes);
void RecordRpcReceived(NetComponentId netComponentId, RpcIndex rpcId, uint32_t totalBytes);
void RecordRpcSent(AZ::EntityId entityId, const char* entityName, NetComponentId netComponentId, RpcIndex rpcId, uint32_t totalBytes);
void RecordRpcReceived(AZ::EntityId entityId, const char* entityName, NetComponentId netComponentId, RpcIndex rpcId, uint32_t totalBytes);
void TickStats(AZ::TimeMs metricFrameTimeMs);
Metric CalculateComponentPropertyUpdateSentMetrics(NetComponentId netComponentId) const;
@@ -64,5 +67,31 @@ namespace Multiplayer
Metric CalculateTotalPropertyUpdateRecvMetrics() const;
Metric CalculateTotalRpcsSentMetrics() const;
Metric CalculateTotalRpcsRecvMetrics() const;
struct Events
{
AZ::Event<AzNetworking::SerializerMode, AZ::EntityId, const char*> m_entitySerializeStart;
AZ::Event<AzNetworking::SerializerMode, NetComponentId> m_componentSerializeEnd;
AZ::Event<AzNetworking::SerializerMode, AZ::EntityId, const char*> m_entitySerializeStop;
AZ::Event<NetComponentId, PropertyIndex, uint32_t> m_propertySent;
AZ::Event<NetComponentId, PropertyIndex, uint32_t> m_propertyReceived;
AZ::Event<AZ::EntityId, const char*, NetComponentId, RpcIndex, uint32_t> m_rpcSent;
AZ::Event<AZ::EntityId, const char*, NetComponentId, RpcIndex, uint32_t> m_rpcReceived;
};
Events m_events;
struct EventHandlers
{
AZ::Event<AzNetworking::SerializerMode, AZ::EntityId, const char*>::Handler m_entitySerializeStart;
AZ::Event<AzNetworking::SerializerMode, NetComponentId>::Handler m_componentSerializeEnd;
AZ::Event<AzNetworking::SerializerMode, AZ::EntityId, const char*>::Handler m_entitySerializeStop;
AZ::Event<NetComponentId, PropertyIndex, uint32_t>::Handler m_propertySent;
AZ::Event<NetComponentId, PropertyIndex, uint32_t>::Handler m_propertyReceived;
AZ::Event<AZ::EntityId, const char*, NetComponentId, RpcIndex, uint32_t>::Handler m_rpcSent;
AZ::Event<AZ::EntityId, const char*, NetComponentId, RpcIndex, uint32_t>::Handler m_rpcReceived;
};
void ConnectHandlers(EventHandlers& handlers);
};
}