Server Side Saving/Loading iOS Specific

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hi guys

    I want to create a "free to play" / "farmville" style stamina system where the player gets x stamina every x seconds, even if they have the iOS app fully closed

    Unless there is an easier way to do it, i assume saving and loading from a server (Lacewing & MySQL?) is the way to achieve this

    Question 1) Has any MMF user already released an iOS app that does a system like this?

    Question 2) Is there a way to do this without requiring the player to login with a username and password - i.e., automatically login using the device UDID (or some other unique device identifier that i do not know about)

    Thanks!

  • If there won't be any multiplayer user interaction (i.e. being able to sell items to other players, ect.) then you could keep the entire game client-side.

    Whenever the player initiates an action that requires an amount of time to pass in order to complete just save a time stamp using the ini object. If the player exits and returns to the game have a routine that compares the current time with the timestamp in order to decide whether or not the action is complete.

    To fully secure this you would need a server to sync to. At the very least have a server that timestamp information can be obtained from.

    SoapCow's first iPhone app! Available now!
    -> Please login to see this link. <-

    Please login to see this link. <- Flash portal with a focus on Clickteam made games!
    Please login to see this link. <- A cool MMF made flash game!

    Twitter:
    Please login to see this link.
    Facebook:
    Please login to see this link.

  • There is the iOS Unix Timestamp extension you can use for this. Save the timestamp to an ini when the app is ended, then when it's opened again you load the old time and compare it to the new time to see how long has passed.

  • Thanks for all the replies so far.

    With the method Urban Monk and RhysD are describing, is there a way to prevent users from messing with the time and date of their own devices?

    Or is the whole point of the unix time stamp that we are comparing the previous server time to the latest server time, and it wont make a difference if people modify their own internal clock.

  • There is no way to insure that the users aren't modifying their own time, or that they are tampering with the actual timestamps stored in the ini.
    A lot of early iPhone games had this very issue. I could change my phone clock to speed up the upgrades.

    The only way to be complely secure is to store everything server-side, but then the game will cost you more to run. You would also need to make your server code easily scalable in case your userbase grow beyond your server's capabilities.

    I've seen some games get around this by using iCloud to store game data, but the iOS exporter doesn't currently have iCloud support.


    For now I suggest you store the Timestamps client-side, and sync the time with a server.

    To protect the timestamps from tampering hash them when they are created with a private key and check them when the game starts up.
    So using the String Parser 2 object do this md5(timestamp + "your_salt") and store it with the timestamp. Then when the game starts up perform the hashing operation again and compare the one in the ini with it. If the timestamp is modified the hashes won't match then you can stop that upgrade (or reset the timestamp) to punish that user for cheating.

    SoapCow's first iPhone app! Available now!
    -> Please login to see this link. <-

    Please login to see this link. <- Flash portal with a focus on Clickteam made games!
    Please login to see this link. <- A cool MMF made flash game!

    Twitter:
    Please login to see this link.
    Facebook:
    Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!