Prefix storage keys.
[webcart1000.git] / README.md
1 WEBCART1000 lets you make and play games that share the same save
2 files across several websites. It's inspired by [SHARECART1000], which
3 did the same thing for non-web games.
4
5 ## How do I use it?
6
7 If you're making a web-based game, just download `webcart1000.js` and
8 include it via a `<script>` tag in your own game. It's self-contained
9 and sets up all its own listeners.
10
11 Once you're including it, you can access the save data with
12 `webcart1000.data.Whatever` - `MapY`, `Switch2`, or any of the
13 [SHARECART1000 keys], with the same restrictions. (It may take a few
14 seconds after the page is done loading to load the save data.)
15
16 To save and synchronize the data, use `webcart10000.update()`. You can
17 also pass an object of changes, e.g. `webcart1000.update({ MapX: 12,
18 MapY: 13, Switch0: false })`. Running `update()` will also scrub the
19 data so if you put any non-standard keys or values in it, they'll be
20 deleted.
21
22 If someone's playing two WEBCART1000 games at the same time, the save
23 data is updated in real-time!
24
25 ## Is it safe? Is it private?
26
27 Yes.
28
29 ### For Players
30
31 There's no cookies. There's no server-mediated messages. Everything
32 WEBCART1000, aside from loading its own static JavaScript, stays on
33 your computer. It's as safe and private as the game would be
34 otherwise.
35
36 Loading the game leaves at most a default web server log entry - which
37 you've already triggered just by reading this page. Since no data is
38 collected, we don't even have to make a promise we won't share it with
39 anyone - but if we do accidentally collect some, we won't, and we'll
40 just delete it.
41
42 ### For Developers
43
44 The provided WEBCART1000 scripts take pains to scrub and normalize the
45 data as much as possible. But this is the web, and they're not served
46 over HTTPS, and people make mistakes. Take the kind of precautions
47 you'd always take in talking to a remote server.
48
49 The `webcart1000.js` script can be moved to your own server and loaded
50 from there. I recommend this - it'll be faster and stabler. The
51 `o_o.js` script and HTML can't be moved unless you're going to make
52 your own WEBCART1000 - which you can if you want, but it also kind of
53 defeats the point.
54
55 [SHARECART1000]: http://sharecart1000.com/
56 [SHARECART1000 keys]: http://sharecart1000.com/img/SHARECART1000guide.png