How to confirm Steam Connection has been made

Please bear with me as this is my first post and I will include as many details as I can.

Goal:
To have a “User Extended” Widget (which is my main menu) display a connection status (check box) for steam. The box will be checked if the connection is confirmed. This can/should be done via a variable, but I’m just dipping in the pond here.

Steps performed thus far:

  • I have successfully integrated the Steam SDK v136 in to my project using the Online Subsystem Steam tutorial on the hub
  • I have successfully followed the tutorial of creating a C++ Widget Parent class that my UMG widget is a child of
  • My Game (more like utility for steam workshop uploading); launches directly to my Main Menu.
    Up to this point, if I launch the game, everything looks staged, and my Steam is integrated perfectly. For example, shift-tab works to bring up the Steam Overlay.

Issue:

My problem occurs when I start trying to make code in the cpp file for the Parent Widget Class that my UMG object is a child of.
I’m trying to create a function/blueprint that my widget can use to get a state of the Steam Client. Something like a boolean returning true/false if the user is logged in.

I followed the steps in this tutorial that provided code for doing just such a check: Steam, Using Online Subsystem

I’ve included the online.h and onlinesubsystem.h headers.
The problem is that the compile fails on the lines

EOnlineStatus ASteamHandler::getPlayerOnline(class APlayerController* PlayerController)

ELoginStatus::Type l = ion->GetIdentityInterface()->GetLoginStatus(PlayerController->Player->GetControllerId());

Due to that it cannot resolve the name “ASteamHandler”

Any thoughts?

Edit:
While back tracking my steps for my post, I also came across this article Steam workshop; which I will review later, as I’m done for the evening. It looks promising, but what I’ve read on the other tutorials so far; infer that I should not try to interact with the Steam API’s directly, but rather work through the OnlineSubsystem within UE.

Look like you need to learn some C++ basics since error is really obviues. “getPlayerOnline” is just example of a function, just copy pasting won’t work, you need to declare function in header file first. Make a class (can be any UObject) and declere function inside header file and class decleration:

UFUNCTION(BlueprintCallable,Category="Online")
static EOnlineStatus GetPlayerOnline(class APlayerController* PlayerController);

“static” makes function callable without need of object instance (“Target” pin). And then you can use that code just insted ASteamHandler use name of a class you using

Also by UE4 conventions all first letter of function name should be upper case “GetPlayerOnline”

Excellent! My first draft at implementing last night did not go so well, but I blame the late hour.

I’ll re-attempt and follow-up with the results, as you said, I still have much to learn about C++

So after learning more c++ and UE basics, plus your comment about making the function declarations “Static”. I’ve completely gone a different route, but have what I needed accomplished.

I noticed, I never marked this as answered…

Something to note here.

  1. I had changed the SDK used by the engine; which would invalidate a lot of the OnlineSubsystem wrappers Epic built for us. So, I interacted with the Steam APIs directly, instead of the UE SubSystem functions.

That being said, it was very easy to have a simple C++ function that could be called from BluePrint, check the state of Steam to see if it successfully initialized or not, and return the result.

is there a way to do it with blueprints?