]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - commands.cfg
Begin total re-write of generic command system
[xonotic/xonotic-data.pk3dir.git] / commands.cfg
index 06b1363a3089072c1d6dd67c62099890f93b849a..c034a9cfaa95fbdf3e595b878e9b9631683c09e9 100644 (file)
 //  Master config for managing various command aliases and settings
 // =================================================================
 
-// common
+// Execute commands based on whether it is dedicated a server or a client.
+alias "_detect_dedicated_$qport" "${* asis}"
+alias "_detect_dedicated_0" ""
+alias _if_dedicated "_detect_dedicated_$qport ${* asis}"
+alias if_client "${* asis}"
+alias if_dedicated "${* asis}"
+_if_dedicated alias if_client ""
+if_client alias if_dedicated ""
 
+if_client set cmd_prefix "cmd"
+if_dedicated set cmd_prefix "sv_cmd"
 
+if_dedicated "alias" qc_cmd_svmenu "sv_cmd $$*"
+if_client    "alias" qc_cmd_svmenu "menu_cmd $$*"
+if_dedicated "alias" qc_cmd_svcl   "sv_cmd $$*"
+if_client    "alias" qc_cmd_svcl   "cl_cmd $$*"
+if_dedicated "alias" qc_cmd_svcmd  "sv_cmd $$*"
+if_client    "alias" qc_cmd_svcmd  "cmd $$*"
 
-// cl_cmd (clientcommand)
+
+// ========
+//  common
+// ========
+alias cvar_changes "qc_cmd_svcmd cvar_changes"
+alias cvar_purechanges "qc_cmd_svcmd cvar_purechanges"
+alias info "qc_cmd_svcmd info ${* ?}"
+alias ladder "qc_cmd_svcmd ladder"
+alias lsmaps "qc_cmd_svcmd lsmaps"
+alias lsnewmaps "qc_cmd_svcmd lsnewmaps"
+alias maplist "qc_cmd_svcmd maplist"
+alias rankings "qc_cmd_svcmd rankings"
+alias records "qc_cmd_svcmd records"
+alias teamstatus "qc_cmd_svcmd teamstatus"
+alias time "qc_cmd_svcmd time"
+alias timein "qc_cmd_svcmd timein"
+alias timeout "qc_cmd_svcmd timeout"
+alias vote "qc_cmd_svcmd vote ${* ?}"
+alias who "qc_cmd_svcmd who ${* ?}"
+
+alias g_hitplots_add "qc_cmd_svmenu rpn /g_hitplots_individuals g_hitplots_individuals ${1 !} union def"
+alias g_hitplots_remove "qc_cmd_svmenu rpn /g_hitplots_individuals g_hitplots_individuals ${1 !} difference def"
+
+alias g_maplist_add    "qc_cmd_svmenu maplist add ${* ?}"
+alias g_maplist_remove "qc_cmd_svmenu maplist remove ${* ?}"
+alias g_maplist_putfirst       "qc_cmd_svmenu maplist remove ${* ?} ; qc_cmd maplist add ${* ?}"
+alias g_maplist_shufflenow     "qc_cmd_svmenu maplist shuffle"
+alias g_maplist_cleanup        "qc_cmd_svmenu maplist cleanup" // removes maps that don't exist from the map list
+
+alias addfav "qc_cmd_svmenu addtolist net_slist_favorites ${* ?}"
+alias addvote "qc_cmd_svmenu addtolist sv_vote_commands ${* ?}"
+
+
+// ========================
+//  engine command aliases
+// ========================
+alias bsp "ls maps/*.bsp"
+alias chmap "changelevel ${* ?}"
+alias clearmap "disconnect"
+alias ply "playdemo $1"
+alias rec "record demos/${1 !}"
+alias sv_loadconfig "exec $serverconfig"
+alias sv_restart "say \"Server will restart at the end of the match, you will all be reconnected automatically. ${* ?} \"; quit_and_redirect self"
+alias tdem "timedemo $1"
+
+
+// ===============================================
+//  menu_cmd (menu command) - menu/command/menu_cmd.qc
+// ===============================================
+alias menu_showteamselect "menu_cmd directmenu TeamSelect"
+alias menu_showhudexit "menu_cmd directmenu HUDExit"
+alias menu_showhudoptions "menu_cmd directpanelhudmenu ${* ?}"
+alias menu_showsandboxtools "menu_cmd directmenu SandboxTools"
+alias menu_showquitdialog "menu_cmd directmenu Quit"
+
+// command executed before loading a map by the menu
+// makes sure maxplayers is at least minplayers or bot_number + 1
+alias _menu_loadmap_prepare_maxpl "maxplayers $_menu_loadmap_maxplayers"
+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"
+
+
+// ==========================================================
+//  cl_cmd (client local command) - client/command/cl_cmd.qc
+// ==========================================================
+// commented out commands are really only intended for internal use
+if_client alias blurtest "cl_cmd blurtest"
+if_client alias debugmodel "cl_cmd debugmodel ${* ?}"
+//if_client alias handlevote "cl_cmd handlevote ${* ?}"
+if_client alias hud "cl_cmd hud ${* ?}"
+if_client alias localprint "cl_cmd localprint ${* ?}"
+//if_client alias mv_download "cl_cmd mv_download ${* ?}"
+if_client alias sendcvar "cl_cmd sendcvar ${* ?}"
+//if_client alias settemp "cl_cmd settemp ${* ?}"
+//if_client alias settemp_restore "cl_cmd settemp_restore"
+
+// other aliases for local commands
+if_client alias hud_configure "cl_cmd hud configure"
+if_client alias hud_save "cl_cmd hud save ${* ?}"
+if_client alias radar "cl_cmd hud radar ${* ?}"
+if_client alias scoreboard_columns_help "cl_cmd hud scoreboard_columns_help"
+if_client alias scoreboard_columns_set "cl_cmd hud scoreboard_columns_set ${* ?}"
+
+// changes a cvar and reports it to the server (for the client to notify the server about changes)
+alias setreport "set \"$1\" \"$2\" ; sendcvar \"$1\""
+
+
+// ========================================================
+//  cmd (client-to-server command) - server/command/cmd.qc
+// ========================================================
 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)"
