How to get main.cs to compile to DSO?
by Beef Churger · in Torque 2D Beginner · 06/19/2014 (1:24 pm) · 7 replies
My game has a level system that uses hashing for authentication.
However, I want to be sure people can't just open main.cs and add "setLevel(100);" or something along those lines.
Simply put, how can I make main.cs compile? Thanks guys.
However, I want to be sure people can't just open main.cs and add "setLevel(100);" or something along those lines.
Simply put, how can I make main.cs compile? Thanks guys.
#2
06/20/2014 (6:27 am)
As an addendum to number 2, the place to change it in the source code is in the source/game folder, defaultGame.cc, line 257.const char* defaultScriptName = "main.cs";
#3
06/20/2014 (7:36 am)
Thanks Mike! I was too tired/lazy to look that up =)
#4
06/20/2014 (10:08 am)
I would cheat on your debug builds and have it look for main.cs first and then look for main.dso if main.cs does not exist - #ifdef this out so it just looks for main.dso in release builds.
#5
And yes, the file is there.
06/24/2014 (3:12 pm)
I've set defaultScriptName to "main.cs.dso" (when it's a release), and the game does not launch.And yes, the file is there.
#6
06/24/2014 (10:10 pm)
Debug, set breakpoints, follow the rabbit....
#7
06/25/2014 (6:48 am)
Oh, hell - just realized why it doesn't launch - it's trying to compile the compiled script. You have to tell it what to do with the pre-compiled script. The console function exec() does this - it's in console/consoleFunctions.cc around line 996.
Employee Michael Perry
ZombieShortbus
1. You actually compile it into a DSO
2. YOu change the engine source code to not locate and find "main.cs". You will need to change the code to locate and execute the DSO instead.