C++ equivalent of the DestroySession Blueprint Node

Is there anything close to a C++ equivalent of this node that’s accesible from a PlayerController Blueprint?

Capture

Looking at this blogpost, I don’t see any connection to a player controller. I’m trying to understand what exactly this means

1 Like

hovering over it, it says it’s a Destroy Session Callback Proxy, which is in DestroySessionCallbackProxy.h …i have absolutely no idea how you use it, but there’s the code

Right I found some documentation here, but can’t figure out how to use it

https://docs.unrealengine.com/4.27/en-US/API/Plugins/OnlineSubsystemUtils/UDestroySessionCallbackProxy/

I can’t find any code examples and when I try to include the header files, I get

cannot open source file “DestroySessionCallbackProxy.h”

Callback proxies are made for blueprints. Don’t use them in C++.

When you are dealing with online stuff, you’ll have to interact with the engine’s online subsystem. There are a bunch of interfaces in the online subsystem, the one you are looking for is the session interface, which has the DestroySession function. Depending on your current project configuration this will call the platform specific (Steam, EOS, etc.) implementation of that function.

More info: How To Use Sessions In C++

1 Like

That’s a good looking guide. Thank you!

Since sessions are name-based, I’m wondering how the Blueprint nodes are performing these actions strictly off of the PlayerController? Is their some innate behavior that links sessions names to an instance of PlayerController?

No there’s no connection between the two. In fact, the player controller is only needed to read the player’s unique id, which is completely pointless because at the end the online subsystem disregards the player’s unique id, and just uses the local player instead when calling most functions.