-set sv_clientcommand_antispam_count 5 "Amount of commands considered spam before commands are rejected.
\ No newline at end of file
+set sv_clientcommand_antispam_count 8 "Amount of commands considered spam before commands are rejected."
+seta sv_status_privacy 1 "hide IP addresses from \"status\" and \"who\" replies shown to clients"
+seta cl_autoswitch 1 "automatically switch to newly picked up weapons if they are better than what you are carrying"
+
+// commented out commands are really only intended for internal use, or already have declaration in the engine
+alias autoswitch "cmd autoswitch ${* ?}"
+alias checkfail "cmd checkfail ${* ?}"
+alias clientversion "cmd clientversion ${* ?}"
+//alias getmapvotepic "cmd getmapvotepic ${* ?}"
+alias join "cmd join"
+alias ready "cmd ready"
+alias records "cmd records"
+alias reportcvar "cmd reportcvar ${* ?}"
+//alias say "cmd say ${* ?}" // engine already has this declared as a command
+//alias say_team "cmd say_team ${* ?}" // engine already has this declared as a command
+alias selectteam "cmd selectteam ${* ?}"
+alias sentcvar "cmd sentcvar ${* ?}"
+alias spectate "cmd spectate"
+alias suggestmap "cmd suggestmap ${* ?}"
+//alias tell "cmd tell ${* ?}" // engine already has this declared as a command
+alias voice "cmd voice ${* ?}"
+
+// other aliases for client-to-server commands
+alias autoswitch "set cl_autoswitch ${1 ?} ; cmd autoswitch ${1 ?}" // todo
+
+alias team_red "cmd selectteam red; cmd join"
+alias team_blue "cmd selectteam blue; cmd join"
+alias team_pink "cmd selectteam pink; cmd join"
+alias team_yellow "cmd selectteam yellow; cmd join"
+alias team_auto "cmd selectteam auto; cmd join"
+
+alias spec "spectate"
+
+// mutator aliases
+alias sandbox "cmd g_sandbox ${* ?}"
+
+
+// ============================================================
+//  sv_cmd (server console command) - server/command/sv_cmd.qc
+// ============================================================
+alias adminmsg "sv_cmd adminmsg ${* ?}"
+alias allready "sv_cmd allready"
+alias allspec "sv_cmd allspec ${* ?}"
+alias anticheat "sv_cmd anticheat ${* ?}"
+alias bbox "sv_cmd bbox"
+alias bot_cmd "sv_cmd bot_cmd ${* ?}"
+alias cointoss "sv_cmd cointoss ${* ?}"
+alias database "sv_cmd database ${* ?}"
+alias defer_clear "sv_cmd defer_clear ${* ?}"
+alias defer_clear_all "sv_cmd defer_clear_all"
+alias delrec "sv_cmd delrec ${* ?}"
+alias effectindexdump "sv_cmd effectindexdump"
+alias extendmatchtime "sv_cmd extendmatchtime"
+alias find "sv_cmd find ${* ?}"
+alias gametype "sv_cmd gametype ${* ?}"
+alias gettaginfo "sv_cmd gettaginfo ${* ?}"
+alias gotomap "sv_cmd gotomap ${* ?}"
+alias lockteams "sv_cmd lockteams"
+alias make_mapinfo "sv_cmd make_mapinfo"
+alias modelbug "sv_cmd modelbug"
+alias moveplayer "sv_cmd moveplayer ${* ?}"
+alias nospectators "sv_cmd nospectators"
+alias onslaught_updatelinks "sv_cmd onslaught_updatelinks"
+alias playerdemo "sv_cmd playerdemo ${* ?}"
+alias printstats "sv_cmd printstats"
+alias radarmap "sv_cmd radarmap ${* ?}"
+alias reducematchtime "sv_cmd reducematchtime"
+alias setbots "sv_cmd setbots ${* ?}"
+alias shuffleteams "sv_cmd shuffleteams"
+alias stuffto "sv_cmd stuffto ${* ?}"
+alias trace "sv_cmd trace ${* ?}"
+alias unlockteams "sv_cmd unlockteams"
+alias warp "sv_cmd warp ${* ?}"
+
+// other aliases for server commands
+alias endmatch "timelimit -1"
+
+alias savedb "sv_cmd database save \"${1 ?}\""
+alias dumpdb "sv_cmd database dump \"${1 ?}\""
+alias loaddb "sv_cmd database load \"${1 ?}\""
+
+alias movetored "moveplayer ${1 ?} red"
+alias movetoblue "moveplayer ${1 ?} blue"
+alias movetopink "moveplayer ${1 ?} pink"
+alias movetoyellow "moveplayer ${1 ?} yellow"
+alias movetoauto "moveplayer ${1 ?} auto"
+
+
+// =======================================================
+//  Aliases for settemp subsystem. Warning: Do not touch. 
+//  Usage: settemp variable value, next map resets it.
+// =======================================================
+alias settemp "qc_cmd_svcl settemp $$*"
+alias settemp_restore "qc_cmd_svcl settemp_restore"
+
+
+// ===================================
+//  banning - server/command/ipban.qc
+// ===================================
+alias bans "sv_cmd bans"
+alias ban "sv_cmd ban ${* ?}"         // usage: ban address(maybe incomplete, like 1.2.3) bantime(seconds)
+alias kickban "sv_cmd kickban ${* ?}" // usage: kickban # playerno bantime(seconds) masksize(bytes)
+alias unban "sv_cmd unban ${* ?}"     // usage: unban 3 (number from bans)
+
+
+// =================================
+//  voting - server/command/vote.qc
+// =================================
+set sv_vote_call 1 "Allow users to call a vote for the commands in sv_vote_commands"
+set sv_vote_change 1 "Allow voters to change their mind after already voting"
+set sv_vote_commands "restart fraglimit chmap gotomap nextmap endmatch reducematchtime extendmatchtime allready kick cointoss movetoauto" "these commands can be voted"
+set sv_vote_only_commands ""
+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)
+set sv_vote_master 1   "Allows the use of the vote master system"
+set sv_vote_master_callable 1 "When set, users can use \"vmaster\" to call a vote to become master of voting commands"
+set sv_vote_master_password "" "when set, users can use \"vlogin PASSWORD\" to log in as master"
+set sv_vote_master_playerlimit 2 "Minimum number of players needed for a player to be allowed to vote for master"
+set sv_vote_no_stops_vote 1 "Allow the vote caller to stop his own vote simply by voting no"
+set sv_vote_singlecount 0      "set to 1 to count votes once after timeout or to 0 to count with every vote"
+set sv_vote_timeout 30 "a vote will timeout after this many seconds"
+set sv_vote_wait 120   "a player can not call a vote again for this many seconds when his vote was not accepted"
+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)"
+set sv_vote_majority_factor 0.5        "What percentage of the PLAYERS constitute a majority? (Must be at least 0.5, recommended: 0.5)"
+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)"
+// when disabled, don't allow game type changes "note: set these two equal to JUST support simple majorities"
+set sv_vote_override_mostrecent 0
+
+alias vhelp "cmd vote help"
+alias vstatus "cmd vote status"
+alias vcall "cmd vote call ${* ?}"
+alias vstop "cmd vote stop"
+alias vmaster "cmd vote master"
+alias vlogin "cmd vote login ${* ?}"
+alias vdo "cmd vote do ${* ?}"
+alias vyes "cl_cmd handlevote yes"
+alias vno "cl_cmd handlevote no"
+alias vdontcare "cmd vote dontcare"
+alias vabstain "cmd vote abstain"
+
+alias vmap "vcall gotomap ${1 ?}"
+alias vnextmap "vcall nextmap ${1 ?}"
+alias vkick "vcall kick ${1 ?}"
+alias vkickban "vcall kickban ${1 ?}"
+alias vend "vcall endmatch"
+alias vdomap "vdo gotomap ${1 ?}"
+alias vdokick "vdo kick ${* ?}"
+alias vdokickban "vdo kickban ${* ?}"
+alias vdoend "vdo endmatch"
+
+// ======================
+//  rcon server commands
+// ======================
+rcon_secure 1
+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"
+
+// =============================
+//  other miscellaneous aliases
+// =============================
+alias autoscreenshot "screenshot screenshots/autoscreenshot/${1 !}-${2 !}.jpg; echo \"^5A screenshot has been taken at request of the server.\""
+