The game hub for Commodore computers: the development hub, version 0.1.0
==========================================================================

gamehub, the hub that runs play.commodoreonline.com, in development mode:
a hub on your own computer for trying a game, with several players and a
game server, without the website. It keeps everything in memory and forgets
it when it stops.

The documentation is on the web:

  https://commodoreonline.com/docs/gamehub/getting-started/
  https://commodoreonline.com/docs/gamehub/game-servers/


Running it
----------

  gamehub -dev

It listens for Commodores on port 6502 (every address), and for game servers
on 127.0.0.1:6503 (TLS, with a certificate it makes for itself). Stop it with
Ctrl+C.

  - Any game id is a game: a live game for 2 to 8 players, relayed. Give a
    game other settings with -game (below).
  - Any token that isn't a real one is the handle: log in with ALICE and you
    are ALICE. HELLO,1,MYGAME,ALICE,A from a raw TCP client (nc, or PuTTY in
    raw mode) on port 6502 is a login.
  - Any server key is good, for a game that has none.

A Commodore in VICE on the same PC reaches it at 127.0.0.1:6502. A real
Commodore reaches it at the PC's address on the local network; the firewall
may have to let port 6502 in.


Registering games: -game
------------------------

  -game ID:MIN:MAX[:KIND[:MODE]]
      KIND is LIVE (the default) or TURNS. MODE is RELAY (the default), or
      OBSERVE or AUTHORITY for a game with a server.
  -game ID:MIN:MAX:WORLD[:INSTANCE[:PRESENCE]]
      A world, always with a server in authority mode. INSTANCE is SHARED
      (the default), PARTY or BOTH; PRESENCE is HUB (the default) or SERVER.

-game can be given as often as needed. For example:

  gamehub -dev -game TICTAC:2:2 -game CHESS:2:2:TURNS
  gamehub -dev -game GUESS:1:4:LIVE:AUTHORITY
  gamehub -dev -game MILL:2:4:WORLD:PARTY:SERVER


Game servers
------------

Point the server at localhost:6503 with the SDK's insecure setting (Go
Insecure, Python insecure=True, C++ cfg.insecure), since the certificate is
self-signed, and any key. With the Go SDK's examples, from the Go SDK's
folder:

  gamehub -dev -game GUESS:1:4:LIVE:AUTHORITY
  go run ./examples/guess -insecure

For a transport without TLS, such as the C++ SDK built without OpenSSL:

  gamehub -dev -plainservers 127.0.0.1:6504
  (and the server's plain setting, at 127.0.0.1:6504)


Other settings
--------------

  -addr ADDR             where Commodores connect (default :6502)
  -servers ADDR          the game servers' port, TLS (default 127.0.0.1:6503;
                         off for none)
  -cert FILE, -key FILE  a certificate and key for it, PEM, instead of the
                         self-signed one
  -plainservers ADDR     also game servers without TLS, on a loopback address
  -web ADDR              the browsers' WebSocket port, on a loopback address
                         (default off)
  -api ADDR              the local API (default 127.0.0.1:6580; off for none)
  -maxconns N            most connections at once (default 1000)
  -v                     log each connection
  -version               print the version


Notes
-----

  - macOS: the program isn't signed. If macOS refuses to open it, run
    xattr -d com.apple.quarantine gamehub in its folder.
  - Linux and macOS: if unzip lost the program's mode, chmod +x gamehub.
  - The same program has a service mode (-config), for running the real hub
    on MySQL. It isn't documented for authors.

gamehub is MIT licensed (LICENSE.txt). THIRD-PARTY-LICENSES.txt lists the
licenses of the code built into it.
