Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
7RS
11
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 16th Jun 2012 20:25
Hi,
usually when you want to save game data or application data you can use the secure area, especially in iOS, how to do it with AppGameKit ? i haven't seen any command to read and write in secure area, the secure area should be supported, i know for sure, by all the OS, iOS, Bada, Playbook, Android.

There is a specified path to include to read and write in the secure area ? if not how i can perform a save usable on all devices ?

Thanks.
basjak
14
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 16th Jun 2012 20:36
just being curious. why a game data need to be in secure area as long as it doesn't include player details?.

7RS
11
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 16th Jun 2012 20:44
Apple suggest to use the secure area when you save game data, in any case at the moment any place could be good but a simple write file on iOS doesn't work, you can't write anything in the application folder. In the SDK we have used before we can easy use the Save in secure area and was so simple. Also the write command of AppGameKit seem to be a bit poor.

Any suggestion ? we do not use T1 we use T2 and would be nice to be able to save the entire data structure. Usually if i open a file for write i can save my data structure with a single write but with the commands available from AppGameKit seem to be impossible.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 16th Jun 2012 22:14
iOS apps are sandboxed = the app can only read & write files from within its own directory.

AGK does this automatically for you. all saved files are written into you Documents dir inside your app dir.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 16th Jun 2012 22:15
7RS, what commands are impossible?

you have 2 sets of simple commands, read and write. it can't be simpler than that.

check the docs and examples.
7RS
11
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 17th Jun 2012 14:29
To save a structure you can easy do

write(data,size);

where data can be a structure like:



Which AppGameKit command can save the structure in 1 time same as the fopen?

OpenToWrite
WriteFloat
WriteInteger
WriteLine
WriteString

I do not see anything in the commands that can help!
7RS
11
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 17th Jun 2012 22:14
I think i resolved the problem but not with AppGameKit commands, i have used the fopen, fread and fwrite commands and now the preferences and data slot seem to work.

If with the AppGameKit command i can do the same thing with a single write call please let me know.

Thanks.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 18th Jun 2012 02:17
There is no AppGameKit for writing blocks of data.

There are only commands to write 'discrete' pieces like strings, integers, floats or whole lines of text.

Since you are using Tier 2 and you know the size of your structure, you should be able to do fwrite and fread commands with pointers to the data object and the size of the object. (http://www.cplusplus.com/reference/clibrary/cstdio/fwrite/))

Cheers,
Ancient Lady
7RS
11
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 18th Jun 2012 09:37
Is exactly what i did.
7RS
11
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 27th Jun 2012 19:46
I'm using the fwrite at the moment but agk seem to return with some malloc problem, i'm not able to report the exactly error at the moment but can be easy tested creating a file and reading and writing from it.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 27th Jun 2012 21:05
Can you post the exact code you are using (not just the one line, but the ones leading up to it as well)?

And please post the exact error message?

Cheers,
Ancient Lady
7RS
11
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 29th Jun 2012 14:19
For now we have changed all using AppGameKit calls and seem to be ok, not easy to save data structures but we made a function that help a bit.

Login to post a reply

Server time is: 2024-05-02 09:28:21
Your offset time is: 2024-05-02 09:28:21