GLBasic forum

Main forum => Bug Reports => Topic started by: Millerszone on 2011-May-21

Title: WebOS not saving game settings with latest Hotfix
Post by: Millerszone on 2011-May-21
Worked fine with beta, but after installing the hotfix, game is not saving or reading game settings.

Here is the code I've been using:
Code (glbasic) Select

GLOBAL gameSettings$
gameSettings$ = PLATFORMINFO$("DOCUMENTS") + "/settings.dat"

FUNCTION saveSettings:
INIOPEN filePathSettings$
INIPUT "settings", "twoplayers", twoplayers
INIPUT "settings", "expert", expert
INIPUT "settings", "mute", mute
INIOPEN ""
ENDFUNCTION

Title: Re: WebOS not saving game settings with latest Hotfix
Post by: MrTAToad on 2011-May-21
Do you check to make sure there is an empty file present before saving ?  It is needed to enable the data to be saved - unfortunately this differs from Windows, where it isn't needed.
Title: Re: WebOS not saving game settings with latest Hotfix
Post by: Millerszone on 2011-May-21
Something must have changed between build 9.040 and 9.104 because I didn't need an empty file before saving.

Just to make sure I deleted HTD Baseball from the Palm, recompiled with build 9.104, didn't save settings. Then I
re-downloaded HTD Baseball(built from 9.040) from HP App Catalog and it DOES save settings.
Never had to create an empty file. So now I'll try creating an empty file first and see what happens.
Title: Re: WebOS not saving game settings with latest Hotfix
Post by: ampos on 2011-May-22
Why has been this changed?

It is more easier and logical to keep it the old way: the first save on an empty-non-existent file, will write it... logical (at least, to me)
Title: Re: WebOS not saving game settings with latest Hotfix
Post by: Kitty Hello on 2011-May-23
OK. If the file name is given (not empty), the program uses this name when you exit the program or iniopen "" afterwards to save the changes (if any made).

Make sure the path is correct and you're not changing directory somewhere in between (might mess it up).

Check the log file. It should tell you if it can't write a file.

Please debug the filename with stdout to see it's written properly.
Maybe platforminfo$("documents") is broken for root access?
Title: Re: WebOS not saving game settings with latest Hotfix
Post by: MrTAToad on 2011-May-23
With this test program :

Code (glbasic) Select
LOCAL fileName$,eMail$=PLATFORMINFO$("DOCUMENTS")+"/output.txt"
LOCAL handle%=GENFILE()

DDgui_msg(handle%+" "+eMail$,FALSE)
IF OPENFILE(handle%,eMail$,0)
fileName$=PLATFORMINFO$("DOCUMENTS")+"/test.ini"
WRITESTR handle%,"Filename : "+fileName$+"\n"

KILLFILE fileName$
IF DOESFILEEXIST(fileName$)=FALSE
WRITESTR handle%,"Not present\n"
ELSE
WRITESTR handle%,"Present\n"
ENDIF

INIOPEN fileName$
INIPUT "A","B","C"
INIOPEN ""

IF DOESFILEEXIST(fileName$)=FALSE
WRITESTR handle%,"Not present\n"
ELSE
WRITESTR handle%,"Present\n"
ENDIF

CLOSEFILE handle%
sendEMail(eMail$)
DDgui_msg("Done",FALSE)
ELSE
DDgui_msg("Error",FALSE)
ENDIF


Filename : /media/cryptofs/apps/usr/palm/applications/com.unmapcom.test1/test.ini
Not present
Not present

If we create an empty file, we get :

Filename : /media/cryptofs/apps/usr/palm/applications/com.unmapcom.test1/test.ini
Not present
Present
Present

Title: Re: WebOS not saving game settings with latest Hotfix
Post by: Kitty Hello on 2011-May-25
OK, there was a bug. I fixed it. I can't hotpatch, because I changed a real lot with the output direcory at the weekend. Next weekend I hope for an update.