Where a server finds its game: the compiled QuakeC program, the maps and the model
files. A game names a module with these callbacks as QuakeServer.Server.start/2's
:source.
defmodule MyGame.Source do
@behaviour QuakeServer.Source
def progs, do: MyGame.Assets.progs()
def map(name), do: MyGame.Assets.map(name)
def model(name), do: MyGame.Assets.model(name)
end
Summary
Types
A map: its world and its entity text.
A model file: kind :alias, :sprite, :brush (with data a map_file/0) or
:missing, and its box.
Callbacks
Where game file name is found in the game's search order, as FTE's
COM_FDepthFile: lower is searched first; nil when there is no such file. The
console's exec compares default.cfg's depth with a config's.
The names of the game's files beginning with prefix, lower case.
The map name (without maps/ or .bsp), or nil when there is none.
The model file name.
The package game file name comes from, or nil when there is no such file.
The game's QuakeC program.
The bytes of game file name, or nil; the files the program's file builtins read.
The program's functions the game runs itself, by name: each runs in place of the
QuakeC function of that name (QuakeC.Progs.replace/2) as fun.(server, argc),
reading its arguments from the parameter slots and returning the server with any
return value in the return slots, as a builtin does. A name the program lacks is
passed over.
Types
@type map_file() :: %{bsp: Cauldron3D.Bsp.t(), entities: String.t()}
A map: its world and its entity text.
@type model() :: %{ kind: :alias | :sprite | :brush | :missing, data: term(), mins: Cauldron3D.Vec.t(), maxs: Cauldron3D.Vec.t() }
A model file: kind :alias, :sprite, :brush (with data a map_file/0) or
:missing, and its box.
Callbacks
Where game file name is found in the game's search order, as FTE's
COM_FDepthFile: lower is searched first; nil when there is no such file. The
console's exec compares default.cfg's depth with a config's.
The names of the game's files beginning with prefix, lower case.
The map name (without maps/ or .bsp), or nil when there is none.
The model file name.
The package game file name comes from, or nil when there is no such file.
@callback progs() :: QuakeC.Progs.t()
The game's QuakeC program.
The bytes of game file name, or nil; the files the program's file builtins read.
@callback replacements() :: %{ required(String.t()) => (QuakeServer.Server.t(), non_neg_integer() -> QuakeServer.Server.t()) }
The program's functions the game runs itself, by name: each runs in place of the
QuakeC function of that name (QuakeC.Progs.replace/2) as fun.(server, argc),
reading its arguments from the parameter slots and returning the server with any
return value in the return slots, as a builtin does. A name the program lacks is
passed over.