-2

How a HTML5 game can be buyable? I mean, if it is HTML, even though you obfuscate the code or apply encryption, the whole html and javascript is already on your browser means you already have the whole code. then how can it be buyable? I don't understand.

I mean even if you make sure that unauthentic person can not play your games. But there is a possibility that an authenticated user can steal your assets like images, scripts etc.. And by making some changes if redistributes the same how the buying thing protects that? How to achieve this protection?

Prachi Joshi
  • 101
  • 2
  • How do you plan letting users (customers) to access your HTML (code)? You can always require a login and a necessary communication with your license sever before the game can be played. – πάντα ῥεῖ Mar 05 '18 at 18:47
  • 2
    Note: obfuscation is largely useless because obfuscated code still _runs._ – msanford Mar 05 '18 at 18:58
  • 2
    Possible duplicate of [How can software be protected from piracy?](https://softwareengineering.stackexchange.com/questions/46434/how-can-software-be-protected-from-piracy) – gnat Mar 05 '18 at 20:47
  • The question doesn't make sense, just because something can be pirated it doesn't mean that there is no point licensing it. People can pirate closed-source software too, yet there are still law-abiding people who pay for it. – Sean Burton Mar 06 '18 at 17:01
  • How can be a phone buyable? I mean, I can unassemble it and get all its parts. Like Phones, the hardware (in this case the HTML) part is probably the cheapest part. The expensive one is the services and the user experience. That is far away from to be copied just as "HTML code". – Laiv Mar 07 '18 at 07:49
  • I mean even if you make sure that unauthentic person can not play your games. But there is a possibility that an authenticated user can steal your assets like images, scripts etc.. And by making some changes if redistributes the same how the buying thing protects that? How to achieve this protection? – Prachi Joshi Mar 07 '18 at 12:28
  • @Laiv Wat? What are all these magical services and user experience things that you speak of that apparently all products have by default and are completely separate from the actual software or hardware? And also, maybe address the fact that it's trivial to make a copy if you have a complete piece of software, but not so trivial to make a copy of a complete piece of hardware? – 8bittree Mar 08 '18 at 18:07
  • You only have a copy of the client in a certain state and that's it. – Laiv Mar 08 '18 at 18:12
  • @PrachiJoshi Using HTML doesn't really make it easier for people to steal assets like images... because it isn't really very difficult to steal them in the first place. If it's on *their* computer, they can steal it. Try looking through installation directories for various apps and games. You'll probably find quite a few with "assets" or "images" folders full of plain pngs, jpegs, or other common, unobfuscated image formats. Obfuscating those won't block a screenshot. And screenshot-blocking software won't block a camera. – 8bittree Mar 08 '18 at 18:19
  • @Laiv So you're assuming that the game consists of more than just the client? – 8bittree Mar 08 '18 at 18:23
  • Yes. Maybe I'm biased by my job but yes, I assume there's a server side (hence de service I was refering to) – Laiv Mar 08 '18 at 19:46
  • @Laiv I'm curious what you might be assuming the server side of a single player game is doing, other than being an answer to this problem? (And, in turn creating another problem when the company decides they don't want to pay for the server any more.) – 8bittree Mar 08 '18 at 21:43
  • The question doesn't say whether the Game is single player. It also doesn't say who is selling the game. It only assume that html games can not be sold because the html and the js are accesible. And my point is that someone selling such a game doesn't care about that, because the game can be just the claim. The candy. Behind free to play games (html or not) there's a business really profitable based on selling services or better user experience. If I have assumed too much is because the question is fairly open. – Laiv Mar 08 '18 at 22:27

1 Answers1

8

The usual solution is to put part of your game logic on a server somewhere and have your game communicate with it using AJAX or similar.

In the server code you can check for license keys.

In short, the customer never has the whole code.

Dan Pichelman
  • 13,773
  • 8
  • 42
  • 73