Protecting Unity Web builds

Posted by (twitter: @lightspeedlucas)
April 20th, 2016 9:05 pm

not this time, thiefs!

Hello! The last time I was in a Ludum Dare my game was a little bit stolen by one of those browser games websites and to this day it’s still there, without my permission. This time I took some precautions! I want to share a very simple way to do it, in case it’s of interest to anyone.

The idea is to check the URL of the page the game is running on and then, if it’s not something you know and approve of, disable the game in some way. Here’s a bit of C# code that does exactly that. Don’t forget to check for ludumdare.com if you embed your game here. If you need me to explain the code with more details or have suggestions on how to improve it, let me know!

Oh, by the way, if the host turns out to be unknown, I wouldn’t just disable the game right away, but instead put a message after the title screen or the first level directing the user to your website or something like that. This way if the pesky thief doesn’t go far enough to see it, they will just generate free traffic for you! The tables have turned ( ͡° ͜ʖ ͡°)

Tags: ,


5 Responses to “Protecting Unity Web builds”

  1. fenwick says:

    Clever. I wasn’t aware that this happened, that’s unfortunate.

    It’s one thing for people to share a game but it’s another thing entirely for a website you don’t approve of to profit off of it.

  2. EdoMiyamoto says:

    Feels bad man, hope you get revenge one day ! Also thanks for sharing this with us, it’s really cool :)

  3. Omiya Games says:

    Are there any benefits to this method compared to this one?
    https://gist.github.com/andyman/e58dea85cce23cccecff

Leave a Reply

You must be logged in to post a comment.

[cache: storing page]