Not logged inGosu Forums
Forum back to Help Search Register Login
Up Topic Gosu / Gosu Exchange / Protecting Ruby code in a published application
- - By erikskoglund Date 2012-08-16 14:52
So Ruby is an interpreted language, no compilation. The code is there, right in the .app package (if you're on a mac).

Is there any way to protect your code, aside from using an obfuscator?
Parent - - By erisdiscord Date 2012-08-16 15:39
There's no way to do it that can't be trivially reverse engineered. That's what copyright law is for, though.
Parent - - By erikskoglund Date 2013-01-15 20:28
I was thinking more about users actually editing the code, which could cause.. well, strange things!
Parent - - By Spooner Date 2013-01-15 23:04
Well, unless your game is networked and poorly protected, the worst they are going to do it have a broken game if they edit it. And I don't think many of them would think this was your fault!
Parent - By erikskoglund Date 2013-01-16 19:56
Yeah, that's what I thought!
Parent - - By jlnr (dev) Date 2013-01-16 02:44
That is how kids learn to program! ;)
Parent - By erikskoglund Date 2013-01-16 19:56
haha yeah I hear it is :P
Parent - - By Spooner Date 2012-08-16 23:10
Doesn't matter if you have .app (OSX) or .exe (windows), it is easy to extract your code from the release.

Bear in mind, however, that most Rubyists quite happily have reams of code in public repositories: Everything from the Ruby source code to Rails to Gosu... Somehow we all have no problem with that and don't assume our code to be so fabulous that it will tempt people to rip it off and, in fact, mostly quite happy for that code to be re-used by others. Not sure what makes your code in particular so precious? (Sorry, but this is a question often asked and I always struggle to understand it really).
Parent - - By jlnr (dev) Date 2012-08-17 06:19
You have games with online highscores, you should know. :D
Parent - By erisdiscord Date 2012-08-18 00:39
The only way to really protect that is for the server side to have complete control.
Parent - By Spooner Date 2012-08-19 00:06
The only thing I've learned from having online highscores, is that barely anyone plays my games (but that didn't come as a great surprise :D).
Parent - By Dahrkael Date 2012-08-17 11:16
jlnr is right, maybe you want to protect not the code, but what the code does.
Parent - - By jeremywoertink Date 2012-09-16 06:40
Not sure if this is still an issue for you or not, BUT, from what I've been looking into, it may be possible to just run your game in Rubinius instead of MRI, then use the built in compiler. Now, how to run the game from there is beyond me, but in theory it *should* work.
Parent - - By Spooner Date 2012-09-17 14:35
Or JRuby, if you can use a Java library, like Slick, instead of Gosu. Not sure if Gosu works with Rubinius, but Rubinius doesn't work (well enough) on Windows, for what it is worth.
Parent - By jeremywoertink Date 2012-09-17 20:50
True. I wrote a Gosu game that runs really well in Rubinius, so Gosu is at least workable in it. Or at least on Mac it is :/  I haven't tried Gosu with JRuby, but I'd assume it wouldn't work. I do have a game in JRuby though if anyone wants to go 3D! :)
Up Topic Gosu / Gosu Exchange / Protecting Ruby code in a published application

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill