Hey,
In my project the host spawn both pawns and keep them alive on the server.
When the Client join, it possess the second pawn and when it leaves it’s not destroyed.
I found out that my second pawn wasn’t receiving the “ProduceInput” call from NPP after the Client left.
I don’t now if it’s the good way to do it but as a workaround calling UNetworkPredictionComponent::CheckOwnerRoleChange() after receiving Logout from the game mode seems to fix the issue.
(I had to change the privacy of “CheckOwnerRoleChange” from protected to public in the plugin)
I attached a repro project without this workaround
Thanks
Steps to Reproduce
Launch the repro project with the following settings:
- 2 Players
- Listen Server
- Disable Run Under One process
Wait for the other process to launch, then close the second window.
Observe that in the log, Only “ReproPawn0” is logging instead of both “ReproPawn0” and “ReproPawn1”. (The log come from the Produce Input Method from the Pawn BP)
Hi,
Thank you for the report and repro project!
I’ve been able to confirm the problem, and I’ve opened a new issue, UE-349877, which should be visible in the public tracker in a day or so.
In the meanwhile, I do think your workaround is reasonable. CheckOwnerRoleChange is usually called during PreReplication, but if the server no longer has any clients, the NetDriver skips gathering actors for replication and calling PreReplication on them.
Thanks,
Alex