o3de / o3de

Open 3D Engine (O3DE) is an Apache 2.0-licensed multi-platform 3D engine that enables developers and content creators to build AAA games, cinema-quality 3D worlds, and high-fidelity simulations without any fees or commercial obligations.
https://o3de.org
Other
7.79k stars 2.2k forks source link

Networking Disconnect: Duped Multiplayer AutoComponent Fails to Receive Packets #18369

Closed AMZN-Gene closed 1 week ago

AMZN-Gene commented 1 week ago

The engine will fail to handle packets if users accidently register a multiplayer autocomponent twice. Resulting in network disconnect and is difficult to track down.

Steps to reproduce

  1. Add an Autocomponent to cmake FILES list more than once
  2. Rebuilt client and server (or editor)
  3. Play the game and connect to server
  4. Open the generated \Source\AutoGen\AutoComponentTypes.cpp and notice components are registered twice, with a different s_netComponentId

Expected behavior Engine should not register a component twice. Either assert at runtime, or update auto-gen to catch the mistake at compile time.

Actual behavior Client connects to server, and then disconnects due to server failing to interpret a packet.

<13:35:20> (EditorServer) - System: Trace::Assert

<13:35:20> (EditorServer) -  C:/Users/s_vio/source/repos/o3de/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp(989): (4888) 'bool __cdecl Multiplayer::EntityReplicationManager::HandleEntityRpcMessages(class AzNetworking::IConnection *,class AZStd::fixed_vector<class Multiplayer::NetworkEntityRpcMessage,1024> &)'

<13:35:20> (EditorServer) - System: Failed processing RPC messages, disconnecting

<13:35:20> (EditorServer) - System: ------------------------------------------------

<13:35:20> Remotely disconnected from remote address 127.0.0.1:33450 due to StreamError

Found in Branch development

Commit ID from o3de/o3de Repository 11e6a1e8d28035d187b0df6d0869be62c8c151aa Thu Aug 1 12:24:07 2024

drakeredwind01 commented 1 week ago

suggest removing needs-triage needs-sig and adding triage/accepted, and sig-network