Serve a game over ssh, with its accounts, its web endpoint and its beacon.
{:ok, server} = Cauldron2D.Drafter.Server.start(game: MyGame.Client, port: 2222, web: {:my_game, MyGame.Web.Endpoint, 2280})
Cauldron2D.Drafter.Server.stop(server)Players register on first connection as new@host (:register_as), or through
whatever login the game's web pages offer. Each account is given its own sound
port on the server — :sound_port for the first account, the next number for the
next, and so on — kept in its props as :pulse_port; the terminal client's audio
goes as raw PCM through the ssh -R <port>:127.0.0.1:4713 tunnel to a player
program on the player's machine. The arenas are the game's, registered with
Cauldron2D.Arenas before or after the server starts.
Options
:game— the module implementingCauldron2D.Client.Game. Required:port— the ssh port. Default2222:ip— what to bind, asDrafter.Server.start_ssh/2takes it. Default:any:accounts— the account file, or a runningDrafter.Accountsserver. DefaultCauldron2D.Paths.data(atlas, "accounts.terms"):accounts_name— a name for the accounts server it starts. Default none:sound_port— the first account's sound port,falsefor none. Default24713:system_dir— the ssh host key directory. Default: drafter's temporary keys:register_as— the name that registers. Default"new":mount_props— merged into every session's mount props. Default%{}:web—{otp_app, endpoint, port}: the game's Phoenix endpoint, started on every IPv4 interface at that port. Default: none:beacon— call on the local network withCauldron2D.Beacon. Defaulttrue:beacon_port— its port. DefaultCauldron2D.Beacon.port/0:node— name this VM so other nodes can join its worlds,falsefor none. Default<atlas>@<host>, when the VM is not already named
Returns {:ok, %{daemon, accounts, http, node, beacon}}; stop/1 stops what was
started, leaving the arenas registered.