So this hour I’ve just been trying to implement Mogade, the leaderboard service I found yesterday. I’ve got further with it, and managed to save scores and retrieve them, so all that is really needed now is to just tidy up everything and made sure they get called at the correct time.

The main thing I’d not seen before is the terminology used for the callback messages that get recieved after each call to the mogade API. They require a “Action<Mogade.Response<somthing>>” and this was something I’ve not seen before in my C# experience. It basically means though, that it can take a function which has the parameters of “Mogade.Response<somthing>”, so that when there is an error, or the leaderboard list is returned, or the rank of the saved score etc. then it will call the function passed through to it when it succeeds or fails. E.G:

mogade.SaveScore(leaderboardID, score, SaveScoreCallback); // where SaveScoreCallback is the function below.

public void SaveScoreCallback(Mogade.Response<Mogade.Leaderboards.Ranks> response)
{
// Do stuff with the response
}

Next hour I might have something working that I can show! But maybe not. I’ll keep you posted!

Advertisements