Bug Report - Player State does not return name after OnLogout

4.14 is the first release of Unreal Engine where this function no longer works. Instead of printing out the name of the disconnecting player, it now prints no name at all.

The project uses steam online subsystem.
This has worked flawlessly in every version since UE 4.7, what has changed?
Using the same or similar function ingame works fine, before the player disconnects.

(I recently added the cast to the specific controller class, however it changed nothing.)
In earlier UE4 versions this function was able to display the name of the disconnecting player.
Is there a new way of doing this, or should’nt this still work like before?
Im currently using 4.14.1

Im trying to find a workaround meanwhile. Thanks in advance for any assistance!

Hey MADHOUSE,

Are you receiving any warnings or errors after exiting your play session?

On my end, I’m getting a pending kill error for the Player State, and I was wondering if you’re experiencing the same. This could explain why you’re not getting your Player Name from the Player State.

Greetings! Ive just finnished testing that after building a development build to access logs.

We seem to get the same errors:

"[2016.12.22-21.34.11:135][290]LogScript:Warning: Attempted to access PlayerState_1 via property PlayerState, but PlayerState_1 is pending kill

[2016.12.22-21.34.11:135][290]LogScript:Warning: Script call stack:
Function /Game/Blueprints/MyGame.MyGame_C:K2_OnLogout
Function /Game/Blueprints/MyGame.MyGame_C:ExecuteUbergraph_MyGame

[2016.12.22-21.34.11:231][296]LogScript:Warning: Attempted to access MyPlayerController_C_1 via property K2Node_Event_ExitingController, but MyPlayerController_C_1 is pending kill
"

Thanks for your assistance!

(From the log it seems that the player controller from the ExitingController output on the OnLogout node is not accessible at all.)

Hey MADHOUSE,

I’ve discovered the cause of this issue. It seems that in GameMode.cpp, in the AGameMode::Logout function, the Super::Logout call was being executed at the end of the function instead of at the start.

So if you have a source build, which I would definitely recommend, what you can do is go ahead and make the change in GameMode.cpp around line 126:

Move Super::Logout(Exiting); to the top of the function and compile your engine. This should resolve the issue.

Let me know if that helps.

Ah yes, im using a source version of the engine. This fix seems to work excellently, the controller can now be accessed.

119782-workingonlogout.jpg

Thank you very much for the quick solution!

Have a great weekend!