Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CallResult functions like FindorCreateLeaderboard always have a failed result #664

Open
arnedirlelwy opened this issue Dec 4, 2024 · 2 comments

Comments

@arnedirlelwy
Copy link

arnedirlelwy commented Dec 4, 2024

Hello. I am trying to get leaderboards setup but everytime I try and use FindLeaderboard for an already created leaderboard or FindorCreateLeaderboard the callback function is called but the result is always failed. I have followed the examples and can;'t figure out what I am doing wrong. Note, I have tried using GetNumberOfPlayers and that also receives a result of failed. So I think it must be an initialization thing.

Here is what my code looks like. Steam is being initialized, I can get my username just fine. pCallback.m_bLeaderboardFound is always 0 in onFindGlobalLeaderboard. Any ideas?
`

private CallResult<LeaderboardFindResult_t> _leaderboardFindResult;

public void Start() {
  Debug.Log("Record_Controller | Start ");
  _leaderboardFindResult = CallResult<LeaderboardFindResult_t>.Create(onFindGlobalLeaderboard);
}
public void Init() {
    if (Steam_Controller.Initialized) {            
        SteamAPICall_t hSteamAPICall = SteamUserStats.FindLeaderboard("pizza"); //), ELeaderboardSortMethod.k_ELeaderboardSortMethodAscending, ELeaderboardDisplayType.k_ELeaderboardDisplayTypeNumeric);
        _leaderboardFindResult.Set(hSteamAPICall);
	}
}

public void onFindGlobalLeaderboard(LeaderboardFindResult_t pCallback, bool bIOFailure) {
    Debug.Log("[" + LeaderboardFindResult_t.k_iCallback + " - LeaderboardFindResult] - " + pCallback.m_hSteamLeaderboard + " -- " + pCallback.m_bLeaderboardFound);

    if (pCallback.m_bLeaderboardFound == 1 && !bIOFailure) {
        _currentGlobalLeaderboard = pCallback.m_hSteamLeaderboard;
    }
    else {
        Debug.LogError("OnFindGlobalLeaderboard : Leaderboard not found");
    }
}

`

@arnedirlelwy
Copy link
Author

Copying and pasting the example from (https://steamworks.github.io/gettingstarted/#getting-started-with-steamworksnet) Call Result section for getting player numbers fails for me. So it would appear to me to be some sort of initializing or denial of access from Steam for that data?

@arnedirlelwy
Copy link
Author

I am developing on a Mac. Both in Editor and when the project is built, running on Mac has this issue. Running a built version on Windows does not. I don't have unity editor setup on my PC to test if in editor works, but it appears to me to be a Mac specific issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant