Log In  

So I've heard talk about how the new version allows one to do some basic piracy protection. Presumably by reading the URL of the website a web players is embedded in. Not exactly sure how to implement this. Can anybody post some sample code?

P#48111 2018-01-13 07:25 ( Edited 2018-01-14 18:11)

1

i just ran a few tests, stat(102) returns:

  • 0 (a number) when run from pico8.exe or binary export

  • "" from local html export

  • "www.yoursite.com" when run from www.yoursite.com/whatever.html

  • or "yoursite.com" if the www is omitted in your browser's address bar.

  • "game.itch" from the itchio app

so basically you would test stat(102) against "www.yoursite.com" or "yoursite.com"
(might be a good idea to remove the www part in 0.1.11h?)

P#48115 2018-01-13 08:52 ( Edited 2018-01-13 14:43)

Is this only useful for binary exports?

I can't see how it'd help for the web player, since it's basically delivered as source and a person could just remove the code that checks those stats.

P#48118 2018-01-13 09:09 ( Edited 2018-01-13 14:09)

only useful for html exports, outside of the bbs. the code is compressed and/or encoded, so less easily hacked off. I guess you could put something like this at the end of your cart:

function static()
    for a=0x6000,0x7fff do
        poke(a,rnd(0xff))
    end
end

if (stat(102)!="felice.itch.io") _draw=static
P#48120 2018-01-13 09:41 ( Edited 2018-01-13 14:41)

Nice one Ultrabrite. Thanks!

P#48174 2018-01-14 13:11 ( Edited 2018-01-14 18:11)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 22:35:33 | 0.007s | Q:15