x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

SteamUserStats() generating crash

Hello everyone,

I have a problem with the Steam API when I try to find a leaderboard.

Looks like SteamUserStats() is not returning what it is meant to.

This is what I am doing:

1 - At the begining:

 CSteamLeaderboards* g_SteamLeaderboards = NULL; // Global variable
 
 ...
 
     // Initialize Steam
     bool bRet = SteamAPI_Init();
 
     // Create the SteamLeaderboards object if Steam was successfully initialized
     if (bRet)
     {
         g_SteamLeaderboards = new CSteamLeaderboards();
     }

2 - Run SteamAPI_RunCallbacks() every tick.

3 - When I try to find the leaderboard:

 if (g_SteamLeaderboards)
 {
     g_SteamLeaderboards->FindLeaderboard(LEADERBOARD_TIME);
 }

4 - My CSteamLeaderboard.cpp (exactly the same as Spacewar example):

 CSteamLeaderboards::CSteamLeaderboards() : m_CurrentLeaderboard(NULL), m_nLeaderboardEntries(0)
 {
 }
 
 void CSteamLeaderboards::FindLeaderboard(const char *pchLeaderboardName)
 {
     m_CurrentLeaderboard = NULL;
 
     SteamAPICall_t hSteamAPICall = SteamUserStats()->FindLeaderboard(pchLeaderboardName); // <---- THE ERROR POINTS TO THIS LINE
     m_callResultFindLeaderboard.Set(hSteamAPICall, this, &CSteamLeaderboards::OnFindLeaderboard);
 }

This is the crash log I get:

Unknown exception - code c06d007f (first/second chance not available) KERNELBASE UE4Editor_EliosisHunt!__delayLoadHelper2() [f:\dd\vctools\delayimp\delayhlp.cpp:386] UE4Editor_EliosisHunt!_tailMerge_steam_api64_dll() UE4Editor_EliosisHunt!CSteamAPIContext::Init() [c:\program files\epic games\4.11\engine\source\thirdparty\steamworks\steamv137\sdk\public\steam\steam_api_internal.h:92] UE4Editor_EliosisHunt!CSteamLeaderboards::FindLeaderboard() [c:\unreal files\eliosishuntworkspace\eliosishunt\source\eliosishunt\private\csteamleaderboards.cpp:19

What am I doing wrong?

Thanks in advance.

Product Version: Not Selected
Tags:
more ▼

asked Jul 29 '16 at 01:54 PM in C++ Programming

avatar image

daan_cover
52 4 6 9

avatar image SlimeQ Feb 14 '18 at 06:41 PM

Did you ever figure this out? I just started getting it seemingly randomly and now I can't even open my project

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question