Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hey Dan, I have a problem. The first time I upload an entry everything works just fine but the second time i can't and get an error saying "Uploading entry data failed!". Everything worked fine 2 days ago and I haven't changed any code. What might be causing this?

public void GetLeaderBoard() {

        LeaderboardCreator.GetLeaderboard(publicLeaderboardKey, ((msg) => {

            int loopLength = (msg.Length < names.Count) ? msg.Length : names.Count;

            for (int i = 0; i < loopLength; i++) {

                names[i].text = msg[i].Username;

                scores[i].text = msg[i].Score.ToString();

            }

        }));

    }

    public void SetLeaderBoardEntry(string username, int score) {

        LeaderboardCreator.UploadNewEntry(publicLeaderboardKey, username, score, ((msg) => {

            GetLeaderBoard();

            LeaderboardCreator.ResetPlayer();

        }));

    } 
Here is the code.

(+1)

Hello! You are calling it correctly, however, before getting the leaderboard you have to wait a certain amount of time, because after the reset - the player's new unique id needs to be fetched from the server to identify as a new player, and all of this does not happen instantly.