]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - commands.cfg
Fix balancing with drop penalties; add assist points for previous carriers
[xonotic/xonotic-data.pk3dir.git] / commands.cfg
1 // =================================================================
2 //  Master config for managing various command aliases and settings
3 // =================================================================
4
5 // Execute commands based on whether it is dedicated a server or a client.
6 alias "_detect_dedicated_$qport" "${* asis}"
7 alias "_detect_dedicated_0" ""
8 alias _if_dedicated "_detect_dedicated_$qport ${* asis}"
9 alias if_client "${* asis}"
10 alias if_dedicated "${* asis}"
11 _if_dedicated alias if_client ""
12 if_client alias if_dedicated ""
13
14 if_dedicated "alias" qc_cmd_sv     "sv_cmd $$*"
15 if_client    "alias" qc_cmd_sv     "sv_cmd $$*"
16 // if_client    "alias" qc_cmd_sv     "echo This command only works on servers: sv_cmd $${* !}"
17 if_dedicated "alias" qc_cmd_cl     "echo This command only works on clients: cl_cmd $${* !}"
18 if_client    "alias" qc_cmd_cl     "cl_cmd $$*"
19 if_dedicated "alias" qc_cmd_cmd    "echo This command only works on clients: cmd $${* !}"
20 if_client    "alias" qc_cmd_cmd    "cmd $$*"
21
22 if_dedicated "alias" qc_cmd_svmenu "sv_cmd $$*"
23 if_client    "alias" qc_cmd_svmenu "menu_cmd $$*"
24 if_dedicated "alias" qc_cmd_svcl   "sv_cmd $$*"
25 if_client    "alias" qc_cmd_svcl   "cl_cmd $$*"
26 if_dedicated "alias" qc_cmd_svcmd  "sv_cmd $$*"
27 if_client    "alias" qc_cmd_svcmd  "cmd $$*"
28
29 if_dedicated "alias" help "sv_cmd help"
30 if_client    "alias" help "cl_cmd help; cmd help"
31
32
33 // ========
34 //  common
35 // ========
36 // networked/server common commands
37 alias cvar_changes         "qc_cmd_svcmd  cvar_changes         ${* ?}" // Prints a list of all changed server cvars
38 alias cvar_purechanges     "qc_cmd_svcmd  cvar_purechanges     ${* ?}" // Prints a list of all changed gameplay cvars
39 alias info                 "qc_cmd_svcmd  info                 ${* ?}" // Request for unique server information set up by admin
40 alias ladder               "qc_cmd_svcmd  ladder               ${* ?}" // Get information about top players if supported
41 alias lsmaps               "qc_cmd_svcmd  lsmaps               ${* ?}" // List maps which can be used with the current game mode
42 alias lsnewmaps            "qc_cmd_svcmd  lsnewmaps            ${* ?}" // List maps which have no records or are seemingly unplayed yet
43 alias printmaplist         "qc_cmd_svcmd  printmaplist         ${* ?}" // Display full server maplist reply
44 alias rankings             "qc_cmd_svcmd  rankings             ${* ?}" // Print information about rankings
45 alias records              "qc_cmd_svcmd  records              ${* ?}" // List top 10 records for the current map
46 alias teamstatus           "qc_cmd_svcmd  teamstatus           ${* ?}" // Show information about player and team scores
47 alias time                 "qc_cmd_svcmd  time                 ${* ?}" // Print different formats/readouts of time
48 alias timein               "qc_cmd_svcmd  timein               ${* ?}" // Resume the game from being paused with a timeout
49 alias timeout              "qc_cmd_svcmd  timeout              ${* ?}" // Call a timeout which pauses the game for certain amount of time unless unpaused
50 alias vote                 "qc_cmd_svcmd  vote                 ${* ?}" // Request an action to be voted upon by players
51 alias who                  "qc_cmd_svcmd  who                  ${* ?}" // Display detailed client information about all players
52
53 // generic commands (across all programs)
54 alias addtolist            "qc_cmd_svmenu addtolist            ${* ?}" // Add a string to a cvar
55 alias qc_curl              "qc_cmd_svmenu curl                 ${* ?}" // curl requests
56 alias dumpcommands         "qc_cmd_svmenu dumpcommands         ${* ?}" // Dump all commands on the program to *_cmd_dump.txt
57 alias maplist              "qc_cmd_svmenu maplist              ${* ?}" // Automatic control of maplist
58 alias nextframe            "qc_cmd_svmenu nextframe            ${* ?}" // do something next frame
59 alias removefromlist       "qc_cmd_svmenu removefromlist       ${* ?}" // Remove a string from a cvar
60 alias rpn                  "qc_cmd_svmenu rpn                  ${* ?}" // RPN calculator
61 //alias settemp            "qc_cmd_svmenu settemp              ${* ?}" // Temporarily set a value to a cvar which is restored later
62 //alias settemp_restore    "qc_cmd_svmenu settemp_restore      ${* ?}" // Restore all cvars set by settemp command
63
64 // other aliases for common commands
65 alias g_hitplots_add "qc_cmd_svmenu rpn /g_hitplots_individuals g_hitplots_individuals ${1 !} union def"
66 alias g_hitplots_remove "qc_cmd_svmenu rpn /g_hitplots_individuals g_hitplots_individuals ${1 !} difference def"
67
68 alias g_maplist_add     "qc_cmd_svmenu maplist add ${* ?}"
69 alias g_maplist_remove  "qc_cmd_svmenu maplist remove ${* ?}"
70 alias g_maplist_putfirst        "qc_cmd_svmenu maplist remove ${* ?} ; qc_cmd maplist add ${* ?}"
71 alias g_maplist_shufflenow      "qc_cmd_svmenu maplist shuffle"
72 alias g_maplist_cleanup "qc_cmd_svmenu maplist cleanup" // removes maps that don't exist from the map list
73
74 alias addfav "qc_cmd_svmenu addtolist net_slist_favorites ${* ?}"
75 alias addvote "qc_cmd_svmenu addtolist sv_vote_commands ${* ?}"
76
77
78 // ========================
79 //  engine command aliases
80 // ========================
81 alias bsp "ls maps/*.bsp"
82 alias chmap "changelevel ${* ?}"
83 alias clearmap "disconnect"
84 alias ply "playdemo $1"
85 alias rec "record demos/${1 !}"
86 alias search "apropos ${* ?}"
87 alias sv_loadconfig "exec $serverconfig"
88 alias sv_restart "say \"Server will restart at the end of the match, you will all be reconnected automatically. ${* ?} \"; quit_and_redirect self"
89 alias tdem "timedemo $1"
90
91
92 // ===============================================
93 //  menu_cmd (menu command) - menu/command/menu_cmd.qc
94 // ===============================================
95 alias menu_showteamselect "menu_cmd directmenu TeamSelect"
96 alias menu_showhudexit "menu_cmd directmenu HUDExit"
97 alias menu_showhudoptions "menu_cmd directpanelhudmenu ${* ?}"
98 alias menu_showsandboxtools "menu_cmd directmenu SandboxTools"
99 alias menu_showquitdialog "menu_cmd directmenu Quit"
100
101 // command executed before loading a map by the menu
102 // makes sure maxplayers is at least minplayers or bot_number + 1
103 alias _menu_loadmap_prepare_maxpl "maxplayers $_menu_loadmap_maxplayers"
104 alias menu_loadmap_prepare "disconnect; wait; g_campaign 0; menu_cmd rpn /_menu_loadmap_maxplayers menu_maxplayers minplayers bot_number 1 add max max def; _menu_loadmap_prepare_maxpl; g_maplist_shufflenow"
105
106
107 // ==========================================================
108 //  cl_cmd (client local command) - client/command/cl_cmd.qc
109 // ==========================================================
110 // commented out commands are really only intended for internal use
111 alias blurtest             "qc_cmd_cl     blurtest             ${* ?}" // Feature for testing blur postprocessing
112 alias create_scrshot_ent   "qc_cmd_cl     create_scrshot_ent   ${* ?}" // Create an entity at this location for automatic screenshots
113 alias debugmodel           "qc_cmd_cl     debugmodel           ${* ?}" // Spawn a debug model manually
114 //alias handlevote         "qc_cmd_cl     handlevote           ${* ?}" // System to handle selecting a vote or option
115 alias hud                  "qc_cmd_cl     hud                  ${* ?}" // Commands regarding/controlling the HUD system
116 alias localprint           "qc_cmd_cl     localprint           ${* ?}" // Create your own centerprint sent to yourself
117 //alias mv_download        "qc_cmd_cl     mv_download          ${* ?}" // Retrieve mapshot picture from the server
118 alias sendcvar             "qc_cmd_cl     sendcvar             ${* ?}" // Send a cvar to the server (like weaponpriority)
119 //alias vyes               "qc_cmd_cl     vyes                 ${* ?}" // COMPATIBILITY COMMAND FOR 0.5 CLIENTS
120 //alias vno                "qc_cmd_cl     vno                  ${* ?}" // COMPATIBILITY COMMAND FOR 0.5 CLIENTS
121
122 // other aliases for local commands
123 alias hud_configure "qc_cmd_cl hud configure"
124 alias hud_save "qc_cmd_cl hud save ${* ?}"
125 alias radar "qc_cmd_cl hud radar ${* ?}"
126 alias scoreboard_columns_help "qc_cmd_cl hud scoreboard_columns_help"
127 alias scoreboard_columns_set "qc_cmd_cl hud scoreboard_columns_set ${* ?}"
128
129 // changes a cvar and reports it to the server (for the client to notify the server about changes)
130 alias setreport "set \"$1\" \"$2\" ; sendcvar \"$1\""
131
132
133 // ========================================================
134 //  cmd (client-to-server command) - server/command/cmd.qc
135 // ========================================================
136 set sv_clientcommand_antispam_time 1 "Amount of seconds after a command before another command can be called again without being considered spam. (Use -1 for no antispam limit)"
137 set sv_clientcommand_antispam_count 8 "Amount of commands considered spam before commands are rejected."
138 seta sv_status_privacy 1 "hide IP addresses from \"status\" and \"who\" replies shown to clients"
139 seta cl_autoswitch 1 "automatically switch to newly picked up weapons if they are better than what you are carrying"
140
141 // commented out commands are really only intended for internal use, or already have declaration in the engine
142 alias autoswitch           "qc_cmd_cmd    autoswitch           ${* ?}" // Whether or not to switch automatically when getting a better weapon
143 alias checkfail            "qc_cmd_cmd    checkfail            ${* ?}" // Report if a client-side check failed
144 alias clientversion        "qc_cmd_cmd    clientversion        ${* ?}" // Release version of the game
145 //alias mv_getpicture      "qc_cmd_cmd    mv_getpicture        ${* ?}" // Retrieve mapshot picture from the server
146 alias join                 "qc_cmd_cmd    join                 ${* ?}" // Become a player in the game
147 alias ready                "qc_cmd_cmd    ready                ${* ?}" // Qualify as ready to end warmup stage (or restart server if allowed)
148 alias reportcvar           "qc_cmd_cmd    reportcvar           ${* ?}" // Old system for sending a client cvar to the server
149 //alias say                "qc_cmd_cmd    say                  ${* ?}" // Print a message to chat to all players
150 //alias say_team           "qc_cmd_cmd    say_team             ${* ?}" // Print a message to chat to all team mates
151 alias selectteam           "qc_cmd_cmd    selectteam           ${* ?}" // Attempt to choose a team to join into
152 alias selfstuff            "qc_cmd_cmd    selfstuff            ${* ?}" // Stuffcmd a command to your own client
153 alias sentcvar             "qc_cmd_cmd    sentcvar             ${* ?}" // New system for sending a client cvar to the server
154 alias spectate             "qc_cmd_cmd    spectate             ${* ?}" // Become an observer
155 alias suggestmap           "qc_cmd_cmd    suggestmap           ${* ?}" // Suggest a map to the mapvote at match end
156 //alias tell               "qc_cmd_cmd    tell                 ${* ?}" // Send a message directly to a player
157 alias voice                "qc_cmd_cmd    voice                ${* ?}" // Send voice message via sound
158
159 // other aliases for client-to-server commands
160 alias autoswitch "set cl_autoswitch ${1 ?} ; cmd autoswitch ${1 ?}" // todo
161
162 alias team_red "cmd selectteam red; cmd join"
163 alias team_blue "cmd selectteam blue; cmd join"
164 alias team_pink "cmd selectteam pink; cmd join"
165 alias team_yellow "cmd selectteam yellow; cmd join"
166 alias team_auto "cmd selectteam auto; cmd join"
167
168 alias spec "spectate"
169
170 // mutator aliases
171 alias sandbox "cmd g_sandbox ${* ?}"
172
173
174 // ============================================================
175 //  sv_cmd (server console command) - server/command/sv_cmd.qc
176 // ============================================================
177 alias adminmsg             "qc_cmd_sv     adminmsg             ${* ?}" // Send an admin message to a client directly
178 alias allready             "qc_cmd_sv     allready             ${* ?}" // Restart the server and reset the players
179 alias allspec              "qc_cmd_sv     allspec              ${* ?}" // Force all players to spectate
180 alias anticheat            "qc_cmd_sv     anticheat            ${* ?}" // Create an anticheat report for a client
181 alias bbox                 "qc_cmd_sv     bbox                 ${* ?}" // Print detailed information about world size
182 alias bot_cmd              "qc_cmd_sv     bot_cmd              ${* ?}" // Control and send commands to bots
183 alias cointoss             "qc_cmd_sv     cointoss             ${* ?}" // Flip a virtual coin and give random result
184 alias database             "qc_cmd_sv     database             ${* ?}" // Extra controls of the serverprogs database
185 alias defer_clear          "qc_cmd_sv     defer_clear          ${* ?}" // Clear all queued defer commands for a specific client
186 alias defer_clear_all      "qc_cmd_sv     defer_clear_all      ${* ?}" // Clear all queued defer commands for all clients
187 alias delrec               "qc_cmd_sv     delrec               ${* ?}" // Delete race time record for a map
188 alias effectindexdump      "qc_cmd_sv     effectindexdump      ${* ?}" // Dump list of effects from code and effectinfo.txt
189 alias extendmatchtime      "qc_cmd_sv     extendmatchtime      ${* ?}" // Increase the timelimit value incrementally
190 alias find                 "qc_cmd_sv     find                 ${* ?}" // Search through entities for matching classname
191 alias gametype             "qc_cmd_sv     gametype             ${* ?}" // Simple command to change the active gametype
192 alias gettaginfo           "qc_cmd_sv     gettaginfo           ${* ?}" // Get specific information about a weapon model
193 alias gotomap              "qc_cmd_sv     gotomap              ${* ?}" // Simple command to switch to another map
194 alias lockteams            "qc_cmd_sv     lockteams            ${* ?}" // Disable the ability for players to switch or enter teams
195 alias make_mapinfo         "qc_cmd_sv     make_mapinfo         ${* ?}" // Automatically rebuild mapinfo files
196 alias moveplayer           "qc_cmd_sv     moveplayer           ${* ?}" // Change the team/status of a player
197 alias nospectators         "qc_cmd_sv     nospectators         ${* ?}" // Automatically remove spectators from a match
198 alias playerdemo           "qc_cmd_sv     playerdemo           ${* ?}" // Control the ability to save demos of players
199 alias printstats           "qc_cmd_sv     printstats           ${* ?}" // Dump eventlog player stats and other score information
200 alias radarmap             "qc_cmd_sv     radarmap             ${* ?}" // Generate a radar image of the map
201 alias reducematchtime      "qc_cmd_sv     reducematchtime      ${* ?}" // Decrease the timelimit value incrementally
202 alias setbots              "qc_cmd_sv     setbots              ${* ?}" // Adjust how many bots are in the match
203 alias shuffleteams         "qc_cmd_sv     shuffleteams         ${* ?}" // Randomly move players to different teams
204 alias stuffto              "qc_cmd_sv     stuffto              ${* ?}" // Send a command to be executed on a client
205 alias trace                "qc_cmd_sv     trace                ${* ?}" // Various debugging tools with tracing
206 alias unlockteams          "qc_cmd_sv     unlockteams          ${* ?}" // Enable the ability for players to switch or enter teams
207 alias warp                 "qc_cmd_sv     warp                 ${* ?}" // Choose different level in campaign
208
209 // other aliases for server commands
210 alias endmatch "timelimit -1"
211
212 alias savedb "sv_cmd database save \"${1 ?}\""
213 alias dumpdb "sv_cmd database dump \"${1 ?}\""
214 alias loaddb "sv_cmd database load \"${1 ?}\""
215
216 alias movetored "moveplayer ${1 ?} red"
217 alias movetoblue "moveplayer ${1 ?} blue"
218 alias movetopink "moveplayer ${1 ?} pink"
219 alias movetoyellow "moveplayer ${1 ?} yellow"
220 alias movetoauto "moveplayer ${1 ?} auto"
221
222
223 // =======================================================
224 //  Aliases for settemp subsystem. Warning: Do not touch. 
225 //  Usage: settemp variable value, next map resets it.
226 // =======================================================
227 alias settemp "qc_cmd_svcl settemp $*"
228 alias settemp_restore "qc_cmd_svcl settemp_restore"
229
230
231 // ===================================
232 //  banning - server/command/ipban.qc
233 // ===================================
234 alias ban                  "qc_cmd_sv     ban                  ${* ?}" // Ban an IP address or a range of addresses (like 1.2.3)
235 alias banlist              "qc_cmd_sv     banlist              ${* ?}" // List all existing bans
236 alias bans                 "qc_cmd_sv     bans                 ${* ?}" // COMPATIBILITY COMMAND FOR 0.5 CLIENTS
237 alias kickban              "qc_cmd_sv     kickban              ${* ?}" // Disconnect a client and ban it at the same time
238 alias unban                "qc_cmd_sv     unban                ${* ?}" // Remove an existing ban
239
240 // other aliases for ban commands
241 alias bans "banlist"
242
243 // character classes (intersected with 32..126 minus ", $, ;, ^, \ - if you
244 // want these, include them explicitly)
245 // note that QC code always forbids $ and ; in VoteCommand_checknasty
246 set _iscntrl ""
247 set _isblank " "
248 set _ispunct "!#%&'()*+,-./:<=>?@[]_`{|}~"
249 set _isdigit "0123456789"
250 set _isupper "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
251 set _islower "abcdefghijklmnopqrstuvwxyz"
252 set _isxdigit "0123456789abcdefABCDEF"
253
254 // derived character classes
255 set _isalpha "$_isupper$_islower"
256 set _isalnum "$_isalpha$_isdigit"
257 set _isgraph "$_ispunct$_isalnum"
258 set _isascii "$_isgraph$_isblank"
259 set _isprint "$_isgraph$_isblank"
260 set _isspace "$_isblank"
261
262 // restriction is specified as <minargs> followed by <maxargs> instances of ';'
263 // and the optional character class to verify the argument by (no checking if
264 // empty)
265 // set cvar to empty string to not check the command at all
266 // if cvar is not set there will be a warning
267 set sv_vote_command_restriction_restart "0"
268 set sv_vote_command_restriction_fraglimit "1;$_isdigit"
269 set sv_vote_command_restriction_chmap "1;$_isgraph"
270 set sv_vote_command_restriction_gotomap "1;$_isgraph"
271 set sv_vote_command_restriction_nextmap "1;$_isgraph"
272 set sv_vote_command_restriction_endmatch "0"
273 set sv_vote_command_restriction_reducematchtime "0"
274 set sv_vote_command_restriction_extendmatchtime "0"
275 set sv_vote_command_restriction_allready "0"
276 set sv_vote_command_restriction_kick "1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;" // enough space for ban reason
277 set sv_vote_command_restriction_kickban "1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;" // enough space for ban reason
278 set sv_vote_command_restriction_cointoss "0"
279 set sv_vote_command_restriction_movetoauto "1;"
280 set sv_vote_command_restriction_movetored "1;"
281 set sv_vote_command_restriction_movetoblue "1;"
282 set sv_vote_command_restriction_movetoyellow "1;"
283 set sv_vote_command_restriction_movetopink "1;"
284
285 // =================================
286 //  voting - server/command/vote.qc
287 // =================================
288 set sv_vote_call 1 "Allow users to call a vote for the commands in sv_vote_commands"
289 set sv_vote_change 1 "Allow voters to change their mind after already voting"
290 set sv_vote_commands "restart fraglimit chmap gotomap nextmap endmatch reducematchtime extendmatchtime allready kick cointoss movetoauto" "these commands can be voted"
291 set sv_vote_only_commands ""
292 set sv_vote_master_commands "movetored movetoblue movetoyellow movetopink" "Extra commands which vote masters can execute by themselves, along with the normal sv_vote_commands." // maybe add kickban here (but then sv_vote_master 0)
293 set sv_vote_master 1    "Allows the use of the vote master system"
294 set sv_vote_master_callable 1 "When set, users can use \"vmaster\" to call a vote to become master of voting commands"
295 set sv_vote_master_password "" "when set, users can use \"vlogin PASSWORD\" to log in as master"
296 set sv_vote_master_playerlimit 2 "Minimum number of players needed for a player to be allowed to vote for master"
297 set sv_vote_no_stops_vote 1 "Allow the vote caller to stop his own vote simply by voting no"
298 set sv_vote_singlecount 0       "set to 1 to count votes once after timeout or to 0 to count with every vote"
299 set sv_vote_timeout 30  "a vote will timeout after this many seconds"
300 set sv_vote_wait 120    "a player can not call a vote again for this many seconds when his vote was not accepted"
301 set sv_vote_stop 15     "a player can not call a vote again for this many seconds when he stopped this vote (e.g. to correct it)"
302 set sv_vote_majority_factor 0.5 "What percentage of the PLAYERS constitute a majority? (Must be at least 0.5, recommended: 0.5)"
303 set sv_vote_majority_factor_of_voted 0.5 "What percentage of the VOTERS constitute a majority too? (Must be at least 0.5, recommended: 0.5)"
304 // when disabled, don't allow game type changes "note: set these two equal to JUST support simple majorities"
305 set sv_vote_override_mostrecent 0
306
307 // aliases for client only
308 alias vmaster   "qc_cmd_cmd vote master"
309 alias vlogin    "qc_cmd_cmd vote master login ${* ?}"
310 alias vdo       "qc_cmd_cmd vote master do ${* ?}"
311 alias vyes      "qc_cmd_cl handlevote yes; cl_cmd vyes" // NOTE: COMPATIBILITY FOR 0.5 IS ADDED HERE WITH "VYES", REMOVE LATER
312 alias vno       "qc_cmd_cl handlevote no; cl_cmd vno" // ^^^ same, see above
313 alias vdontcare "qc_cmd_cmd vote abstain"
314 alias vabstain  "qc_cmd_cmd vote abstain"
315
316 // aliases for both client and server
317 alias vcall     "qc_cmd_svcmd vote call ${* ?}"
318 alias vhelp     "qc_cmd_svcmd vote help"
319 alias vstatus   "qc_cmd_svcmd vote status"
320 alias vstop     "qc_cmd_svcmd vote stop"
321
322 // general
323 alias vmap "vcall gotomap ${1 ?}"
324 alias vnextmap "vcall nextmap ${1 ?}"
325 alias vkick "vcall kick ${1 ?}"
326 alias vkickban "vcall kickban ${1 ?}"
327 alias vend "vcall endmatch"
328 alias vdomap "vdo gotomap ${1 ?}"
329 alias vdokick "vdo kick ${* ?}"
330 alias vdokickban "vdo kickban ${* ?}"
331 alias vdoend "vdo endmatch"
332
333 // ======================
334 //  rcon server commands
335 // ======================
336 rcon_secure 1
337 set rcon_restricted_commands "restart fraglimit chmap gotomap endmatch reducematchtime extendmatchtime allready kick kickban \"sv_cmd bans\" \"sv_cmd unban *\" status \"sv_cmd teamstatus\" movetoauto movetored movetoblue movetoyellow movetopink"