1
\$\begingroup\$

I'm trying to upload player scores to Steam. I'm using the STEAMWORKS.NET C# wrapper, but otherwise I'm just working with the Steamworks API.

Here's the code I'm using:

public static void UpdateScore(int score) { if (!s_initialized) { UnityEngine.Debug.Log("Can't upload to the leaderboard because isn't loadded yet"); } else { UnityEngine.Debug.Log("uploading score(" + score + ") to steam leaderboard(" + s_leaderboardName + ")"); SteamAPICall_t hSteamAPICall = SteamUserStats.UploadLeaderboardScore( s_currentLeaderboard, s_leaderboardMethod, score, new int[] { Data.randomSeed, PlayerStats.enemiesBeaten, PlayerStats.elitesBeaten, PlayerStats.turns, PlayerStats.totalHealthLost }, 5 ); m_uploadResult.Set(hSteamAPICall, OnLeaderboardUploadResult); } } static private void OnLeaderboardUploadResult(LeaderboardScoreUploaded_t pCallback, bool failure) { if (failure) Debug.Log("Failed to upload score."); else Debug.Log("Uploaded " + pCallback.m_nScore + " to " + pCallback.m_hSteamLeaderboard + ". Rank is " + pCallback.m_nGlobalRankNew); } 

When I complete a run and call this code, I get a positive result ("Uploaded __ to ________"), but the leaderboard doesn't reflect the new score, and m_nGlobalRankNew is 0. Am I missing a step?

\$\endgroup\$

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.