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