Hello everyone,
After upgrading Entities, Netcode for Entities, etc. from 1.0.16 to 1.2.3, we have problems regarding the sending and receiving of RPC commands.
In the specific case, we send an RPC for each entitiy with a NetworkId (i. e. for each connection entity) that doesn’t have a custom tag component (as a first message), and add this component afterwards. The SendRpcCommandRequest is created with the entity that has the NetworkId as TargetConnection.
This did work before, but it doesn’t work reliably anymore. When it doesn’t work, we get the following error message:
[ServerWorld] NetCode RPC Entity(359:3) has not been consumed or destroyed for '4' (MaxRpcAgeFrames) frames! Assumed unhandled. Either a) call .Consume(), or b) remove the ReceiveRpcCommandRequestComponent component, or c) destroy the entity.
The curious part here is: the ReceiveRpcCommandRequest entity is not created in the client world, but in the server world. I tested already to
- resend the Rpc on the same network connection if it arrives on the server
- send the Rpc again after a few seconds if no message from the client was received
however the Rpc always ends up on the server side if the game is in this erroneous state.
Why this is unreliable: for me, roughly every first time it misbehaves and subsequent times (without Unity restart and without recompilation) it works. For a colleague of mine it doesn’t work at all. Further, if I use Debug.Break() after creating the Rpc entity and then step through frame by frame, it seems to generally work.
We’re attempting the upgrade to integrate Steam Networking, which seemingly isn’t possible or viable in lower versions of the packages, e. g. because there is no network type “Custom” besides IPv4 and IPv6.
What could we do to narrow down the issue?
Best regards,
Richard