Dedicated Server, second player causes first to lose pawn control

Hi!

I’ve been working on this project for about a year now. I’ve been having great success copying code and functionality out of ShooterGame, and the example Online Subsystems. I’m still a noob though, and I’m experimenting with this stuff to learn UE.

Thanks to everyone that has helped me out so far, this community is great. <3 you guys.

My project is working totally flawlessly if used as designed, but there is a case that I’m certain will happen which is broken.

Normally, players login, search for sessions, then join a session. They meet in the lobby. Someone presses “play” and they travel to a new map and play the game. This all works fine.

If a player logs in, searches for sessions, joins a session, then hits “play”, they show up in the new map alone as they should. But, when the second player joins the server, the first player is no longer able to control the pawn. WADS does not work, even the mouse look does not work. They are still connected, and can see server events, and player 2 moving around. The second player has full control still.

I’ve started adding a bunch of logging, and if (IsRunningDedicatedServer()) checks in various places to see if I can track it down, but I have not been able to find it.

I know this is a fairly complex question/issue. I wish I had identified this problem before I had gotten this far in my development.

Does anyone have any ideas that might point me in the right direction? Thanks in advance!

Supporting files and source:

Server Log

Player 1 Log

Player 2 Log

Project Source

OSS Source

Just a wild guess, maybe you are accessing the wrong playercontroller somewhere on the Server? Keep in mind that the server has references to all playercontrollers of all clients, so always accessing the first one would be wrong.

Or maybe it is this one here, which is an issue I’m currently facing https://answers.unrealengine.com/questions/160332/whats-causing-a-pcswap-network-message.html

Thanks for the hints.

I checked into the pcswap error message. This does not appear in any of my logs. I did have an unused multicast function in my player state. I removed it as a test, but this had no effect.

Accessing the wrong playerController… This was my initial thinking as well. I was not able to find anything so far. I’ll keep looking.

I have a same problem…Did you figure out?