The console: the commands a program queues with localcmd, the lines of the
configuration files they exec, and commands typed or sent to it, run against the
host's QuakeServer.Cvars table as FTE's console runs them.
server = QuakeServer.Console.run(server, "exec default.cfg; set skill 2")
server = QuakeServer.Console.flush(server)Text splits into commands at newlines and at ; outside quotes and outside a //
comment; a comment runs to the end of its line and stays with its command (set reads
a description from it). A command's first word is looked up as FTE looks it up: the
console's own commands, then aliases, then console variables, then the program.
The console's own commands:
- the variable commands of
QuakeServer.Console.Variables:set,seta,set_tp,setfl,toggle,inc,cvarreset,cvar_lockdefaults,cvar_purgedefaults,cvar_resettodefaults_all,cvar_resettodefaults_saveonly,cvar_resettodefaults_nosaveonly,vid_reload,vid_restart exec file,cfg_save [name],cfg_save_ifmodified(QuakeServer.Console.Configs)alias name commands— kept in the table, so every holder of it shares them; an alias runs its commands before the rest, with the command's arguments after a one-word alias that names a variable or commandserverinfo key value(a variable of that name is set too),localinfo key value,setinfo key value(the player's; a:userinfovariable of that name is set instead),setinfoblob key file(assetinfo, the value the file's bytes;pmodelandemodelignored,*keys refused)- the key binding commands of
QuakeServer.Console.Bindings:bind,in_bind,bindlevel,unbind,unbindall setpos [x y z [pitch yaw roll]]andnoclip(QuakeServer.Cheats)echo text,sky name(kept inext.sky),wait(the rest waits for the nextflush/1),map name,changelevel name [startspot]watchpoint,watchpoint_ssqc,watchpoint_csqcandwatchpoint_menuqcwith a term (a global, orentity.fieldwith the entity a number or an entity global): the term is kept inext.watchpointand answeredWatchpoint set, orWatchpoint clearedwith no term or one that names nothing; changes to what it names are not reported
A variable's name alone prints it; with a value it sets it
(QuakeServer.Console.Variables.command/5). Any other command goes to the program's
ConsoleCmd(string), or a client program's CSQC_ConsoleCommand(string), when it has
one, or a menu program's m_consolecommand(string) (a command the menu registered
with registercommand counts as taken whatever it returns); ConsoleCmd runs as
FTE's server runs it, with self the world and time the
server's, self put back afterwards. A command nothing takes is reported as unknown
while cl_warncmd (or developer) is set, as FTE reports it. One run expands at most
4096 aliases and execs; past that the commands they would add are dropped.
Summary
Functions
Whether name is one of the console's own commands.
The commands of text, split at newlines and at ; outside quotes and outside a
// comment, each trimmed, blank ones dropped; a comment stays with its command.
Run the commands localcmd queued since the last flush.
Run text as console commands now. Option from: :server runs them as commands the
server sent (FTE's commands from game code), which may not set :notfromserver
variables and take over the variables they set.
Functions
Whether name is one of the console's own commands.
The commands of text, split at newlines and at ; outside quotes and outside a
// comment, each trimmed, blank ones dropped; a comment stays with its command.
@spec flush(QuakeServer.Server.t()) :: QuakeServer.Server.t()
Run the commands localcmd queued since the last flush.
@spec run(QuakeServer.Server.t(), String.t(), keyword()) :: QuakeServer.Server.t()
Run text as console commands now. Option from: :server runs them as commands the
server sent (FTE's commands from game code), which may not set :notfromserver
variables and take over the variables they set.