1. Hey! Guest! The 34th GMC Jam will take place between August 22nd, 12:00 UTC (Thursday noon) and August 26th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

HTML5 INI File Deletion

Discussion in 'Legacy GameMaker Community Tech Support' started by Elijah Budd, May 31, 2018.

  1. Elijah Budd

    Elijah Budd Member

    Joined:
    Oct 8, 2016
    Posts:
    3
    I am using Gamemaker v1.4
    I am working on a game for HTML5 that uses an INI file to save and load. On windows export, everything works perfectly. I hosted the game on itch.io and on a desktop browser it also works perfectly.

    However, when I use a mobile web browser, the INI file has been reset every time the browser is opened. Before it simply reset it to the base data, then I put the INI file in as an included file and it reverts back to the information in that.

    How can you keep the web browser from deleting your INI file? Thank you in advance.

    UPDATE: It works on Android. It does NOT work on iPhone. Does this mean the issue lies with Apple? If so, is there any way to slay this God, or shall I be doomed to buy a new phone?
     
    Last edited: May 31, 2018
  2. chmod777

    chmod777 Member

    Joined:
    Aug 26, 2016
    Posts:
    199
    When you use the ini_* functions for that purpose, the browser's local storage API is used.
    https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage

    So that means your ini won't be saved:
    - if the browser does not support the localStorage property.
    - or usually if you run the browser in private mode, the data will be removed once you've closed the window (or any similar configuration).

    Plus, according to the link above, iOS Safari is a special case:
    Starting with iOS 5.1, Safari Mobile stores localStorage data in the cache folder, which is subject to occasional clean up, at the behest of the OS, typically if space is short. Safari Mobile's Private Browsing mode also prevents writing to localStorage entirely.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice