]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - commands.cfg
22acccd88f9580f52b93c54579b7805bd664d1b3
[xonotic/xonotic-data.pk3dir.git] / commands.cfg
1 // =================================================================
2 //  Master config for managing various command aliases and settings
3 // =================================================================
4
5 // This alias allows for common commands to be executed, even on both
6 // dedicated servers and normal clients. If dedicated, then it remains
7 // as sv_cmd... If a normal client, then it is changed to menu_cmd.
8 alias qc_cmd "sv_cmd $*" 
9
10 // Execute commands based on whether it is dedicated a server or a client.
11 alias "_detect_dedicated_$qport" "${* asis}"
12 alias "_detect_dedicated_0" ""
13 alias _if_dedicated "_detect_dedicated_$qport ${* asis}"
14 alias if_client "${* asis}"
15 alias if_dedicated "${* asis}"
16 _if_dedicated alias if_client ""
17 if_client alias if_dedicated ""
18
19 if_client set cmd_prefix "cmd"
20 if_dedicated set cmd_prefix "sv_cmd"
21
22
23 // ========
24 //  common
25 // ========
26 alias cvar_changes "${cmd_prefix !} cvar_changes"
27 alias cvar_purechanges "${cmd_prefix !} cvar_purechanges"
28 alias info "${cmd_prefix !} info ${* ?}"
29 alias ladder "${cmd_prefix !} ladder"
30 alias lsmaps "${cmd_prefix !} lsmaps"
31 alias lsnewmaps "${cmd_prefix !} lsnewmaps"
32 alias maplist "${cmd_prefix !} maplist"
33 alias rankings "${cmd_prefix !} rankings"
34 alias records "${cmd_prefix !} records"
35 alias teamstatus "${cmd_prefix !} teamstatus"
36 alias time "${cmd_prefix !} time"
37 alias timein "${cmd_prefix !} timein"
38 alias timeout "${cmd_prefix !} timeout"
39 alias vote "${cmd_prefix !} vote ${* ?}"
40 alias who "${cmd_prefix !} who ${* ?}"
41
42 alias g_hitplots_add "qc_cmd rpn /g_hitplots_individuals g_hitplots_individuals ${1 !} union def"
43 alias g_hitplots_remove "qc_cmd rpn /g_hitplots_individuals g_hitplots_individuals ${1 !} difference def"
44
45 alias g_maplist_add     "qc_cmd maplist add ${* ?}"
46 alias g_maplist_remove  "qc_cmd maplist remove ${* ?}"
47 alias g_maplist_putfirst        "qc_cmd maplist remove ${* ?} ; qc_cmd maplist add ${* ?}"
48 alias g_maplist_shufflenow      "qc_cmd maplist shuffle"
49 alias g_maplist_cleanup "qc_cmd maplist cleanup" // removes maps that don't exist from the map list
50
51 alias addfav "qc_cmd addtolist net_slist_favorites ${* ?}"
52 alias addvote "qc_cmd addtolist sv_vote_commands ${* ?}"
53
54
55 // ========================
56 //  engine command aliases
57 // ========================
58 alias bsp "ls maps/*.bsp"
59 alias chmap "changelevel ${* ?}"
60 alias clearmap "disconnect"
61 alias ply "playdemo $1"
62 alias rec "record demos/${1 !}"
63 alias sv_loadconfig "exec $serverconfig"
64 alias sv_restart "say \"Server will restart at the end of the match, you will all be reconnected automatically. ${* ?} \"; quit_and_redirect self"
65 alias tdem "timedemo $1"
66
67
68 // ===============================================
69 //  menu_cmd (menu command) - menu/command/menu_cmd.qc
70 // ===============================================
71 alias menu_showteamselect "menu_cmd directmenu TeamSelect"
72 alias menu_showhudexit "menu_cmd directmenu HUDExit"
73 alias menu_showhudoptions "menu_cmd directpanelhudmenu ${* ?}"
74 alias menu_showsandboxtools "menu_cmd directmenu SandboxTools"
75 alias menu_showquitdialog "menu_cmd directmenu Quit"
76
77 // command executed before loading a map by the menu
78 // makes sure maxplayers is at least minplayers or bot_number + 1
79 alias _menu_loadmap_prepare_maxpl "maxplayers $_menu_loadmap_maxplayers"
80 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"
81
82
83 // ==========================================================
84 //  cl_cmd (client local command) - client/command/cl_cmd.qc
85 // ==========================================================
86 // commented out commands are really only intended for internal use
87 if_client alias blurtest "cl_cmd blurtest"
88 if_client alias debugmodel "cl_cmd debugmodel ${* ?}"
89 //if_client alias handlevote "cl_cmd handlevote ${* ?}"
90 if_client alias hud "cl_cmd hud ${* ?}"
91 if_client alias localprint "cl_cmd localprint ${* ?}"
92 //if_client alias mv_download "cl_cmd mv_download ${* ?}"
93 if_client alias sendcvar "cl_cmd sendcvar ${* ?}"
94 //if_client alias settemp "cl_cmd settemp ${* ?}"
95
96 // other aliases for local commands
97 if_client alias hud_configure "cl_cmd hud configure"
98 if_client alias hud_save "cl_cmd hud save ${* ?}"
99 if_client alias radar "cl_cmd hud radar ${* ?}"
100 if_client alias scoreboard_columns_help "cl_cmd hud scoreboard_columns_help"
101 if_client alias scoreboard_columns_set "cl_cmd hud scoreboard_columns_set ${* ?}"
102
103 // changes a cvar and reports it to the server (for the client to notify the server about changes)
104 alias setreport "set \"$1\" \"$2\" ; sendcvar \"$1\""
105
106
107 // ========================================================
108 //  cmd (client-to-server command) - server/command/cmd.qc
109 // ========================================================
110 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)"
111 set sv_clientcommand_antispam_count 8 "Amount of commands considered spam before commands are rejected."
112 seta sv_status_privacy 1 "hide IP addresses from \"status\" and \"who\" replies shown to clients"
113 seta cl_autoswitch 1 "automatically switch to newly picked up weapons if they are better than what you are carrying"
114
115 // commented out commands are really only intended for internal use, or already have declaration in the engine
116 alias autoswitch "cmd autoswitch ${* ?}"
117 alias checkfail "cmd checkfail ${* ?}"
118 alias clientversion "cmd clientversion ${* ?}"
119 //alias getmapvotepic "cmd getmapvotepic ${* ?}"
120 alias join "cmd join"
121 alias ready "cmd ready"
122 alias records "cmd records"
123 alias reportcvar "cmd reportcvar ${* ?}"
124 //alias say "cmd say ${* ?}" // engine already has this declared as a command
125 //alias say_team "cmd say_team ${* ?}" // engine already has this declared as a command
126 alias selectteam "cmd selectteam ${* ?}"
127 alias sentcvar "cmd sentcvar ${* ?}"
128 alias spectate "cmd spectate"
129 alias suggestmap "cmd suggestmap ${* ?}"
130 //alias tell "cmd tell ${* ?}" // engine already has this declared as a command
131 alias voice "cmd voice ${* ?}"
132
133 // other aliases for client-to-server commands
134 alias autoswitch "set cl_autoswitch ${1 ?} ; cmd autoswitch ${1 ?}" // todo
135
136 alias team_red "cmd selectteam red; cmd join"
137 alias team_blue "cmd selectteam blue; cmd join"
138 alias team_pink "cmd selectteam pink; cmd join"
139 alias team_yellow "cmd selectteam yellow; cmd join"
140 alias team_auto "cmd selectteam auto; cmd join"
141
142 alias spec "spectate"
143
144 // mutator aliases
145 alias sandbox "cmd g_sandbox ${* ?}"
146
147
148 // ============================================================
149 //  sv_cmd (server console command) - server/command/sv_cmd.qc
150 // ============================================================
151 alias adminmsg "sv_cmd adminmsg ${* ?}"
152 alias allready "sv_cmd allready"
153 alias allspec "sv_cmd allspec ${* ?}"
154 alias anticheat "sv_cmd anticheat ${* ?}"
155 alias bbox "sv_cmd bbox"
156 alias bot_cmd "sv_cmd bot_cmd ${* ?}"
157 alias cointoss "sv_cmd cointoss ${* ?}"
158 alias database "sv_cmd database ${* ?}"
159 alias defer_clear "sv_cmd defer_clear ${* ?}"
160 alias defer_clear_all "sv_cmd defer_clear_all"
161 alias delrec "sv_cmd delrec ${* ?}"
162 alias effectindexdump "sv_cmd effectindexdump"
163 alias extendmatchtime "sv_cmd extendmatchtime"
164 alias find "sv_cmd find ${* ?}"
165 alias gametype "sv_cmd gametype ${* ?}"
166 alias gettaginfo "sv_cmd gettaginfo ${* ?}"
167 alias gotomap "sv_cmd gotomap ${* ?}"
168 alias lockteams "sv_cmd lockteams"
169 alias make_mapinfo "sv_cmd make_mapinfo"
170 alias modelbug "sv_cmd modelbug"
171 alias moveplayer "sv_cmd moveplayer ${* ?}"
172 alias nospectators "sv_cmd nospectators"
173 alias onslaught_updatelinks "sv_cmd onslaught_updatelinks"
174 alias playerdemo "sv_cmd playerdemo ${* ?}"
175 alias printstats "sv_cmd printstats"
176 alias radarmap "sv_cmd radarmap ${* ?}"
177 alias reducematchtime "sv_cmd reducematchtime"
178 alias setbots "sv_cmd setbots ${* ?}"
179 alias shuffleteams "sv_cmd shuffleteams"
180 alias stuffto "sv_cmd stuffto ${* ?}"
181 alias trace "sv_cmd trace ${* ?}"
182 alias unlockteams "sv_cmd unlockteams"
183 alias warp "sv_cmd warp ${* ?}"
184
185 // other aliases for server commands
186 alias endmatch "timelimit -1"
187
188 alias savedb "sv_cmd database save \"${1 ?}\""
189 alias dumpdb "sv_cmd database dump \"${1 ?}\""
190 alias loaddb "sv_cmd database load \"${1 ?}\""
191
192 alias movetored "moveplayer ${1 ?} red"
193 alias movetoblue "moveplayer ${1 ?} blue"
194 alias movetopink "moveplayer ${1 ?} pink"
195 alias movetoyellow "moveplayer ${1 ?} yellow"
196 alias movetoauto "moveplayer ${1 ?} auto"
197
198
199 // =======================================================
200 //  Aliases for settemp subsystem. Warning: Do not touch. 
201 //  Usage: settemp variable value, next map resets it.
202 // =======================================================
203 set settemp_list 0
204 set settemp_idx 0
205 set _settemp_var UNUSED
206 alias settemp "_settemp_var \"_settemp_x$settemp_idx\"; qc_cmd rpn /settemp_idx settemp_idx 1 add def; _settemp \"$1\" \"$2\""
207 alias _settemp "settemp_list \"1 $1 $_settemp_var $settemp_list\"; set $_settemp_var \"${$1}\"; $1 \"$2\""
208 alias settemp_restore "_settemp_restore_${settemp_list asis}"
209 alias _settemp_restore_0 "set settemp_var 0; set settemp_list 0"
210 alias _settemp_restore_1 "$1 \"${$2}\"; _settemp_restore_${3- asis}"
211
212
213 // ===================================
214 //  banning - server/command/ipban.qc
215 // ===================================
216 alias bans "sv_cmd bans"
217 alias ban "sv_cmd ban ${* ?}"         // usage: ban address(maybe incomplete, like 1.2.3) bantime(seconds)
218 alias kickban "sv_cmd kickban ${* ?}" // usage: kickban # playerno bantime(seconds) masksize(bytes)
219 alias unban "sv_cmd unban ${* ?}"     // usage: unban 3 (number from bans)
220
221
222 // =================================
223 //  voting - server/command/vote.qc
224 // =================================
225 set sv_vote_call 1 "Allow users to call a vote for the commands in sv_vote_commands"
226 set sv_vote_change 1 "Allow voters to change their mind after already voting"
227 set sv_vote_commands "restart fraglimit chmap gotomap nextmap endmatch reducematchtime extendmatchtime allready kick cointoss movetoauto" "these commands can be voted"
228 set sv_vote_only_commands ""
229 set sv_vote_master_commands "movetored movetoblue movetoyellow movetopink" "Commands which vote masters can execute by themselves" // maybe add kickban here (but then sv_vote_master 0)
230 set sv_vote_master 1    "Allows the use of the vote master system"
231 set sv_vote_master_callable 1 "When set, users can use \"vmaster\" to call a vote to become master of voting commands"
232 set sv_vote_master_password "" "when set, users can use \"vlogin PASSWORD\" to log in as master"
233 set sv_vote_master_playerlimit 2 "Minimum number of players needed for a player to be allowed to vote for master"
234 set sv_vote_no_stops_vote 1 "Allow the vote caller to stop his own vote simply by voting no"
235 set sv_vote_singlecount 0       "set to 1 to count votes once after timeout or to 0 to count with every vote"
236 set sv_vote_timeout 30  "a vote will timeout after this many seconds"
237 set sv_vote_wait 120    "a player can not call a vote again for this many seconds when his vote was not accepted"
238 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)"
239 set sv_vote_majority_factor 0.5 "What percentage of the PLAYERS constitute a majority? (Must be at least 0.5, recommended: 0.5)"
240 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)"
241 // when disabled, don't allow game type changes "note: set these two equal to JUST support simple majorities"
242 set sv_vote_override_mostrecent 0
243
244 alias vhelp "cmd vote help"
245 alias vstatus "cmd vote status"
246 alias vcall "cmd vote call ${* ?}"
247 alias vstop "cmd vote stop"
248 alias vmaster "cmd vote master"
249 alias vlogin "cmd vote login ${* ?}"
250 alias vdo "cmd vote do ${* ?}"
251 alias vyes "cl_cmd handlevote yes"
252 alias vno "cl_cmd handlevote no"
253 alias vdontcare "cmd vote dontcare"
254 alias vabstain "cmd vote abstain"
255
256 alias vmap "vcall gotomap ${1 ?}"
257 alias vnextmap "vcall nextmap ${1 ?}"
258 alias vkick "vcall kick ${1 ?}"
259 alias vkickban "vcall kickban ${1 ?}"
260 alias vend "vcall endmatch"
261 alias vdomap "vdo gotomap ${1 ?}"
262 alias vdokick "vdo kick ${* ?}"
263 alias vdokickban "vdo kickban ${* ?}"
264 alias vdoend "vdo endmatch"
265
266 // ======================
267 //  rcon server commands
268 // ======================
269 rcon_secure 1
270 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"
271
272 // =============================
273 //  other miscellaneous aliases
274 // =============================
275 alias autoscreenshot "screenshot screenshots/autoscreenshot/${1 !}-${2 !}.jpg; echo \"^5A screenshot has been taken at request of the server.\""
276