|
Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
|
|
#include "mapvoting.qh"#include <common/constants.qh>#include <common/mapinfo.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) |
| #define REDUCE_REMOVE_THIS | ( | idx | ) |
Referenced by MapVote_CheckRules_decide().
Definition at line 917 of file mapvoting.qc.
References GameTypeVote_AvailabilityStatus(), GameTypeVote_Type_FromString(), mapvote_count, mapvote_maps, mapvote_maps_flags, mapvote_maps_screenshot_dir, NULL, and strzone().
Referenced by GameTypeVote_Start().
Definition at line 63 of file 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 896 of file mapvoting.qc.
References cvar_set(), gametypevote, gametypevote_finished, GameTypeVote_SetGametype(), GameTypeVote_Type_FromString(), GTV_CUSTOM, MapInfo_CurrentGametype(), mapvote_maps, mapvote_maps_flags, match_gametype, strcpy, voted_gametype, and voted_gametype_string.
Referenced by MapVote_Finished().
| vector GameTypeVote_GetMask | ( | ) |
Definition at line 89 of file 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 103 of file 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 386 of file mapvoting.qc.
References cvar_string(), GTV_AVAILABLE, GTV_CUSTOM, mapvote_abstain, mapvote_count, mapvote_maps, mapvote_maps_flags, MSG_ENTITY, strcat(), WriteByte(), and WriteString().
Referenced by MapVote_SendEntity().
Definition at line 835 of file 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 936 of file 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_abstain, MapVote_ClearAllVotes(), MAPVOTE_COUNT, mapvote_count, mapvote_count_real, mapvote_detail, MapVote_Finished(), mapvote_maps, mapvote_maps_flags, mapvote_reduce_count, mapvote_reduce_time, MapVote_Spawn(), mapvote_timeout, MapVote_UnzoneStrings(), min(), strunzone(), strzone(), time, and tokenizebyseparator.
Referenced by MapVote_Think().
Definition at line 54 of file mapvoting.qc.
References cvar_string(), MapInfo_Type_FromString(), NULL, and strcat().
Referenced by GameTypeVote_AddVotable(), GameTypeVote_Finished(), and GameTypeVote_GetMask().
Definition at line 168 of file mapvoting.qc.
References GetNextMap(), GTV_AVAILABLE, MapInfo_CheckMap(), mapvote_count, mapvote_maps, mapvote_maps_flags, mapvote_maps_pakfile, mapvote_maps_screenshot_dir, mapvote_maps_suggesters, mapvote_maps_suggestions, mapvote_rng, mapvote_screenshot_dirs, mapvote_screenshot_dirs_count, 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 mapvote_maps_suggestions and mapvote_maps_suggesters from index 0 onwards. When mapvoting begins, we store the other info (pakfile, flags, screenshot_dir, 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 229 of file mapvoting.qc.
References floor(), Maplist_Close(), Maplist_Init(), MapVote_AddVotable(), mapvote_count, mapvote_maps_suggesters, mapvote_maps_suggestions, mapvote_ranked, mapvote_suggestion_ptr, min(), and random().
Referenced by MapVote_Init().
| void MapVote_CheckRules_count | ( | ) |
Definition at line 603 of file mapvoting.qc.
References FOREACH_CLIENT, GTV_AVAILABLE, heapsort(), IS_REAL_CLIENT, mapvote_count, mapvote_count_real, mapvote_maps_flags, mapvote_ranked, MapVote_ranked_cmp(), MapVote_ranked_swap(), mapvote_selections, mapvote_voters, and NULL.
Referenced by MapVote_Tick().
| bool MapVote_CheckRules_decide | ( | ) |
Definition at line 629 of file mapvoting.qc.
References autocvar_sv_eventlog, GameLogEcho(), GTV_AVAILABLE, itos, mapvote_abstain, mapvote_count, mapvote_count_real, MapVote_Finished(), mapvote_maps, mapvote_maps_flags, mapvote_ranked, mapvote_reduce_count, mapvote_reduce_time, mapvote_selections, mapvote_timeout, MapVote_TouchMask(), mapvote_voters, REDUCE_REMOVE_THIS, remove, result, strcat(), and time.
Referenced by MapVote_Tick().
| void MapVote_ClearAllVotes | ( | ) |
Definition at line 113 of file mapvoting.qc.
References FOREACH_CLIENT.
Referenced by GameTypeVote_Start(), and MapVote_Init().
Definition at line 517 of file 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_count, MapVote_Init(), mapvote_maps, mapvote_maps_flags, mapvote_maps_suggesters, mapvote_selections, mapvote_voters, MapVote_Winner(), result, strcat(), strfree, and voted_gametype_string.
Referenced by GameTypeVote_Start(), and MapVote_CheckRules_decide().
| void MapVote_Init | ( | ) |
Definition at line 278 of file 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_abstain, MapVote_AddVotable(), MapVote_AddVotableMaps(), MapVote_ClearAllVotes(), MAPVOTE_COUNT, mapvote_count, mapvote_count_real, mapvote_detail, mapvote_reduce_count, mapvote_reduce_time, mapvote_screenshot_dirs, MAPVOTE_SCREENSHOT_DIRS_COUNT, mapvote_screenshot_dirs_count, mapvote_show_suggester, MapVote_Spawn(), mapvote_suggestion_ptr, mapvote_timeout, MapVote_UnzoneStrings(), match_gametype, min(), strzone(), time, and tokenize_console.
Definition at line 578 of file mapvoting.qc.
References current_gametype_index, entity(), GTV_AVAILABLE, mapvote_maps_flags, mapvote_ranked, mapvote_rng, mapvote_selections, pass, and TC.
Referenced by MapVote_CheckRules_count().
Definition at line 571 of file mapvoting.qc.
References entity(), mapvote_ranked, pass, and TC.
Referenced by MapVote_CheckRules_count().
Definition at line 413 of file mapvoting.qc.
References autocvar_sv_vote_gametype, BIT, cvar_string(), entity(), gametypevote, GameTypeVote_SendOption(), get_nextmap, GTV_AVAILABLE, MapInfo_Type_ToString(), MapInfo_Type_ToText(), mapvote_abstain, mapvote_count, mapvote_detail, mapvote_maps_flags, mapvote_ranked, mapvote_screenshot_dirs, mapvote_screenshot_dirs_count, mapvote_selections, MapVote_SendOption(), mapvote_timeout, mapvote_winner, mapvote_winner_time, MapVote_WriteMask(), MSG_ENTITY, strcat(), voted_gametype, voted_gametype_string, WriteByte(), WriteChar(), WriteCoord(), WriteHeader, and WriteString().
Referenced by MapVote_Spawn().
Definition at line 366 of file mapvoting.qc.
References mapvote_abstain, mapvote_count, mapvote_maps, mapvote_maps_pakfile, mapvote_maps_screenshot_dir, mapvote_maps_suggesters, mapvote_show_suggester, MSG_ENTITY, WriteByte(), and WriteString().
Referenced by MapVote_SendEntity().
Definition at line 332 of file mapvoting.qc.
References entity(), mapvote_maps, mapvote_maps_screenshot_dir, mapvote_screenshot_dirs, msg_entity, MSG_ONE, strcat(), WriteByte(), and WriteHeader.
Referenced by ClientCommand_mv_getpicture().
| void MapVote_Spawn | ( | ) |
Definition at line 495 of file mapvoting.qc.
References mapvote_ent, MapVote_SendEntity(), and Net_LinkEntity().
Referenced by GameTypeVote_Start(), and MapVote_Init().
| void MapVote_Start | ( | ) |
Definition at line 743 of file 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 130 of file 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, mapvote_maps_suggesters, mapvote_maps_suggestions, mapvote_suggestion_ptr, netname, playerid, random(), strcat(), strunzone(), and strzone().
Referenced by ClientCommand_suggestmap().
| void MapVote_Think | ( | ) |
Definition at line 758 of file 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_maps, mapvote_nextthink, mapvote_run, MapVote_Tick(), mapvote_timeout, mapvote_winner, mapvote_winner_time, match_gametype, NULL, player_count, strfree, time, voted_gametype, and voted_gametype_string.
Referenced by CheckRules_World().
| void MapVote_Tick | ( | ) |
Definition at line 702 of file mapvoting.qc.
References CS(), FOREACH_CLIENT, GetResource(), GTV_AVAILABLE, impulse, IS_REAL_CLIENT, MapVote_CheckRules_count(), MapVote_CheckRules_decide(), mapvote_count, mapvote_maps_flags, MapVote_TouchVotes(), msg_entity, MSG_ONE, SetResourceExplicit(), SVC_FINALE, WriteByte(), and WriteString().
Referenced by MapVote_Think().
| void MapVote_TouchMask | ( | ) |
Definition at line 500 of file mapvoting.qc.
References BIT, and mapvote_ent.
Referenced by MapVote_CheckRules_decide().
Definition at line 505 of file mapvoting.qc.
References BIT, entity(), and mapvote_ent.
Referenced by MapVote_Tick().
| void MapVote_UnzoneStrings | ( | ) |
Definition at line 120 of file mapvoting.qc.
References mapvote_count, mapvote_maps, mapvote_maps_pakfile, and strfree.
Referenced by GameTypeVote_Start(), and MapVote_Init().
Definition at line 510 of file mapvoting.qc.
References BIT, mapvote_ent, mapvote_winner, mapvote_winner_time, and time.
Referenced by MapVote_Finished().
| void MapVote_WriteMask | ( | ) |
Definition at line 341 of file mapvoting.qc.
References BIT, GTV_AVAILABLE, mapvote_count, mapvote_maps_flags, MSG_ENTITY, WriteByte(), WriteLong(), and WriteShort().
Referenced by MapVote_SendEntity().
| int current_gametype_index |
Definition at line 277 of file mapvoting.qc.
Referenced by GameTypeVote_Start(), MapVote_Init(), and MapVote_ranked_cmp().
| bool gametypevote_finished |
Definition at line 895 of file mapvoting.qc.
Referenced by GameTypeVote_Finished().
| int mapvote |
Definition at line 49 of file mapvoting.qc.
| bool mapvote_abstain |
Definition at line 47 of file mapvoting.qc.
Referenced by GameTypeVote_SendOption(), GameTypeVote_Start(), MapVote_CheckRules_decide(), MapVote_Init(), MapVote_SendEntity(), and MapVote_SendOption().
| int mapvote_count |
Definition at line 27 of file mapvoting.qc.
Referenced by GameTypeVote_AddVotable(), GameTypeVote_SendOption(), GameTypeVote_Start(), MapVote_AddVotable(), MapVote_AddVotableMaps(), MapVote_CheckRules_count(), MapVote_CheckRules_decide(), MapVote_Finished(), MapVote_Init(), MapVote_SendEntity(), MapVote_SendOption(), MapVote_Tick(), MapVote_UnzoneStrings(), and MapVote_WriteMask().
| int mapvote_count_real |
Definition at line 28 of file mapvoting.qc.
Referenced by GameTypeVote_Start(), MapVote_CheckRules_count(), MapVote_CheckRules_decide(), and MapVote_Init().
| int mapvote_detail |
Definition at line 46 of file mapvoting.qc.
Referenced by GameTypeVote_Start(), MapVote_Init(), and MapVote_SendEntity().
| entity mapvote_ent |
Definition at line 51 of file mapvoting.qc.
Referenced by MapVote_Spawn(), MapVote_TouchMask(), MapVote_TouchVotes(), and MapVote_Winner().
| string mapvote_maps[MAPVOTE_COUNT] |
Definition at line 29 of file mapvoting.qc.
Referenced by GameTypeVote_AddVotable(), GameTypeVote_Finished(), GameTypeVote_SendOption(), GameTypeVote_Start(), MapVote_AddVotable(), MapVote_CheckRules_decide(), MapVote_Finished(), MapVote_SendOption(), MapVote_SendPicture(), MapVote_Think(), and MapVote_UnzoneStrings().
| int mapvote_maps_flags[MAPVOTE_COUNT] |
Definition at line 37 of file mapvoting.qc.
Referenced by GameTypeVote_AddVotable(), GameTypeVote_Finished(), GameTypeVote_SendOption(), GameTypeVote_Start(), MapVote_AddVotable(), MapVote_CheckRules_count(), MapVote_CheckRules_decide(), MapVote_Finished(), MapVote_ranked_cmp(), MapVote_SendEntity(), MapVote_Tick(), and MapVote_WriteMask().
| string mapvote_maps_pakfile[MAPVOTE_COUNT] |
Definition at line 31 of file mapvoting.qc.
Referenced by MapVote_AddVotable(), MapVote_SendOption(), and MapVote_UnzoneStrings().
| int mapvote_maps_screenshot_dir[MAPVOTE_COUNT] |
Definition at line 30 of file mapvoting.qc.
Referenced by GameTypeVote_AddVotable(), MapVote_AddVotable(), MapVote_SendOption(), and MapVote_SendPicture().
| string mapvote_maps_suggesters[MAPVOTE_COUNT] |
Definition at line 32 of file mapvoting.qc.
Referenced by MapVote_AddVotable(), MapVote_AddVotableMaps(), MapVote_Finished(), MapVote_SendOption(), and MapVote_Suggest().
| string mapvote_maps_suggestions[MAPVOTE_COUNT] |
Definition at line 33 of file mapvoting.qc.
Referenced by MapVote_AddVotable(), MapVote_AddVotableMaps(), and MapVote_Suggest().
| float mapvote_nextthink |
Definition at line 19 of file mapvoting.qc.
Referenced by MapVote_Think().
| int mapvote_ranked[MAPVOTE_COUNT] |
Definition at line 38 of file mapvoting.qc.
Referenced by MapVote_AddVotableMaps(), MapVote_CheckRules_count(), MapVote_CheckRules_decide(), MapVote_ranked_cmp(), MapVote_ranked_swap(), and MapVote_SendEntity().
| int mapvote_reduce_count |
Definition at line 21 of file mapvoting.qc.
Referenced by GameTypeVote_Start(), MapVote_CheckRules_decide(), and MapVote_Init().
| float mapvote_reduce_time |
Definition at line 20 of file mapvoting.qc.
Referenced by GameTypeVote_Start(), MapVote_CheckRules_decide(), and MapVote_Init().
| float mapvote_rng[MAPVOTE_COUNT] |
Definition at line 39 of file mapvoting.qc.
Referenced by MapVote_AddVotable(), and MapVote_ranked_cmp().
| bool mapvote_run |
Definition at line 45 of file mapvoting.qc.
Referenced by MapVote_Start(), and MapVote_Think().
| string mapvote_screenshot_dirs[MAPVOTE_SCREENSHOT_DIRS_COUNT] |
Definition at line 24 of file mapvoting.qc.
Referenced by MapVote_AddVotable(), MapVote_Init(), MapVote_SendEntity(), and MapVote_SendPicture().
| const int MAPVOTE_SCREENSHOT_DIRS_COUNT = 4 |
Definition at line 23 of file mapvoting.qc.
Referenced by MapVote_Init().
| int mapvote_screenshot_dirs_count |
Definition at line 25 of file mapvoting.qc.
Referenced by MapVote_AddVotable(), MapVote_Init(), and MapVote_SendEntity().
| int mapvote_selections[MAPVOTE_COUNT] |
Definition at line 36 of file mapvoting.qc.
Referenced by MapVote_CheckRules_count(), MapVote_CheckRules_decide(), MapVote_Finished(), MapVote_ranked_cmp(), and MapVote_SendEntity().
| bool mapvote_show_suggester |
Definition at line 48 of file mapvoting.qc.
Referenced by MapVote_Init(), and MapVote_SendOption().
| int mapvote_suggestion_ptr |
Definition at line 34 of file mapvoting.qc.
Referenced by MapVote_AddVotableMaps(), MapVote_Init(), and MapVote_Suggest().
| float mapvote_timeout |
Definition at line 22 of file mapvoting.qc.
Referenced by GameTypeVote_Start(), MapVote_CheckRules_decide(), MapVote_Init(), MapVote_SendEntity(), and MapVote_Think().
| int mapvote_voters |
Definition at line 35 of file mapvoting.qc.
Referenced by MapVote_CheckRules_count(), MapVote_CheckRules_decide(), and MapVote_Finished().
| int mapvote_winner |
Definition at line 411 of file mapvoting.qc.
Referenced by MapVote_SendEntity(), MapVote_Think(), and MapVote_Winner().
| float mapvote_winner_time |
Definition at line 412 of file mapvoting.qc.
Referenced by MapVote_SendEntity(), MapVote_Think(), and MapVote_Winner().
| Gametype match_gametype |
Definition at line 276 of file mapvoting.qc.
Referenced by GameTypeVote_Finished(), GameTypeVote_SetGametype(), MapVote_Init(), and MapVote_Think().
| Gametype voted_gametype |
Definition at line 275 of file mapvoting.qc.
Referenced by GameTypeVote_Finished(), MapVote_SendEntity(), and MapVote_Think().
| string voted_gametype_string |
Definition at line 274 of file mapvoting.qc.
Referenced by GameTypeVote_Finished(), MapVote_Finished(), MapVote_SendEntity(), and MapVote_Think().