The console's commands about console variables, run on the host's
QuakeServer.Cvars table as FTE's cmd.c and cvar.c run them.
set name value,seta,set_tp— make the variable when there is none and set it (setaalso archives it). The value is the rest of the line; a single quoted value may be followed by// description, and an unquoted one is cut at//, the rest its description. A variable made this way takes the description.setfl name value flags [description]—flagslettersa(archive),u(user info),s(server info); any other letter does nothing.toggle name [value [other]]— between 0 and 1, orvalueandother(default the variable's default); a variable not there is made at 0inc name [amount]— addamount(default 1)name— print the value, its default and any latched value;name valuesets itcvarreset [-a] [-g group] pattern— set back to their defaultscvar_lockdefaults,cvar_purgedefaults,cvar_resettodefaults_all,cvar_resettodefaults_saveonly,cvar_resettodefaults_nosaveonlyvid_reload,vid_restart— latched renderer and video variables take effect
Commands from the server (from: :server, FTE's commands from game code) cannot set
:notfromserver variables; set then reads the flags as setfl does, and a value
the server sets takes the variable over (QuakeServer.Cvars.lock_from_server/3)
unless it is the default.
Summary
Functions
Run a command naming variable cvar: with no value print it, as FTE's Cvar_Command
prints, otherwise set it to the value (the one word, or the rest of the line).
Run one of the commands that move every variable's default (cvar_lockdefaults and the like).
Run inc name [amount].
Run vid_reload or vid_restart: latched renderer and video variables take their latched values.
Run cvarreset with its words.
The raw text of line from token index on, as FTE's Cmd_Args after that many words.
Run set, seta, set_tp or setfl (command) with the line's tokens.
Run toggle name [value [other]].
Types
@type from() :: :local | :server
@type tokens() :: [{String.t(), non_neg_integer(), non_neg_integer()}]
Functions
@spec command( QuakeServer.Server.t(), QuakeServer.Cvars.Cvar.t(), tokens(), String.t(), from() ) :: QuakeServer.Server.t()
Run a command naming variable cvar: with no value print it, as FTE's Cvar_Command
prints, otherwise set it to the value (the one word, or the rest of the line).
@spec defaults(QuakeServer.Server.t(), String.t()) :: QuakeServer.Server.t()
Run one of the commands that move every variable's default (cvar_lockdefaults and the like).
@spec inc(QuakeServer.Server.t(), [String.t()], from()) :: QuakeServer.Server.t()
Run inc name [amount].
@spec renderer(QuakeServer.Server.t()) :: QuakeServer.Server.t()
Run vid_reload or vid_restart: latched renderer and video variables take their latched values.
@spec reset(QuakeServer.Server.t(), [String.t()]) :: QuakeServer.Server.t()
Run cvarreset with its words.
@spec rest(String.t(), tokens(), non_neg_integer()) :: String.t()
The raw text of line from token index on, as FTE's Cmd_Args after that many words.
@spec set(QuakeServer.Server.t(), String.t(), tokens(), String.t(), from()) :: QuakeServer.Server.t()
Run set, seta, set_tp or setfl (command) with the line's tokens.
@spec toggle(QuakeServer.Server.t(), [String.t()]) :: QuakeServer.Server.t()
Run toggle name [value [other]].