Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Jsonrpc Help! — Gideros Forum

Jsonrpc Help!

mertocanmertocan Member
edited May 2012 in General questions
Hello I need to send point to the my server which uses Php and MySQL but I have no idea how to do it.Can anyone help me?

Comments

  • ar2rsawseenar2rsawseen Maintainer
    Hello, published my simple set up for score API here:
    http://appcodingeasy.com/Mobile-Backend/Score-REST-API-on-PHP5-and-MySQL

    Here is a very simple Gideros usage, you'll need a Json lib for that

    Save score:
    local loader = UrlLoader.new("<a href="http://yoururl/score.php?action=insert&pass=dAS7M2qXT&app=testapp&game=level1points&username=ar2rsawseen&score=100000&type=json&quot" rel="nofollow">http://yoururl/score.php?action=insert&pass=dAS7M2qXT&app=testapp&game=level1points&username=ar2rsawseen&score=100000&type=json&quot</a><img class="emoji" src="http://forum.gideros.rocks/resources/emoji/wink.png" title=";)" alt=";)" height="20" />
    local function onComplete(event)
         local response = Json.decode(event.data)
         print(response.place)
    end
     
    loader:addEventListener(Event.COMPLETE, onComplete)
    Get top:
    local loader = UrlLoader.new("<a href="http://yoururl/score.php?action=top&pass=dAS7M2qXT&app=testapp&game=level1points&quot" rel="nofollow">http://yoururl/score.php?action=top&pass=dAS7M2qXT&app=testapp&game=level1points&quot</a><img class="emoji" src="http://forum.gideros.rocks/resources/emoji/wink.png" title=";)" alt=";)" height="20" />
    local function onComplete(event)
         local response = Json.decode(event.data)
         for i, val in response do
              print(val.place.." - "..val.username)
         end
    end
     
    loader:addEventListener(Event.COMPLETE, onComplete)
Sign In or Register to comment.