Merged ctrl+g fixes from MultiplayerEditorFixes

Signed-off-by: pereslav <pereslav@amazon.com>
This commit is contained in:
pereslav
2021-06-30 13:20:07 +01:00
parent c4a20405e2
commit 1100e20e26
2 changed files with 13 additions and 2 deletions
@@ -187,6 +187,13 @@ namespace AzNetworking
connection->Disconnect(disconnectReason, TerminationEndpoint::Local);
continue;
}
const ConnectionState connectionState = connection->GetConnectionState();
if (connectionState == ConnectionState::Disconnecting || connectionState == ConnectionState::Disconnected)
{
// Skip packets from disconnected connections
continue;
}
int32_t decodedPacketSize = 0;
m_decryptBuffer.Resize(m_decryptBuffer.GetCapacity());
@@ -113,6 +113,12 @@ namespace Multiplayer
{
console->PerformCommand("disconnect");
}
AZ::Interface<INetworkEntityManager>::Get()->ClearAllEntities();
// Rebuild the library to clear temporary in-memory spawnable assets
AZ::Interface<INetworkSpawnableLibrary>::Get()->BuildSpawnablesList();
break;
}
}
@@ -235,7 +241,5 @@ namespace Multiplayer
void MultiplayerEditorSystemComponent::OnGameEntitiesReset()
{
// Rebuild the library to clear temporary in-memory spawnable assets
AZ::Interface<INetworkSpawnableLibrary>::Get()->BuildSpawnablesList();
}
}