Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Storing data — Gideros Forum

Storing data

tytadastytadas Member
edited November 2016 in General questions
I am stuck with storing data.. I have completed the facebook login, now I need to make a scene(after you log in with your facebook) where you input your characters name and link it to the facebook, whenever player logs in with hes FB account, he will login with that character name. After all, that's not the interest, is there any specifical way to link ( character level, achievments to a characters name? I do realize I shhould use FIle I/O here, but I would like to understand how everything has to work in a right way.
Any useful tips?

Comments

  • piepie Member
    edited November 2016
    FB plugin already saves the login information somewhere, and it already knows who you are if you're logged in.

    to save and load data on device you can use datasaver module by ar2sawseen:
    http://appcodingeasy.com/Gideros-Mobile/Save-and-load-data-module-for-Gideros-Mobile

    and this is the known FB API Reference for your convenience.
    https://github.com/gideros/giderosplugins/blob/master/Facebook/install.html
    you can find this file in your gideros install dir too inside plugins/facebook


    --authentication
    facebook:login(appId, permissions)
    facebook:logout()

    --get session data
    facebook:getAccessToken()
    facebook:getExpirationDate()

    --requests information
    facebook:get(path, params) --general request for any graph query
    facebook:getProfile(params)
    facebook:getFriends(params)
    facebook:getAlbums(params)
    facebook:getAppRequests(params)
    facebook:getScores(params)

    --publish information
    facebook:post(path, params) -- general post for any information
    facebook:postScore({score: 123})
    facebook:postPhoto(path, {message: , place: , album:})
    facebook:postToFeed({message, link, picture, name, caption, description})

    --delete
    facebook:delete(objectId) --id of the object to delete

    --dialogs
    facebook:dialog(type, params)
    facebook:inviteFriends({message, to, suggestions})
    facebook:share({message, link, picture, name, caption, description})


    EventsEvent.LOGIN_COMPLETE
    Event.LOGIN_ERROR --contains (e.errror)
    Event.LOGOUT_COMPLETE
    Event.LOGOUT_ERROR --contains (e.errror)
    Event.OPEN_URL --contains (e.url)
    Event.DIALOG_COMPLETE --contains (e.type, e.response)
    Event.DIALOG_ERROR --contains (e.type, e.errror)
    Event.REQUEST_COMPLETE --contains (e.type, e.response)
    Event.REQUEST_ERROR --contains (e.type, e.errror)

    --e.type is basically type/path you passed to graph request or dialog,
    --so you would know from what request are you receiving the response

  • Oh, so I should just use dataSaver to save players name, level and etc. right?
  • I mean players progress
  • That's the easiest option to save progress locally.
    If you want to save to cloud I don't know how to do it, but I am pretty sure that we don't have a plugin to do it (yet)
  • @pie What I suppose to do?
  • I don't know :) I am doing what I can with what I have (basic skills).
    The only one who did something about facebook and multiplayer integration seems to be mertocan, whose game make extensive use of multiplayer and facebook. But I don't think it was "easy" to do it. I think he uses noobhub, and that he wrote his own logic for his multiplayer server.

    What you can "easily" do is to login to fb, take the username from there and use it in local multiplayer (using unite framework). Then each player could share their score, and I believe fb could save those scores to a leaderboard.
    But unless you understand net protocols and "advanced stuff" I don't think you can do much about multiplayer.
  • Thanks for advice @pie!
  • I forgot, there is also the Clan of the cloud option, but I have not tried them yet and I don't know if you can do what you want in an easy way.

    http://giderosmobile.com/forum/discussion/6166/clan-of-the-cloud-/p1

    it seems it has changed name to Xtralife:

    http://xtralife.cloud/
  • I will give everything to understand and to make it out! That's the only goal I would expect to complete, because the game project is big! Thanks again! :))
Sign In or Register to comment.