Creating A Cross-Platform Leaderboard

Hello everyone. As I am nearing the completion of my app, I have realized a need for a global, cross-patform leaderboard. For several days now I have been messing around with a free web host using PHP and mySQL. I think doing this from scratch is very difficult, and possibly not worth the time and effort. Does anyone know any better ways to make a cross-platform leaderboard for free? 

Thanks

Summit Tech

Yes. Its called Coronium and its ready to go. Look at Coronium.io and the posts on this forum.

https://bitbucket.org/develephant/coronium-leaderboard-module/wiki/Home

http://coronium.org/doku.php/what_is_coronium

The leaderboard was demo’ed in one of the Corona Geek sessions few weeks ago. Maybe three weeks. You can see it action there. 

This is definitely what I’m looking for. However, you must rent a server which I can’t do. Hopefully there is another free option out there.

Look at the AWS option. You can run it free for a year.

Nice! I will DEFINITELY use this method in the future. I’m just wondering though if there are any services that don’t require credit card info (AWS options needs it).

Thanks

Hi,

try this one. Its free and easy to implement.

http://www.dreamlo.com

That’s awesome! I will be using this for my leaderboard! I was wondering if you had made a test app with this site? If so please let me know.

i have tried it some time a go and it worked very well but i do not have any test code anymore. Just one hint. You have to use the corona api calls network.download and network.request for the communication with the server. The implementation was straight forward. 

Thanks. I got it work to the point where every time I use my function, I save the json data to a file. I’m having trouble loading the scores and then setting them equal to variables.

try something like that.

local path = system.pathForFile( “score”… “.json”, system.DocumentsDirectory )

local file = io.open( path, “r” )

if not file then

       return

end

globalScores = json.decode( file:read( “*a” ) )

io.close( file )

Yup. I now have a json file created but there is a problem with the json’s format. It is quite strange. All of the data is in a sub-sub-sub family. Also the names and scores are in a seemingly unaccessable family. I want to take the first 100 names and scores and make a list of them. Still having some trouble.

Edit: here is the json file

{"dreamlo":{"leaderboard":{"entry":[{"name":"SummitTech","score":"55"},{"name":"Brengor","score":"43"},{"name":"DrClueless","score":"39"},{"name":"Duplon","score":"31"},{"name":"Skygoma","score":"23"}]}}}

If it helps, you can put some newlines in there to help you understand the structure a bit better:

{"dreamlo":     {"leaderboard":         {"entry":[            {"name":"SummitTech","score":"55"},             {"name":"Brengor","score":"43"},             {"name":"DrClueless","score":"39"},             {"name":"Duplon","score":"31"},             {"name":"Skygoma","score":"23"}]         }     } }

When this gets json.decode()'ed into a Lua table you have (lets call the table “t”:

t.dreamlo.leaderboard.entry[1].name

t.dreamlo.leaderboard.entry[1].score

t.dreamlo.leaderboard.entry[2].name

t.dreamlo.leaderboard.entry[2].score

t.dreamlo.leaderboard.entry[3].name

t.dreamlo.leaderboard.entry[3].score

etc.

Here is a little sample to show you:

local json = require("json") local t = json.decode([[{"dreamlo":     {"leaderboard":         {"entry":[            {"name":"SummitTech","score":"55"},             {"name":"Brengor","score":"43"},             {"name":"DrClueless","score":"39"},             {"name":"Duplon","score":"31"},             {"name":"Skygoma","score":"23"}]         }     } } ]] ) print(t.dreamlo.leaderboard.entry[1].name) print(t.dreamlo.leaderboard.entry[1].score) print(t.dreamlo.leaderboard.entry[2].name) print(t.dreamlo.leaderboard.entry[2].score) print(t.dreamlo.leaderboard.entry[3].name) print(t.dreamlo.leaderboard.entry[3].score)

Rob

Thank you so much Rob! You have no idea how helpful your post was! I will try messing with my code in a bit. I’ll let everyone know if things workout.

Thanks again

Yes. Its called Coronium and its ready to go. Look at Coronium.io and the posts on this forum.

https://bitbucket.org/develephant/coronium-leaderboard-module/wiki/Home

http://coronium.org/doku.php/what_is_coronium

The leaderboard was demo’ed in one of the Corona Geek sessions few weeks ago. Maybe three weeks. You can see it action there. 

This is definitely what I’m looking for. However, you must rent a server which I can’t do. Hopefully there is another free option out there.

Look at the AWS option. You can run it free for a year.

Nice! I will DEFINITELY use this method in the future. I’m just wondering though if there are any services that don’t require credit card info (AWS options needs it).

Thanks

Hi,

try this one. Its free and easy to implement.

http://www.dreamlo.com

That’s awesome! I will be using this for my leaderboard! I was wondering if you had made a test app with this site? If so please let me know.

i have tried it some time a go and it worked very well but i do not have any test code anymore. Just one hint. You have to use the corona api calls network.download and network.request for the communication with the server. The implementation was straight forward.