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