]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - commands.cfg
Re-write vote information printing
[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 scoreboard_columns_set ${* ?}"
77 alias scoreboard_columns_set  "" // aliased later
78 alias scoreboard_columns_help "cl_cmd scoreboard_columns_help ${* ?}"
79
80
81 // =========================================================== // TODO: FIGURE OUT ANY CONFLICTS WITH NORMAL COMMANDS
82 //  cmd (client-to-server command) - server/clientcommands.qc
83 // ===========================================================
84 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)"
85 set sv_clientcommand_antispam_count 5 "Amount of commands considered spam before commands are rejected.
86
87 seta sv_status_privacy 1 "hide IP addresses from \"status\" and \"who\" replies shown to clients"
88
89 seta cl_autoswitch 1 "automatically switch to newly picked up weapons if they are better than what you are carrying"
90
91 alias autoswitch "cmd autoswitch ${* ?}"
92 alias checkfail "cmd checkfail ${* ?}"
93 alias clientversion "cmd clientversion ${* ?}"
94 alias cvar_changes "cmd cvar_changes"
95 alias cvar_purechanges "cmd cvar_purechanges"
96 alias getmapvotepic "cmd getmapvotepic ${* ?}"
97 alias info "cmd info ${* ?}"
98 alias join "cmd join"
99 alias ladder "cmd ladder"
100 alias lsmaps "cmd lsmaps"
101 alias lsnewmaps "cmd lsnewmaps"
102 alias maplist "cmd maplist"
103 alias rankings "cmd rankings"
104 alias ready "cmd ready"
105 alias records "cmd records"
106 alias reportcvar "cmd reportcvar ${* ?}"
107 //alias say "cmd say ${* ?}" // engine already has this declared as a command
108 //alias say_team "cmd say_team ${* ?}" // engine already has this declared as a command
109 alias selectteam "cmd selectteam ${* ?}"
110 alias sentcvar "cmd sentcvar ${* ?}"
111 alias spectate "cmd spectate"
112 alias suggestmap "cmd suggestmap ${* ?}"
113 alias teamstatus "cmd teamstatus"
114 //alias tell "cmd tell ${* ?}" // engine already has this declared as a command
115 alias timein "cmd timein"
116 alias timeout "cmd timeout"
117 alias voice "cmd voice ${* ?}"
118 alias vote "cmd vote ${* ?}"
119 alias who "cmd who"
120
121 // other aliases for client-to-server commands
122 alias autoswitch "set cl_autoswitch ${1 ?} ; cmd autoswitch ${1 ?}" // todo
123
124 alias team_red "cmd selectteam red; cmd join"
125 alias team_blue "cmd selectteam blue; cmd join"
126 alias team_pink "cmd selectteam pink; cmd join"
127 alias team_yellow "cmd selectteam yellow; cmd join"
128 alias team_auto "cmd selectteam auto; cmd join"
129
130 alias spec "spectate"
131
132 // mutator aliases
133 alias sandbox "cmd g_sandbox ${* ?}"
134
135
136 // =========================================================
137 //  sv_cmd (server console command) - server/gamecommand.qc
138 // =========================================================
139 alias adminmsg "sv_cmd adminmsg ${* ?}"
140 alias allready "sv_cmd allready"
141 alias allspec "sv_cmd allspec ${* ?}"
142 alias anticheat "sv_cmd anticheat ${* ?}"
143 alias bbox "sv_cmd bbox"
144 alias bot_cmd "sv_cmd bot_cmd ${* ?}"
145 alias cointoss "sv_cmd cointoss ${* ?}"
146 alias cvar_changes "sv_cmd cvar_changes"
147 alias cvar_purechanges "sv_cmd cvar_purechanges"
148 alias database "sv_cmd database ${* ?}"
149 alias defer_clear "sv_cmd defer_clear ${* ?}"
150 alias defer_clear_all "sv_cmd defer_clear_all"
151 alias delrec "sv_cmd delrec ${* ?}"
152 alias effectindexdump "sv_cmd effectindexdump"
153 alias extendmatchtime "sv_cmd extendmatchtime"
154 alias find "sv_cmd find ${* ?}"
155 alias gametype "sv_cmd gametype ${* ?}"
156 alias gettaginfo "sv_cmd gettaginfo ${* ?}"
157 alias gotomap "sv_cmd gotomap ${* ?}"
158 alias ladder "sv_cmd ladder"
159 alias lockteams "sv_cmd lockteams"
160 alias make_mapinfo "sv_cmd make_mapinfo"
161 alias modelbug "sv_cmd modelbug"
162 alias moveplayer "sv_cmd moveplayer ${* ?}"
163 alias nospectators "sv_cmd nospectators"
164 alias onslaught_updatelinks "sv_cmd onslaught_updatelinks"
165 alias playerdemo "sv_cmd playerdemo ${* ?}"
166 alias printstats "sv_cmd printstats"
167 alias radarmap "sv_cmd radarmap ${* ?}"
168 alias rankings "sv_cmd rankings"
169 alias records "sv_cmd records"
170 alias reducematchtime "sv_cmd reducematchtime"
171 alias setbots "sv_cmd setbots ${* ?}"
172 alias shuffleteams "sv_cmd shuffleteams"
173 alias stuffto "sv_cmd stuffto ${* ?}"
174 alias teamstatus "sv_cmd teamstatus"
175 alias time "sv_cmd time"
176 alias trace "sv_cmd trace ${* ?}"
177 alias unlockteams "sv_cmd unlockteams"
178 alias warp "sv_cmd warp ${* ?}"
179
180 // other aliases for server commands
181 alias endmatch "timelimit -1"
182
183 alias savedb "sv_cmd database save \"${1 ?}\""
184 alias dumpdb "sv_cmd database dump \"${1 ?}\""
185 alias loaddb "sv_cmd database load \"${1 ?}\""
186
187 alias movetoteam_red "moveplayer ${1 ?} red"
188 alias movetoteam_blue "moveplayer ${1 ?} blue"
189 alias movetoteam_pink "moveplayer ${1 ?} pink"
190 alias movetoteam_yellow "moveplayer ${1 ?} yellow"
191 alias movetoteam_auto "moveplayer ${1 ?} auto"
192
193
194 // =======================================================
195 //  Aliases for settemp subsystem. Warning: Do not touch. 
196 //  Usage: settemp variable value, next map resets it.
197 // =======================================================
198 set settemp_list 0
199 set settemp_idx 0
200 set _settemp_var UNUSED
201 alias settemp "_settemp_var \"_settemp_x$settemp_idx\"; qc_cmd rpn /settemp_idx settemp_idx 1 add def; _settemp \"$1\" \"$2\""
202 alias _settemp "settemp_list \"1 $1 $_settemp_var $settemp_list\"; set $_settemp_var \"${$1}\"; $1 \"$2\""
203 alias settemp_restore "_settemp_restore_${settemp_list asis}"
204 alias _settemp_restore_0 "set settemp_var 0; set settemp_list 0"
205 alias _settemp_restore_1 "$1 \"${$2}\"; _settemp_restore_${3- asis}"
206
207
208 // ===========================
209 //  banning - server/ipban.qc
210 // ===========================
211 alias bans "sv_cmd bans"
212 alias ban "sv_cmd ban ${* ?}"         // usage: ban address(maybe incomplete, like 1.2.3) bantime(seconds)
213 alias kickban "sv_cmd kickban ${* ?}" // usage: kickban # playerno bantime(seconds) masksize(bytes)
214 alias unban "sv_cmd unban ${* ?}"     // usage: unban 3 (number from bans)
215
216
217 // =========================
218 //  voting - server/vote.qc
219 // =========================
220 set sv_vote_call 1 "Allow users to call a vote for the commands in sv_vote_commands"
221 set sv_vote_change 1 "Allow voters to change their mind after already voting"
222 set sv_vote_commands "restart fraglimit chmap gotomap nextmap endmatch reducematchtime extendmatchtime allready kick cointoss movetoteam_auto" "these commands can be voted"
223 set sv_vote_only_commands ""
224 set sv_vote_master_commands "movetoteam_red movetoteam_blue movetoteam_yellow movetoteam_pink"  "maybe add kickban here (but then sv_vote_master 0)"
225 set sv_vote_master 1    "Allows the use of the vote master system"
226 set sv_vote_master_callable 1 "When set, users can use \"vmaster\" to call a vote to become master of voting commands"
227 set sv_vote_master_password "" "when set, users can use \"vlogin PASSWORD\" to log in as master"
228 set sv_vote_master_playerlimit 2 "Minimum number of players needed for a player to be allowed to vote for master"
229 set sv_vote_singlecount 0       "set to 1 to count votes once after timeout or to 0 to count with every vote"
230 set sv_vote_timeout 30  "a vote will timeout after this many seconds"
231 set sv_vote_wait 120    "a player can not call a vote again for this many seconds when his vote was not accepted"
232 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)"
233 set sv_vote_majority_factor 0.5 "What percentage of the PLAYERS constitute a majority? (Must be at least 0.5, recommended: 0.5)"
234 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)"
235 // when disabled, don't allow game type changes "note: set these two equal to JUST support simple majorities"
236 set sv_vote_override_mostrecent 0
237
238 alias vhelp "cmd vote help"
239 alias vstatus "cmd vote status"
240 alias vcall "cmd vote call ${* ?}"
241 alias vstop "cmd vote stop"
242 alias vmaster "cmd vote master"
243 alias vlogin "cmd vote login ${* ?}"
244 alias vdo "cmd vote do ${* ?}"
245 alias vyes "cl_cmd vyes"
246 alias vno "cl_cmd vno"
247 alias vdontcare "cmd vote dontcare"
248 alias vabstain "cmd vote abstain"
249
250 alias vmap "vcall gotomap ${1 ?}"
251 alias vnextmap "vcall nextmap ${1 ?}"
252 alias vkick "vcall kick ${1 ?}"
253 alias vkickban "vcall kickban ${1 ?}"
254 alias vend "vcall endmatch"
255 alias vdomap "vdo gotomap ${1 ?}"
256 alias vdokick "vdo kick ${* ?}"
257 alias vdokickban "vdo kickban ${* ?}"
258 alias vdoend "vdo endmatch"
259
260 // ======================
261 //  rcon server commands
262 // ======================
263 rcon_secure 1
264 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"