[SOLVED] Problem for distribution

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Chloro
Prole
Posts: 2
Joined: Sun Aug 17, 2014 10:12 am

[SOLVED] Problem for distribution

Post by Chloro »

Hello, this my first time here, so, I could introduce myself a little, I'm a French dev who work with Löve since now 6 month, and i very like this engine, but, I encounter my first problem that I can't solve, and all the search I've made didn't resolve anything.

So, my problem is that I want to obfuscate my code from the eyes of the user, because I don't want the player easily can access to everything in the code, and change anythings, or find how to access for example, to the network data who can be use in a online game.

I've planned to use LuaC, but ... I didn't success to do what I want. I havn't success to use love.filesystem.load or dofile.

For love.filesystem.load(file)(), it say that the bytecode isn't compatible, and I don't know how to solve this.
For dofile(path), I havn't succesfuly get the path, so, I can't use it.

Have you anything to suggest to solve my problem, I'll be very happy and thanksfull ! :awesome:

PS : I absolutely want to obfuscate a little, even if it reversible, because it will be less easier to do for the user. :)
Last edited by Chloro on Wed Aug 20, 2014 1:13 pm, edited 2 times in total.
User avatar
slime
Solid Snayke
Posts: 3162
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Problem for distribution

Post by slime »

LÖVE uses LuaJIT 2.0 by default. Lua bytecode is incompatible between different Lua versions (and different architectures if you don't use LuaJIT.)

This page shows how to generate LuaJIT bytecode using the standalone LuaJIT interpreter, or via LÖVE if you use string.dump on the function returned by love.filesystem.load'ing a regular Lua file, and then save it using love.filesystem.write. If you make the generated files have the .lua extension then they'll work with 'require', too.
Chloro
Prole
Posts: 2
Joined: Sun Aug 17, 2014 10:12 am

Re: Problem for distribution

Post by Chloro »

Thanks to you, it work perfectly ! :D
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest