Password verification at user login

So, the code that I used to get the Steam ID is Steam:

CSteamID uid = SteamUser()->GetSteamID();
uint64 pid = uid.ConvertToUint64();
std::ostringstream sin;
sin << pid;
std::string s = sin.str();
return s.c_str();

This works fine, but when the user has not logged in to Steam, it will work.

Access violation - code c0000005 (first / second chance is not available)


Does Steam provide a function that I can use to check if a user is logged in before running code that depends on the user's login? Or is there some kind of try / catch block that I can use here to make sure this does not interrupt and returns false if the user is not logged in?

+4
source share
1 answer

@Lightning Racis . nullptr .

if(SteamUser() == nullptr)
    return false;
+1

Source: https://habr.com/ru/post/1584553/


All Articles