Serve ExPilot: its maps as arenas, over ssh and to browsers, through
Cauldron2D.Drafter.Server.
ExPilot.Server.start(port: 2222, maps: ["priv/maps/dogfight.map.gz"])Every map becomes an arena named after its file, its world starting on the first join
and stopping again after a while with nobody in it. The same worlds are served to
browsers by ExPilot.Web.Endpoint on the :http port. Players register on first
connection as new@host, or on the web's login page; each account gets its own sound
port, as Cauldron2D.Drafter.Server gives them. A started server names its VM and
calls on the local network so other clients' connect screens list it.
Options
:port— the ssh port. Default2222:ip— what to bind, asDrafter.Server.start_ssh/2takes it. Default:any:accounts— the account file. Default$XDG_DATA_HOME/expilot/accounts.terms, taking over anex_pilot_accounts.binin the working directory left by an older server:maps— map files to offer. Default: every file underpriv/maps:system_dir— the ssh host key directory. Default: drafter's temporary keys:robots— robots per arena. Default: each map'smaxrobots:http— the port of the web pages, on every IPv4 interface;falseor0for none. Default:PORTin the environment, else 2280:beacon,:beacon_port— asCauldron2D.Drafter.Servertakes them:music,:sfx— the browsers' and desktops' sound, asCauldron2D.Net.Audio.set/1takes them: music:personal(default),:arena,:dynamic,:staticor:off; effects:personal(default) or:off. With:staticthe songs ofExPilot.Music.Staticare rendered at 44 100 Hz stereo as the server starts, in the background, unless they are on disk from before, under$XDG_CACHE_HOME/expilot/music
Summary
Functions
The default account file, $XDG_DATA_HOME/expilot/accounts.terms (~/.local/share
without the variable). When it does not exist and legacy does — an
ex_pilot_accounts.bin in the working directory from an older server — its accounts
are read and written there as text first.
The map files shipped with the package.
The web port when none is given: PORT in the environment, else 2280.
This machine's name, as players are told to connect to it.
Register the arenas and start serving; see the module documentation for the options.
Stop what start/1 started, and the arenas' worlds; the arenas stay registered for the next start.
Types
Functions
The default account file, $XDG_DATA_HOME/expilot/accounts.terms (~/.local/share
without the variable). When it does not exist and legacy does — an
ex_pilot_accounts.bin in the working directory from an older server — its accounts
are read and written there as text first.
@spec bundled_maps() :: [Path.t()]
The map files shipped with the package.
@spec default_http() :: pos_integer()
The web port when none is given: PORT in the environment, else 2280.
@spec hostname() :: String.t()
This machine's name, as players are told to connect to it.
Register the arenas and start serving; see the module documentation for the options.
@spec stop(t()) :: :ok
Stop what start/1 started, and the arenas' worlds; the arenas stay registered for the next start.