How do I create a build without releasing script source code?
by Jeff Moretti · in Torque 2D Professional · 02/24/2014 (8:31 pm) · 10 replies
Hi,
I am working on porting my project to the new 2.0 version of Torque 2D, but I am wondering how to create a build with the new framework while hiding the source script files (.cs files) from the user. Is there a way to do this?
Thanks in advance,
Jeff
I am working on porting my project to the new 2.0 version of Torque 2D, but I am wondering how to create a build with the new framework while hiding the source script files (.cs files) from the user. Is there a way to do this?
Thanks in advance,
Jeff
About the author
Recent Threads
#2
Additionally, I don't think DSO generation is on by default.
And we really should look into allowing the engine to use a DSO of the root main.cs as well - I'm not sure there is a compelling reason not to.
02/25/2014 (6:35 am)
An addendum - always back your work up, preferably using a source control solution. So, in your Git fork make yourself a work branch and always commit changes to your game back to this branch. In the event of a catastrophe your rear-end is covered....Additionally, I don't think DSO generation is on by default.
And we really should look into allowing the engine to use a DSO of the root main.cs as well - I'm not sure there is a compelling reason not to.
#3
Then again, you could probably just make it internally call the c++ equivalent of exec() and make it recognize a dso by the engine on startup probably...
02/25/2014 (6:03 pm)
Richard you could also just shove the ts code directly into the engine and obfuscate it or something, after all, all it does to my knowledge is read the contents of the file and call an internal eval() on it on the c++ side of things.Then again, you could probably just make it internally call the c++ equivalent of exec() and make it recognize a dso by the engine on startup probably...
#4
02/25/2014 (7:08 pm)
If I recall, all it would take is a tiny tweak - right where it calls that first internal eval().... Right now it just looks for "main.cs" but could be made to look for "main.dso" if the other is missing. Actually made this change once - just for testing during development of 3SS.
#5
02/26/2014 (11:39 am)
@Richard: I think that would help T3D projects as well seeing as right now it's not really that hard for someone to come along and slap in a exec line in main.cs to add their own custom code to a project to "mess" with settings...
#6
02/27/2014 (11:53 am)
having that exposed is very bad. For example, you could write any function you ever wanted too, and just schedule it to override functions defined after executions. Horray for TorqueScript for allowing itself to override stuff through packages and allow redefinitions.
#7
02/27/2014 (1:26 pm)
I suppose the original intent was to make modding games easier, but because there are platform-level file system commands accessible through script it could really be abused.
#8
02/27/2014 (6:05 pm)
Richard, Any known way to make it like marbleblast where it was only restricted to the game folders?
#9
02/27/2014 (10:05 pm)
Shouldn't be too hard - but the changes would be a little scattered. Have to do some digging I suppose....
#10
Make T3D Read Binary Mission DSO Files (For Release Builds)
Here is one thing I've included because I want to protect as many assets as possible.
02/28/2014 (4:36 am)
Jeff are you also trying to make mission files DSO binary files? It is a process to get everything into protected formats for a release. Make T3D Read Binary Mission DSO Files (For Release Builds)
Here is one thing I've included because I want to protect as many assets as possible.
Associate Simon Love
When you release your game, just delete all your .cs files except your root main.cs and keep the .dso files in their stead.
Make sure to tell the engine to use the DSOs in your main.cs file
Bonus tip
When you save object to the taml persistence format, you can specify if you want to encode them as "xml", "binary" or "json". Binary won't be easily editable like xml and json formats are.
TamlWrite("./savedfile.taml", "binary", true);