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