Multiplayer

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
pappeste
2021-06-18 15:54:43 -07:00
committed by Esteban Papp
parent 2338bd09d4
commit 0f0a6c5cd3
7 changed files with 16 additions and 16 deletions
@@ -198,7 +198,7 @@ namespace Multiplayer
// Produce correction for client
AzNetworking::PacketEncodingBuffer correction;
correction.Resize(correction.GetCapacity());
AzNetworking::NetworkInputSerializer serializer(correction.GetBuffer(), correction.GetCapacity());
AzNetworking::NetworkInputSerializer serializer(correction.GetBuffer(), static_cast<uint32_t>(correction.GetCapacity()));
// only deserialize if we have data (for client/server profile/debug mismatches)
if (correction.GetSize() > 0)
@@ -218,7 +218,7 @@ namespace Multiplayer
{
// In debug, show which states caused the correction
// Write in client state
AzNetworking::NetworkOutputSerializer clientStateSerializer(clientState.GetBuffer(), clientState.GetSize());
AzNetworking::NetworkOutputSerializer clientStateSerializer(clientState.GetBuffer(), static_cast<uint32_t>(clientState.GetSize()));
GetNetBindComponent()->SerializeEntityCorrection(clientStateSerializer);
// Read out state values
@@ -226,7 +226,7 @@ namespace Multiplayer
GetNetBindComponent()->SerializeEntityCorrection(clientValues);
// Restore server state
AzNetworking::NetworkOutputSerializer serverStateSerializer(correction.GetBuffer(), correction.GetSize());
AzNetworking::NetworkOutputSerializer serverStateSerializer(correction.GetBuffer(), static_cast<uint32_t>(correction.GetSize()));
GetNetBindComponent()->SerializeEntityCorrection(serverStateSerializer);
// Read out state values
@@ -352,7 +352,7 @@ namespace Multiplayer
m_lastCorrectionInputId = inputId;
// Apply the correction
AzNetworking::TrackChangedSerializer<AzNetworking::NetworkOutputSerializer> serializer(correction.GetBuffer(), correction.GetSize());
AzNetworking::TrackChangedSerializer<AzNetworking::NetworkOutputSerializer> serializer(correction.GetBuffer(), static_cast<uint32_t>(correction.GetSize()));
GetNetBindComponent()->SerializeEntityCorrection(serializer);
m_correctionEvent.Signal();
@@ -364,7 +364,7 @@ namespace Multiplayer
GetCorrectionDataString(GetNetBindComponent()).c_str()
);
const uint32_t inputHistorySize = m_inputHistory.Size();
const uint32_t inputHistorySize = static_cast<uint32_t>(m_inputHistory.Size());
const uint32_t historicalDelta = aznumeric_cast<uint32_t>(m_clientInputId - inputId); // Do not replay the move we just corrected, that was already processed by the server
// If this correction is for a move outside our input history window, just start replaying from the oldest move we have available
@@ -524,7 +524,7 @@ namespace Multiplayer
#ifndef AZ_RELEASE_BUILD
if (cl_EnableDesyncDebugging)
{
AzNetworking::NetworkInputSerializer processInputResultSerializer(processInputResult.GetBuffer(), processInputResult.GetCapacity());
AzNetworking::NetworkInputSerializer processInputResultSerializer(processInputResult.GetBuffer(), static_cast<uint32_t>(processInputResult.GetCapacity()));
GetNetBindComponent()->SerializeEntityCorrection(processInputResultSerializer);
processInputResult.Resize(processInputResultSerializer.GetSize());
}