QuakeServer.Console.Variables (quake_server v0.1.0)

Copy Markdown View Source

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 (seta also 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] — flags letters a (archive), u (user info), s (server info); any other letter does nothing.
  • toggle name [value [other]] — between 0 and 1, or value and other (default the variable's default); a variable not there is made at 0
  • inc name [amount] — add amount (default 1)
  • name — print the value, its default and any latched value; name value sets it
  • cvarreset [-a] [-g group] pattern — set back to their defaults
  • cvar_lockdefaults, cvar_purgedefaults, cvar_resettodefaults_all, cvar_resettodefaults_saveonly, cvar_resettodefaults_nosaveonly
  • vid_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

from()

@type from() :: :local | :server

tokens()

@type tokens() :: [{String.t(), non_neg_integer(), non_neg_integer()}]

Functions

command(server, cvar, tokens, line, from)

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).

defaults(server, binary)

Run one of the commands that move every variable's default (cvar_lockdefaults and the like).

inc(server, words, from)

Run inc name [amount].

renderer(server)

Run vid_reload or vid_restart: latched renderer and video variables take their latched values.

reset(server, list)

Run cvarreset with its words.

rest(line, tokens, index)

@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.

set(server, command, tokens, line, from)

Run set, seta, set_tp or setfl (command) with the line's tokens.

toggle(server, list)

Run toggle name [value [other]].