|
Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
|
|
#include "sv_mapvoting.qh"#include "net.qh"#include <common/net_linked.qh>#include <common/playerstats.qh>#include <common/state.qh>#include <common/stats.qh>#include <common/util.qh>#include <common/weapons/_all.qh>#include <server/client.qh>#include <server/command/cmd.qh>#include <server/command/getreplies.qh>#include <server/gamelog.qh>#include <server/world.qh>Go to the source code of this file.
Macros | |
| #define | REDUCE_REMOVE_THIS(idx) |
Variables | |
| int | current_gametype_index |
| bool | gametypevote_finished |
| #define REDUCE_REMOVE_THIS | ( | idx | ) |
Referenced by MapVote_CheckRules_decide().
Definition at line 669 of file sv_mapvoting.qc.
References GameTypeVote_AvailabilityStatus(), GameTypeVote_Type_FromString(), mv_count, mv_entries, mv_flags, mv_ssdir_i, NULL, and strzone().
Referenced by GameTypeVote_Start().
Definition at line 27 of file sv_mapvoting.qc.
References cvar_string(), get_nextmap, GTV_AVAILABLE, GTV_CUSTOM, GTV_FORBIDDEN, MapInfo_Get_ByName(), MapInfo_Map_supportedGametypes, MapInfo_Type_FromString(), NULL, and strcat().
Referenced by GameTypeVote_AddVotable().
Definition at line 649 of file sv_mapvoting.qc.
References cvar_set(), gametypevote, gametypevote_finished, GameTypeVote_SetGametype(), GameTypeVote_Type_FromString(), GTV_CUSTOM, MapInfo_CurrentGametype(), match_gametype, mv_entries, mv_flags, strcpy, voted_gametype, and voted_gametype_string.
Referenced by MapVote_Finished().
| vector GameTypeVote_GetMask | ( | ) |
Definition at line 52 of file sv_mapvoting.qc.
References argv(), autocvar_sv_vote_gametype_options, GameTypeVote_Type_FromString(), MapInfo_CurrentGametype(), MAPVOTE_COUNT, min(), tokenizebyseparator, and vector.
Referenced by GameTypeVote_MapInfo_FixName().
Definition at line 66 of file sv_mapvoting.qc.
References _MapInfo_FilterGametype(), autocvar_sv_vote_gametype, GameTypeVote_GetMask(), MapInfo_Enumerate(), MapInfo_FixName(), MapInfo_ForbiddenFlags(), and MapInfo_RequiredFlags().
Referenced by DoNextMapOverride(), GotoMap(), and MapVote_Suggest().
Definition at line 590 of file sv_mapvoting.qc.
References autocvar_sv_vote_gametype_maplist_reset, bprint(), cvar_set(), cvar_string(), CVAR_TYPEFLAG_EXISTS, gametype_custom_enabled, getlsmaps(), localcmd(), lsmaps_reply, MapInfo_count, MapInfo_CurrentFeatures(), MapInfo_CurrentGametype(), MapInfo_Enumerate(), MapInfo_FilterGametype(), MapInfo_ForbiddenFlags(), MapInfo_ListAllowedMaps(), MapInfo_RequiredFlags(), MapInfo_SwitchGameType(), MapInfo_Type_ToString(), match_gametype, strcat(), strunzone(), and strzone().
Referenced by GameCommand_gametype(), GameTypeVote_Finished(), MapVote_Init(), and MapVote_Think().
| bool GameTypeVote_Start | ( | ) |
Definition at line 687 of file sv_mapvoting.qc.
References argv(), autocvar_sv_vote_gametype_default_current, autocvar_sv_vote_gametype_detail, autocvar_sv_vote_gametype_options, autocvar_sv_vote_gametype_reduce_count, autocvar_sv_vote_gametype_reduce_time, autocvar_sv_vote_gametype_timeout, current_gametype_index, gametype_custom_enabled, gametypevote, GameTypeVote_AddVotable(), GTV_AVAILABLE, loaded_gametype_custom_string, MapInfo_CurrentGametype(), MapInfo_Type_ToString(), MapVote_ClearAllVotes(), MAPVOTE_COUNT, MapVote_Finished(), MapVote_Spawn(), MapVote_UnzoneStrings(), min(), mv_abstain, mv_count, mv_count_real, mv_detail, mv_entries, mv_flags, mv_reduce_count, mv_reduce_time, mv_timeout, strunzone(), strzone(), time, and tokenizebyseparator.
Referenced by MapVote_Think().
Returns the gamtype ID from its name, if type_name isn't a real gametype it checks for sv_vote_gametype_(type_name)_type.
Definition at line 18 of file sv_mapvoting.qc.
References cvar_string(), MapInfo_Type_FromString(), NULL, and strcat().
Referenced by GameTypeVote_AddVotable(), GameTypeVote_Finished(), and GameTypeVote_GetMask().
Definition at line 129 of file sv_mapvoting.qc.
References GetNextMap(), GTV_AVAILABLE, MapInfo_CheckMap(), mv_count, mv_entries, mv_flags, mv_pakfile, mv_rng, mv_ssdir_i, mv_ssdirs, mv_ssdirs_count, mv_suggester, mv_suggestions, random(), strcat(), string_null, strstrofs, strzone(), and substring().
Referenced by MapVote_AddVotableMaps(), and MapVote_Init().
Before mapvoting begins, players can trigger MapVote_Suggest (suggestmap), which sets mv_suggestions and mv_suggester from index 0 onwards. When mapvoting begins, we store the other info (pakfile, flags, ssdir, rng) with MapVote_AddVotable, for the suggested maps first to filter out the invalid ones, then run MapVote_AddVotable with GetNextMap to fill in the rest of the maps.
Definition at line 188 of file sv_mapvoting.qc.
References floor(), Maplist_Close(), Maplist_Init(), MapVote_AddVotable(), min(), mv_count, mv_ranked, mv_suggester, mv_suggestion_ptr, mv_suggestions, and random().
Referenced by MapVote_Init().
| void MapVote_CheckRules_count | ( | ) |
Definition at line 374 of file sv_mapvoting.qc.
References FOREACH_CLIENT, GTV_AVAILABLE, heapsort(), IS_REAL_CLIENT, MapVote_ranked_cmp(), MapVote_ranked_swap(), mv_count, mv_count_real, mv_flags, mv_ranked, mv_voters, mv_votes, and NULL.
Referenced by MapVote_Tick().
| bool MapVote_CheckRules_decide | ( | ) |
Definition at line 401 of file sv_mapvoting.qc.
References autocvar_sv_eventlog, GameLogEcho(), GTV_AVAILABLE, itos, MapVote_Finished(), MapVote_TouchMask(), mv_abstain, mv_count, mv_count_real, mv_entries, mv_flags, mv_ranked, mv_reduce_count, mv_reduce_time, mv_timeout, mv_voters, mv_votes, REDUCE_REMOVE_THIS, remove, result, strcat(), and time.
Referenced by MapVote_Tick().
| void MapVote_ClearAllVotes | ( | ) |
Definition at line 76 of file sv_mapvoting.qc.
References FOREACH_CLIENT.
Referenced by GameTypeVote_Start(), and MapVote_Init().
Definition at line 288 of file sv_mapvoting.qc.
References alreadychangedlevel, autocvar_sv_eventlog, FixClientCvars(), FOREACH_CLIENT, GameLogEcho(), gametypevote, GameTypeVote_Finished(), get_nextmap, GTV_AVAILABLE, IS_REAL_CLIENT, itos, Map_Goto(), Map_Goto_SetStr(), MapVote_Init(), MapVote_Winner(), mv_count, mv_entries, mv_flags, mv_suggester, mv_voters, mv_votes, mv_winner, mv_winner_time, result, strcat(), strfree, time, and voted_gametype_string.
Referenced by GameTypeVote_Start(), and MapVote_CheckRules_decide().
| void MapVote_Init | ( | ) |
Definition at line 234 of file sv_mapvoting.qc.
References argv(), autocvar_g_maplist_votable, autocvar_g_maplist_votable_abstain, autocvar_g_maplist_votable_detail, autocvar_g_maplist_votable_reduce_count, autocvar_g_maplist_votable_reduce_time, autocvar_g_maplist_votable_screenshot_dir, autocvar_g_maplist_votable_show_suggester, autocvar_g_maplist_votable_suggestions, autocvar_g_maplist_votable_timeout, current_gametype_index, gametype_custom_enabled, GameTypeVote_SetGametype(), loaded_gametype_custom_string, MapVote_AddVotable(), MapVote_AddVotableMaps(), MapVote_ClearAllVotes(), MAPVOTE_COUNT, MapVote_Spawn(), MAPVOTE_SSDIRS_COUNT, MapVote_UnzoneStrings(), match_gametype, min(), mv_abstain, mv_count, mv_count_real, mv_detail, mv_reduce_count, mv_reduce_time, mv_show_suggester, mv_ssdirs, mv_ssdirs_count, mv_suggestion_ptr, mv_timeout, strzone(), time, and tokenize_console.
Referenced by MapVote_Finished(), and MapVote_Think().
Definition at line 349 of file sv_mapvoting.qc.
References current_gametype_index, entity(), GTV_AVAILABLE, mv_flags, mv_ranked, mv_rng, mv_votes, pass, and TC.
Referenced by MapVote_CheckRules_count().
| void MapVote_Start | ( | ) |
Definition at line 506 of file sv_mapvoting.qc.
References MapInfo_CurrentFeatures(), MapInfo_CurrentGametype(), MapInfo_Enumerate(), MapInfo_FilterGametype(), MapInfo_ForbiddenFlags(), MapInfo_RequiredFlags(), mapvote_run, and PlayerStats_GameReport_DelayMapVote.
Referenced by CheckRules_World(), and IntermissionThink().
Definition at line 91 of file sv_mapvoting.qc.
References autocvar_g_maplist_votable_suggestions, autocvar_g_maplist_votable_suggestions_override_mostrecent, autocvar_sv_eventlog, autocvar_sv_vote_gametype, entity(), floor(), GameLogEcho(), gametypevote, GameTypeVote_MapInfo_FixName(), itos, Map_IsRecent(), MapInfo_CheckMap(), MAPVOTE_COUNT, mapvote_initialized, mv_suggester, mv_suggestion_ptr, mv_suggestions, netname, playerid, random(), strcat(), strunzone(), and strzone().
Referenced by ClientCommand_suggestmap().
| void MapVote_Think | ( | ) |
Definition at line 521 of file sv_mapvoting.qc.
References alreadychangedlevel, autocvar_g_maplist_votable, autocvar_rescan_pending, autocvar_sv_vote_gametype, cvar_set(), DoNextMapOverride(), GameTypeVote_SetGametype(), GameTypeVote_Start(), get_nextmap, GotoNextMap(), localcmd(), Map_Goto(), Map_Goto_SetStr(), MapInfo_CurrentFeatures(), MapInfo_CurrentGametype(), MapInfo_FilterGametype(), MapInfo_ForbiddenFlags(), MapInfo_RequiredFlags(), MapVote_Init(), mapvote_initialized, mapvote_run, MapVote_Tick(), match_gametype, mv_entries, mv_winner, mv_winner_time, NULL, player_count, strfree, time, voted_gametype, and voted_gametype_string.
Referenced by CheckRules_World().
| void MapVote_Tick | ( | ) |
Definition at line 474 of file sv_mapvoting.qc.
References CS(), FOREACH_CLIENT, GetResource(), IS_REAL_CLIENT, MapVote_CheckRules_count(), MapVote_CheckRules_decide(), MapVote_ReadPlayerVote(), msg_entity, MSG_ONE, SetResourceExplicit(), SVC_FINALE, WriteByte(), and WriteString().
Referenced by MapVote_Think().
| void MapVote_UnzoneStrings | ( | ) |
Definition at line 81 of file sv_mapvoting.qc.
References mv_count, mv_entries, mv_pakfile, and strfree.
Referenced by GameTypeVote_Start(), and MapVote_Init().
| int current_gametype_index |
Definition at line 233 of file sv_mapvoting.qc.
Referenced by GameTypeVote_Start(), MapVote_Init(), and MapVote_ranked_cmp().
| bool gametypevote_finished |
Definition at line 648 of file sv_mapvoting.qc.
Referenced by GameTypeVote_Finished().