]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - commands.cfg
Finish re-write of VoteCount() and ReadyCount() -- now with several new
[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 alias g_hitplots_add "qc_cmd rpn /g_hitplots_individuals g_hitplots_individuals $1 union def"
31 alias g_hitplots_remove "qc_cmd rpn /g_hitplots_individuals g_hitplots_individuals $1 difference def"
32
33 alias g_maplist_add     "qc_cmd maplist add $*"
34 alias g_maplist_remove  "qc_cmd maplist remove $*"
35 alias g_maplist_putfirst        "qc_cmd maplist remove $* ; qc_cmd maplist add $*"
36 alias g_maplist_shufflenow      "qc_cmd maplist shuffle"
37 alias g_maplist_cleanup "qc_cmd maplist cleanup" // removes maps that don't exist from the map list
38
39 alias addfav "qc_cmd addtolist net_slist_favorites $*"
40 alias addvote "qc_cmd addtolist sv_vote_commands $*"
41
42
43 // ========================
44 //  engine command aliases
45 // ========================
46 alias bsp "ls maps/*.bsp"
47 alias chmap "changelevel $*"
48 alias rec "record demos/$1"
49 alias ply "playdemo $1"
50 alias tdem "timedemo $1"
51 alias sv_loadconfig "exec $serverconfig"
52 alias sv_restart "say \"Server will restart at the end of the match, you will all be reconnected automatically. $* \"; quit_and_redirect self"
53
54
55 // ===============================================
56 //  menu_cmd (menu command) - menu/gamecommand.qc
57 // ===============================================
58 alias menu_showteamselect "menu_cmd directmenu TeamSelect"
59 alias menu_showhudexit "menu_cmd directmenu HUDExit"
60 alias menu_showhudoptions "menu_cmd directpanelhudmenu $*"
61 alias menu_showsandboxtools "menu_cmd directmenu SandboxTools"
62
63 // command executed before loading a map by the menu
64 // makes sure maxplayers is at least minplayers or bot_number + 1
65 alias _menu_loadmap_prepare_maxpl "maxplayers $_menu_loadmap_maxplayers"
66 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"
67
68
69 // =========================================================
70 //  cl_cmd (client console command) - client/gamecommand.qc
71 // =========================================================
72 alias radar "cl_cmd hud_panel_radar_maximized"
73 alias scoreboard_columns_set  "cl_cmd scoreboard_columns_set $*"
74 alias scoreboard_columns_set  "" // aliased later
75 alias scoreboard_columns_help "cl_cmd scoreboard_columns_help $*"
76
77
78 // ===========================================================
79 //  cmd (client-to-server command) - server/clientcommands.qc
80 // ===========================================================
81 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)"
82 set sv_clientcommand_antispam_count 5 "Amount of commands considered spam before commands are rejected.
83
84 seta sv_status_privacy 1 "hide IP addresses from \"status\" and \"who\" replies shown to clients"
85
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 "set cl_autoswitch $1 ; cmd autoswitch $1"
89
90 alias records "cmd records"
91 alias rankings "cmd rankings"
92 alias ladder "cmd ladder"
93
94 alias ready "cmd ready"
95 alias cointoss "sv_cmd cointoss"
96 alias timeout "cmd timeout" //use this command to call a timeout
97 alias timein "cmd timein" //use this command to resume the game before timeout is finished
98
99 alias lsmaps "cmd lsmaps" // lists all maps on server (for vmap, suggestmap, vnextmap)
100 alias lsnewmaps "cmd lsnewmaps" // lists all maps on server that do not yet have a record set (race/cts)
101
102 alias team_red "cmd selectteam red; cmd join"
103 alias team_blue "cmd selectteam blue; cmd join"
104 alias team_pink "cmd selectteam pink; cmd join"
105 alias team_yellow "cmd selectteam yellow; cmd join"
106 alias team_auto "cmd selectteam auto; cmd join"
107
108 alias sandbox "cmd g_sandbox $*"
109
110 alias spec "cmd spectate"
111 alias suggestmap "cmd suggestmap $1"
112
113
114 // =========================================================
115 //  sv_cmd (server console command) - server/gamecommand.qc
116 // =========================================================
117 alias adminmsg  "sv_cmd adminmsg $*"
118 alias allready "sv_cmd allready"
119
120 alias endmatch "timelimit -1"
121
122 alias extendmatchtime "sv_cmd extendmatchtime"
123 alias reducematchtime "sv_cmd reducematchtime"
124
125 alias printstats        "sv_cmd printstats" // print stats on demand
126
127 alias gametype "sv_cmd gametype $*"
128
129 alias savedb "sv_cmd database save \"$1\""
130 alias dumpdb "sv_cmd database dump \"$1\""
131 alias loaddb "sv_cmd database load \"$1\""
132
133 alias movetoteam_red "sv_cmd movetoteam $1 red"
134 alias movetoteam_blue "sv_cmd movetoteam $1 blue"
135 alias movetoteam_pink "sv_cmd movetoteam $1 pink"
136 alias movetoteam_yellow "sv_cmd movetoteam $1 yellow"
137 alias movetoteam_auto "sv_cmd movetoteam $1 auto"
138
139 alias lockteams "sv_cmd lockteams"
140 alias unlockteams "sv_cmd unlockteams"
141 alias nospectators "sv_cmd nospectators"
142 alias gotomap "sv_cmd gotomap \"$1\""
143 alias warp "sv_cmd warp $*"
144
145
146 // =======================================================
147 //  Aliases for settemp subsystem. Warning: Do not touch. 
148 //  Usage: settemp variable value, next map resets it.
149 // =======================================================
150 set settemp_list 0
151 set settemp_idx 0
152 set _settemp_var UNUSED
153 alias settemp "_settemp_var \"_settemp_x$settemp_idx\"; qc_cmd rpn /settemp_idx settemp_idx 1 add def; _settemp \"$1\" \"$2\""
154 alias _settemp "settemp_list \"1 $1 $_settemp_var $settemp_list\"; set $_settemp_var \"${$1}\"; $1 \"$2\""
155 alias settemp_restore "_settemp_restore_${settemp_list asis}"
156 alias _settemp_restore_0 "set settemp_var 0; set settemp_list 0"
157 alias _settemp_restore_1 "$1 \"${$2}\"; _settemp_restore_${3- asis}"
158
159
160 // ===========================
161 //  banning - server/ipban.qc
162 // ===========================
163 alias bans "sv_cmd bans"
164 alias ban "sv_cmd ban $*"         // usage: ban address(maybe incomplete, like 1.2.3) bantime(seconds)
165 alias kickban "sv_cmd kickban $*" // usage: kickban # playerno bantime(seconds) masksize(bytes)
166 alias unban "sv_cmd unban $*"     // usage: unban 3 (number from bans)
167
168
169 // =========================
170 //  voting - server/vote.qc
171 // =========================
172 set sv_vote_call 1 "Allow users to call a vote for the commands in sv_vote_commands"
173 set sv_vote_change 1 "Allow voters to change their mind after already voting"
174 set sv_vote_commands "restart fraglimit chmap gotomap nextmap endmatch reducematchtime extendmatchtime allready kick cointoss movetoteam_auto" "these commands can be voted"
175 set sv_vote_only_commands ""
176 set sv_vote_master_commands "movetoteam_red movetoteam_blue movetoteam_yellow movetoteam_pink"  "maybe add kickban here (but then sv_vote_master 0)"
177 set sv_vote_master 1    "Allows the use of the vote master system"
178 set sv_vote_master_callable 1 "When set, users can use \"vmaster\" to call a vote to become master of voting commands"
179 set sv_vote_master_password "" "when set, users can use \"vlogin PASSWORD\" to log in as master"
180 set sv_vote_master_playerlimit 2 "Minimum number of players needed for a player to be allowed to vote for master"
181 set sv_vote_singlecount 0       "set to 1 to count votes once after timeout or to 0 to count with every vote"
182 set sv_vote_timeout 30  "a vote will timeout after this many seconds"
183 set sv_vote_wait 120    "a player can not call a vote again for this many seconds when his vote was not accepted"
184 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)"
185 set sv_vote_majority_factor 0.5 "What percentage of the PLAYERS constitute a majority? (Must be at least 0.5, recommended: 0.5)"
186 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)"
187 // when disabled, don't allow game type changes "note: set these two equal to JUST support simple majorities"
188 set sv_vote_override_mostrecent 0
189
190 alias vhelp "cmd vote help"
191 alias vstatus "cmd vote status"
192 alias vcall "cmd vote call $*"
193 alias vstop "cmd vote stop"
194 alias vmaster "cmd vote master"
195 alias vlogin "cmd vote login $*"
196 alias vdo "cmd vote do $*"
197 alias vyes "cl_cmd vyes"
198 alias vno "cl_cmd vno"
199 alias vdontcare "cmd vote dontcare"
200 alias vabstain "cmd vote abstain"
201
202 alias vmap "vcall gotomap $1"
203 alias vnextmap "vcall nextmap $1"
204 alias vkick "vcall kick $1"
205 alias vkickban "vcall kickban $1"
206 alias vend "vcall endmatch"
207 alias vdomap "vdo gotomap $1"
208 alias vdokick "vdo kick $*"
209 alias vdokickban "vdo kickban $*"
210 alias vdoend "vdo endmatch"
211
212 // ======================
213 //  rcon server commands
214 // ======================
215 rcon_secure 1
216 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"