Game Development Community

Saving compiled cs files

by Matthew Wilmot · in Torque Game Builder · 04/18/2011 (10:23 am) · 8 replies

I've seen a few threads on this but none seem to come to an answer, I'm using script objects saved to disk to store game information between sessions. However I can't see a way to get this data secured so users cannot edit it.

Is there a way to save the data as a compiled dso file rather than a cs file?

Thanks!

#1
04/18/2011 (12:43 pm)
I never tried it before, but this should work in theory.

1) Write the .cs file to disk
2) Use the compile() in script to compile the .cs to .dso
3) Delete the .cs file from the disk

Not ideal, but is the only way I can think of off the top of my head to do that as .dso files are only generated by compiling the .cs files.
#2
04/18/2011 (6:26 pm)
2.5) add setMod(getMod()); so your .cs gets included in the resource manager
#3
05/02/2011 (5:54 am)
Sorry for the late reply,

I've been looking at similiar responses to this but they are all from ages ago.

My files seem to save in the 'application data' folder inside my 'documents and settings' folder but the compile comand only reads from the game directory. I've read some where that we shouldn't use real address in the command lines as they change on a per computer basis.

Presumably setMod(getMod()) has something to do with all this but i'm unsure of its usage.

I'm very grateful for any help.

(P.S. I'm working in iTorque 2D the most recent version)
#4
05/03/2011 (11:14 am)
I mean if my way is wrong is there a better way to save game data between sessions?
#5
05/03/2011 (12:35 pm)
My main problem is that you can compile anything within the user directory (compile only works in the game directory) and you can save anything in the game directory so I can't compile it there and copy it out.

There must be a way to save data safely or else it'd be as simple as opening up files on you iPhone/iPad and changing player data (current level, health, score, etc).

It's really got me stuck and could really undermine the game.
#6
05/07/2011 (2:40 pm)
Gah! Why is this turning out to be so difficult, the engine already has the components required to compile a cs file to dso and then delete the cs.

I've done a google search (the forum search tool doesn't seem to work) of the site for setMod and can't find it mentioned anywhere but in this thread and I only get age old results for anything about trying to securing sensitive data.

Surely all Torque releases haven't been shipped with unsecured files or are they all using 3rd party data securing packages?
#7
05/11/2011 (5:36 am)
It seems that TGB got lost in it's own directory access rules. Forget about compiling and deleting anything using it's console functions, and start looking for workaround.

You can, for example, add some kind of checksum value to your saves, this way you will be able to check if it was edited or not.
#8
05/13/2011 (3:20 pm)
Ahhh well that just seems like a waste of a perfectly good solution, I guess the simplest way isn't the best way after all.

Thanks anyways.