Joining server causes breakpoint, fails to add to NetworkObjectList

Hi everyone, I get a breakpoint (not a crash) when trying to join my listen server as a client. I get this breakpoint, but can continue playing.afterwards. I’ll explain the setup:

I start my listen server and the host is then just sitting inside this level. Eventually the host will tell the clients to connect.

The clients have up to this point just been sitting in their own “offline” level. They have the same pawn as they will have once they connect. The host tells the clients to connect over UDP on our local network. This works and should not be part of the problem. I can manually join the listen server from a client by using the console argument “Open 127.0.0.1” and I get the same breakpoint.

The function that gives the breakpoint is this one:

Here is the callstack:

So the Actor that it is trying to add to the NetworkObjectList is the clients pawn.
I have found very little information about this supposed NetworkObjectList, but reading the comment it clearly states that while we were trying to add the Actor (in my case the clients pawn) it failed because the Pawn is being destroyed.

So, why is this happening? As far as I understand things, the pawn is supposed to be destroyed when joining a server, and then a new pawn will be spawned for the player controller to possess. Looking at the call stack you can see that the pawns destroy function has been called, but presumably not finished before this function is called.

I guess one question is why does the pawn need to be added to this NetworkObjectList, if it is supposed to be deleted? I’m guessing this list is deep within the engine and not something you should have to worry about, So what is the solution here?

The pawn itself is completely empty and should not be a problem for the engine to safely delete, the player controller owning the pawn is also empty and should not cause any problems.

I have overridden a few functions within GameMode, PlayerState and so on to control how a few things regarding choosing pawns, spawning player controllers etc, but I fail to find how that is relevant. If you want to see the code I can send that aswell!

Help is much needed! Cheers!

Ok just quicly running through the execution flow, stepping back a few steps, the void AActor::SetReplicates(bool bInReplicates) function is being called on the Pawn.

This pawn should not replicate, we dont need it to. So when SetReplicates() is being called it initially is not replicating. So that is correct. But the function wants to change this. Should it really do that? Is it required for a player to join the server? Again, the pawn should be destroyed right?

Not sure what to make of this, maybe i’m not understanding the multiplayer system fully.