From 8d2e3986fec67324328cbf3f6ab232175622ccc6 Mon Sep 17 00:00:00 2001 From: Samual Date: Sat, 10 Dec 2011 03:02:31 -0500 Subject: [PATCH] More alias updates, plus fix several bugs/add more todo notes --- commands.cfg | 36 +++++++++++++++++++++++++++++++----- defaultXonotic.cfg | 17 ----------------- qcsrc/server/vote.qc | 15 +++++++++------ 3 files changed, 40 insertions(+), 28 deletions(-) diff --git a/commands.cfg b/commands.cfg index d16aaa525..2d12a80f7 100644 --- a/commands.cfg +++ b/commands.cfg @@ -48,6 +48,8 @@ alias chmap "changelevel $*" alias rec "record demos/$1" alias ply "playdemo $1" alias tdem "timedemo $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" // =============================================== @@ -58,6 +60,11 @@ alias menu_showhudexit "menu_cmd directmenu HUDExit" alias menu_showhudoptions "menu_cmd directpanelhudmenu $*" alias menu_showsandboxtools "menu_cmd directmenu SandboxTools" +// 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 console command) - client/gamecommand.qc @@ -76,6 +83,10 @@ set sv_clientcommand_antispam_count 5 "Amount of commands considered spam before 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" + +alias autoswitch "set cl_autoswitch $1 ; cmd autoswitch $1" + alias records "cmd records" alias rankings "cmd rankings" alias ladder "cmd ladder" @@ -85,6 +96,9 @@ alias cointoss "sv_cmd cointoss" alias timeout "cmd timeout" //use this command to call a timeout alias timein "cmd timein" //use this command to resume the game before timeout is finished +alias lsmaps "cmd lsmaps" // lists all maps on server (for vmap, suggestmap, vnextmap) +alias lsnewmaps "cmd lsnewmaps" // lists all maps on server that do not yet have a record set (race/cts) + alias team_red "cmd selectteam red; cmd join" alias team_blue "cmd selectteam blue; cmd join" alias team_pink "cmd selectteam pink; cmd join" @@ -93,6 +107,9 @@ alias team_auto "cmd selectteam auto; cmd join" alias sandbox "cmd g_sandbox $*" +alias spec "cmd spectate" +alias suggestmap "cmd suggestmap $1" + // ========================================================= // sv_cmd (server console command) - server/gamecommand.qc @@ -100,6 +117,8 @@ alias sandbox "cmd g_sandbox $*" alias adminmsg "sv_cmd adminmsg $*" alias allready "sv_cmd allready" +alias endmatch "timelimit -1" + alias extendmatchtime "sv_cmd extendmatchtime" alias reducematchtime "sv_cmd reducematchtime" @@ -150,14 +169,14 @@ alias unban "sv_cmd unban $*" // usage: unban 3 (number from bans) // ========================= // voting - server/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 movetoteam_auto" "these commands can be voted" set sv_vote_only_commands "" set sv_vote_master_commands "movetoteam_red movetoteam_blue movetoteam_yellow movetoteam_pink" "maybe add kickban here (but then sv_vote_master 0)" -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" -set sv_vote_call 1 "users can call a vote for the above commands" -set sv_vote_master 1 "users can call a vote to become master" -set sv_vote_master_password "" "when set, users can use \"vlogin PASSWORD\" to log in as master" -set sv_vote_change 1 "set to 1 to allow to change you vote/mind" +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_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" @@ -166,6 +185,7 @@ set sv_vote_majority_factor 0.5 "which quotient of the PLAYERS constitute a majo set sv_vote_simple_majority_factor 0.666 "which quotient of the VOTERS constitute a majority too? (0 = off, otherwise it must be higher than or equal to sv_vote_majority_factor)" // 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 $*" @@ -187,3 +207,9 @@ 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\" movetoteam_auto movetoteam_red movetoteam_blue movetoteam_yellow movetoteam_pink" diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 82511d4e5..00fdf00bf 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -382,9 +382,6 @@ cl_movement 1 cl_movement_track_canjump 0 cl_stairsmoothspeed 200 -seta cl_autoswitch 1 "automatically switch to newly picked up weapons if they are better than what you are carrying" -alias autoswitch "set cl_autoswitch $1 ; cmd autoswitch $1" - set bot_config_file bots.txt "Name and path of the bot configuration file" set bot_number 0 "Minimum number of bots" seta bot_usemodelnames 0 "Use player model names for bot names" @@ -966,8 +963,6 @@ seta cl_notify_carried_items "3" "notify you of carried items when you obtain th // startmap_dm is used when running with the -listen or -dedicated commandline options set serverconfig server.cfg alias startmap_dm "set _sv_init 0; map _init/_init; exec $serverconfig; set _sv_init 1; map _init/_init" -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" // aliases: alias +fire +attack @@ -1113,13 +1108,10 @@ bind kp_enter "+userbind 16" bind kp_plus "+userbind 17" bind kp_minus "+userbind 18" -alias lsmaps "cmd lsmaps" // lists all maps on server (for vmap, suggestmap, vnextmap) -alias lsnewmaps "cmd lsnewmaps" // lists all maps on server that do not yet have a record set (race/cts) bind F1 vyes bind F2 vno //used for spectate/observer mode -alias spec "cmd spectate" bind F3 spec // NIX (No Items Xonotic) - at each time, everyone uses the same weapon, @@ -1188,7 +1180,6 @@ seta g_maplist_votable_suggestions_override_mostrecent 0 seta g_maplist_votable_nodetail 1 "nodetail only shows total count instead of all vote counts per map, so votes don't influence others that much" seta g_maplist_votable_abstain 0 "when 1, you can abstain from your vote" seta g_maplist_votable_screenshot_dir "maps levelshots" "where to look for map screenshots" -alias suggestmap "cmd suggestmap $1" set g_chat_flood_spl 3 "normal chat: seconds between lines to not count as flooding" set g_chat_flood_lmax 2 "normal chat: maximum number of lines per chat message at once" @@ -1410,17 +1401,11 @@ set menu_weaponarena_with_laser 0 "also enable the Laser in this weapon arena" seta menu_maxplayers 16 "maxplayers value when the menu starts a game" -// 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" - // useful vote aliases set timelimit_increment 5 set timelimit_decrement 5 set timelimit_min 5 set timelimit_max 60 -alias endmatch "timelimit -1" // useful keybind to maximize the chat area temporarily // HUD code takes care of many of these now... @@ -1672,8 +1657,6 @@ seta g_hitplots_individuals "" "the individuals, by IP, that should have their h alias mute "prvm_edictset server $1 muted 1" // I am lazy and not making an actual command of this alias unmute "prvm_edictset server $1 muted 0" // dito -rcon_secure 1 - set menu_updatecheck 1 set bot_navigation_ignoreplayers 0 // FIXME remove this once the issue is solved diff --git a/qcsrc/server/vote.qc b/qcsrc/server/vote.qc index f5d43a5f3..3983aa926 100644 --- a/qcsrc/server/vote.qc +++ b/qcsrc/server/vote.qc @@ -426,7 +426,7 @@ void ReadyRestart() return; } -// Count the players who are ready and determine whether or not to restart the match +// Count the players who are ready and determine whether or not to restart the match // todo: add percentage ready support void ReadyCount() { entity tmp_player; @@ -504,9 +504,9 @@ float VoteCommand_checknasty(string vote_command) || (strstrofs(vote_command, "\n", 0) >= 0) || (strstrofs(vote_command, "\r", 0) >= 0) || (strstrofs(vote_command, "$", 0) >= 0)) - return TRUE; + return FALSE; - return FALSE; + return TRUE; } float VoteCommand_checkinlist(string vote_command, string list) @@ -660,7 +660,10 @@ void VoteCommand_call(float request, entity caller, float argc, string vote_comm { case VC_REQUEST_COMMAND: { - float spectators_allowed = ((autocvar_sv_vote_nospectators != 2) || ((autocvar_sv_vote_nospectators == 1) && inWarmupStage)); + float spectators_allowed = ((autocvar_sv_vote_nospectators != 2) + || ((autocvar_sv_vote_nospectators == 1) && inWarmupStage) + || (autocvar_sv_vote_nospectators == 0)); + float tmp_playercount; entity tmp_player; @@ -668,7 +671,7 @@ void VoteCommand_call(float request, entity caller, float argc, string vote_comm if not(autocvar_sv_vote_call || !caller) { print_to(caller, "^1Vote calling is not allowed."); } else if(votecalled) { print_to(caller, "^1There is already a vote called."); } - else if(spectators_allowed && (caller && (caller.classname != "player"))) { print_to(caller, "^1Only players can call a vote."); } + else if(!spectators_allowed && (caller && (caller.classname != "player"))) { print_to(caller, "^1Only players can call a vote."); } else if(timeoutStatus) { print_to(caller, "^1You can not call a vote while a timeout is active."); } else if(caller && (time < caller.vote_next)) { print_to(caller, strcat("^1You have to wait ^2", ftos(ceil(caller.vote_next - time)), "^1 seconds before you can again call a vote.")); } else if not(VoteCommand_checknasty(vote_command)) { print_to(caller, "^1Syntax error in command, see 'vhelp' for more info."); } @@ -760,7 +763,7 @@ void VoteCommand_master(float request, entity caller, float argc, string vote_co default: // calling a vote for master { - if not(autocvar_sv_vote_master_callable) { print_to(caller, "^1Vote to become vote master is not allowed."); } // todo update this description in defaultXonotic.cfg + if not(autocvar_sv_vote_master_callable) { print_to(caller, "^1Vote to become vote master is not allowed."); } else if(votecalled) { print_to(caller, "^1There is already a vote called."); } else // everything went okay, continue with creating vote -- 2.39.2