Xonotic
|
#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/intermission.qh>
#include <server/world.qh>
Go to the source code of this file.
Variables | |
bool | gametypevote_finished |
int | mapvote |
bool | mapvote_abstain |
int | mapvote_count |
int | mapvote_count_real |
bool | mapvote_detail |
entity | mapvote_ent |
float | mapvote_keeptwotime |
string | mapvote_maps [MAPVOTE_COUNT] |
int | mapvote_maps_flags [MAPVOTE_COUNT] |
string | mapvote_maps_pakfile [MAPVOTE_COUNT] |
int | mapvote_maps_screenshot_dir [MAPVOTE_COUNT] |
bool | mapvote_maps_suggested [MAPVOTE_COUNT] |
float | mapvote_nextthink |
bool | mapvote_run |
string | mapvote_screenshot_dirs [MAPVOTE_SCREENSHOT_DIRS_COUNT] |
const int | MAPVOTE_SCREENSHOT_DIRS_COUNT = 4 |
int | mapvote_screenshot_dirs_count |
int | mapvote_selections [MAPVOTE_COUNT] |
int | mapvote_suggestion_ptr |
string | mapvote_suggestions [MAPVOTE_COUNT] |
float | mapvote_timeout |
int | mapvote_voters |
Definition at line 751 of file mapvoting.qc.
References GameTypeVote_AvailabilityStatus(), GameTypeVote_Type_FromString(), mapvote_count, mapvote_maps, mapvote_maps_flags, mapvote_maps_pakfile, mapvote_maps_screenshot_dir, mapvote_maps_suggested, NULL, and strzone().
Referenced by GameTypeVote_Start().
Definition at line 58 of file mapvoting.qc.
References autocvar_nextmap, cvar_string(), MapInfo_Get_ByName(), MapInfo_Map_supportedGametypes, MapInfo_Type_FromString(), NULL, and strcat().
Referenced by GameTypeVote_AddVotable().
Definition at line 733 of file mapvoting.qc.
References gametypevote, gametypevote_finished, GameTypeVote_SetGametype(), GameTypeVote_Type_FromString(), localcmd, LOG_TRACE, and mapvote_maps.
Referenced by MapVote_Finished().
int GameTypeVote_GetMask | ( | ) |
Definition at line 84 of file mapvoting.qc.
References argv(), autocvar_sv_vote_gametype_options, GameTypeVote_Type_FromString(), min(), and tokenizebyseparator.
Referenced by GameTypeVote_MapInfo_FixName().
Definition at line 95 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 315 of file mapvoting.qc.
References cvar_string(), mapvote_abstain, mapvote_count, mapvote_maps, mapvote_maps_flags, strcat(), WriteByte(), and WriteString().
Referenced by MapVote_SendEntity().
Definition at line 697 of file mapvoting.qc.
References autocvar_g_maplist_shuffle, bprint(), cvar_set(), getlsmaps(), MapInfo_count, MapInfo_CurrentFeatures(), MapInfo_CurrentGametype(), MapInfo_Enumerate(), MapInfo_FilterGametype(), MapInfo_ForbiddenFlags(), MapInfo_ListAllowedMaps(), MapInfo_RequiredFlags(), MapInfo_SwitchGameType(), MapInfo_Type_ToString(), ShuffleMaplist(), strunzone(), and strzone().
Referenced by GameTypeVote_Finished().
bool GameTypeVote_Start | ( | ) |
Definition at line 773 of file mapvoting.qc.
References argv(), autocvar_g_maplist_votable_nodetail, autocvar_sv_vote_gametype_keeptwotime, autocvar_sv_vote_gametype_options, autocvar_sv_vote_gametype_timeout, gametypevote, GameTypeVote_AddVotable(), MapInfo_CurrentGametype(), MapInfo_Type_ToString(), mapvote_abstain, MapVote_ClearAllVotes(), mapvote_count, mapvote_count_real, mapvote_detail, MapVote_Finished(), mapvote_keeptwotime, mapvote_maps, mapvote_maps_flags, MapVote_Spawn(), mapvote_timeout, MapVote_UnzoneStrings(), min(), 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 49 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 159 of file mapvoting.qc.
References MapInfo_CheckMap(), mapvote_count, mapvote_maps, mapvote_maps_flags, mapvote_maps_pakfile, mapvote_maps_screenshot_dir, mapvote_maps_suggested, mapvote_screenshot_dirs, mapvote_screenshot_dirs_count, strcat(), string_null, strstrofs, strzone(), and substring().
Referenced by MapVote_Init().
void MapVote_CheckRules_1 | ( | ) |
Definition at line 480 of file mapvoting.qc.
References FOREACH_CLIENT, IS_REAL_CLIENT, mapvote_count, mapvote_maps_flags, mapvote_selections, and mapvote_voters.
Referenced by MapVote_Tick().
bool MapVote_CheckRules_2 | ( | ) |
Definition at line 501 of file mapvoting.qc.
References autocvar_sv_eventlog, autocvar_sv_vote_gametype_default_current, error(), ftos(), GameLogEcho(), gametypevote, MapInfo_CurrentGametype(), MapInfo_Type_ToString(), mapvote_abstain, mapvote_count, mapvote_count_real, MapVote_Finished(), mapvote_keeptwotime, mapvote_maps, mapvote_maps_flags, mapvote_selections, mapvote_timeout, MapVote_TouchMask(), mapvote_voters, RandomSelection_AddFloat, RandomSelection_best_priority, RandomSelection_chosen_float, RandomSelection_Init(), result, strcat(), and time.
Referenced by MapVote_Tick().
void MapVote_ClearAllVotes | ( | ) |
Definition at line 105 of file mapvoting.qc.
References FOREACH_CLIENT.
Referenced by GameTypeVote_Start(), and MapVote_Init().
Definition at line 422 of file mapvoting.qc.
References alreadychangedlevel, autocvar_nextmap, autocvar_sv_eventlog, FixClientCvars(), FOREACH_CLIENT, ftos(), GameLogEcho(), gametypevote, GameTypeVote_Finished(), IS_REAL_CLIENT, Map_Goto(), Map_Goto_SetStr(), mapvote_count, MapVote_Init(), mapvote_maps, mapvote_maps_flags, mapvote_maps_suggested, mapvote_selections, mapvote_voters, result, and strcat().
Referenced by GameTypeVote_Start(), and MapVote_CheckRules_2().
void MapVote_Init | ( | ) |
Definition at line 200 of file mapvoting.qc.
References argv(), autocvar_g_maplist_shuffle, autocvar_g_maplist_votable, autocvar_g_maplist_votable_abstain, autocvar_g_maplist_votable_keeptwotime, autocvar_g_maplist_votable_nodetail, autocvar_g_maplist_votable_screenshot_dir, autocvar_g_maplist_votable_suggestions, autocvar_g_maplist_votable_timeout, boolean, bprint(), cvar_set(), floor(), GetNextMap(), localcmd, MapInfo_CurrentGametype(), MapInfo_ForbiddenFlags(), MapInfo_ListAllowedMaps(), MapInfo_RequiredFlags(), mapvote_abstain, MapVote_AddVotable(), MapVote_ClearAllVotes(), mapvote_count, mapvote_count_real, mapvote_detail, mapvote_keeptwotime, mapvote_screenshot_dirs, MAPVOTE_SCREENSHOT_DIRS_COUNT, mapvote_screenshot_dirs_count, MapVote_Spawn(), mapvote_suggestion_ptr, mapvote_suggestions, mapvote_timeout, MapVote_UnzoneStrings(), min(), random(), ShuffleMaplist(), strzone(), time, and tokenize_console.
Definition at line 340 of file mapvoting.qc.
References autocvar_nextmap, autocvar_sv_vote_gametype, gametypevote, GameTypeVote_SendOption(), MapInfo_CurrentGametype(), MapInfo_Type_ToText(), mapvote_abstain, mapvote_count, mapvote_detail, mapvote_maps_flags, mapvote_screenshot_dirs, mapvote_screenshot_dirs_count, mapvote_selections, MapVote_SendOption(), mapvote_timeout, MapVote_WriteMask(), WriteByte(), WriteCoord(), and WriteString().
Referenced by MapVote_Spawn().
Definition at line 295 of file mapvoting.qc.
References mapvote_abstain, mapvote_count, mapvote_maps, mapvote_maps_pakfile, mapvote_maps_screenshot_dir, WriteByte(), and WriteString().
Referenced by MapVote_SendEntity().
Definition at line 258 of file mapvoting.qc.
References mapvote_maps, mapvote_maps_screenshot_dir, mapvote_screenshot_dirs, msg_entity, MSG_ONE, strcat(), to, and WriteByte().
Referenced by ClientCommand_mv_getpicture().
void MapVote_Spawn | ( | ) |
Definition at line 407 of file mapvoting.qc.
References mapvote_ent, and MapVote_SendEntity().
Referenced by GameTypeVote_Start(), and MapVote_Init().
void MapVote_Start | ( | ) |
Definition at line 632 of file mapvoting.qc.
References MapInfo_CurrentFeatures(), MapInfo_CurrentGametype(), MapInfo_Enumerate(), MapInfo_FilterGametype(), MapInfo_ForbiddenFlags(), MapInfo_RequiredFlags(), and mapvote_run.
Referenced by CheckRules_World(), and IntermissionThink().
Definition at line 119 of file mapvoting.qc.
References autocvar_g_maplist_votable_suggestions, autocvar_g_maplist_votable_suggestions_override_mostrecent, autocvar_sv_eventlog, autocvar_sv_vote_gametype, floor(), ftos(), GameLogEcho(), gametypevote, GameTypeVote_MapInfo_FixName(), Map_IsRecent(), MapInfo_CheckMap(), mapvote_initialized, mapvote_suggestion_ptr, mapvote_suggestions, playerid, random(), strcat(), strunzone(), and strzone().
Referenced by ClientCommand_suggestmap().
void MapVote_Think | ( | ) |
Definition at line 645 of file mapvoting.qc.
References alreadychangedlevel, autocvar_g_maplist_votable, autocvar_nextmap, autocvar_rescan_pending, autocvar_sv_vote_gametype, cvar_set(), DoNextMapOverride(), GameTypeVote_Start(), GotoNextMap(), localcmd, MapInfo_CurrentFeatures(), MapInfo_CurrentGametype(), MapInfo_FilterGametype(), MapInfo_ForbiddenFlags(), MapInfo_RequiredFlags(), MapVote_Init(), mapvote_initialized, mapvote_nextthink, mapvote_run, MapVote_Tick(), player_count, and time.
Referenced by CheckRules_World().
void MapVote_Tick | ( | ) |
Definition at line 586 of file mapvoting.qc.
References CS(), FOREACH_CLIENT, GetResource(), impulse, IS_REAL_CLIENT, MapVote_CheckRules_1(), MapVote_CheckRules_2(), mapvote_count, mapvote_maps_flags, MapVote_TouchVotes(), msg_entity, MSG_ONE, RES_HEALTH, SetResourceExplicit(), SVC_FINALE, WriteByte(), and WriteString().
Referenced by MapVote_Think().
void MapVote_TouchMask | ( | ) |
Definition at line 412 of file mapvoting.qc.
References mapvote_ent.
Referenced by MapVote_CheckRules_2().
Definition at line 417 of file mapvoting.qc.
References mapvote_ent.
Referenced by MapVote_Tick().
void MapVote_UnzoneStrings | ( | ) |
Definition at line 110 of file mapvoting.qc.
References mapvote_count, mapvote_maps, mapvote_maps_pakfile, and strfree.
Referenced by GameTypeVote_Start(), and MapVote_Init().
void MapVote_WriteMask | ( | ) |
Definition at line 267 of file mapvoting.qc.
References BIT, mapvote_count, mapvote_maps_flags, WriteByte(), WriteLong(), and WriteShort().
Referenced by MapVote_SendEntity().
bool gametypevote_finished |
Definition at line 732 of file mapvoting.qc.
Referenced by GameTypeVote_Finished().
int mapvote |
Definition at line 41 of file mapvoting.qc.
bool mapvote_abstain |
Definition at line 40 of file mapvoting.qc.
Referenced by GameTypeVote_SendOption(), GameTypeVote_Start(), MapVote_CheckRules_2(), 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_CheckRules_1(), MapVote_CheckRules_2(), 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_2(), and MapVote_Init().
bool mapvote_detail |
Definition at line 39 of file mapvoting.qc.
Referenced by GameTypeVote_Start(), MapVote_Init(), and MapVote_SendEntity().
entity mapvote_ent |
Definition at line 43 of file mapvoting.qc.
Referenced by MapVote_Spawn(), MapVote_TouchMask(), and MapVote_TouchVotes().
float mapvote_keeptwotime |
Definition at line 21 of file mapvoting.qc.
Referenced by GameTypeVote_Start(), MapVote_CheckRules_2(), and MapVote_Init().
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_2(), MapVote_Finished(), MapVote_SendOption(), MapVote_SendPicture(), and MapVote_UnzoneStrings().
int mapvote_maps_flags[MAPVOTE_COUNT] |
Definition at line 37 of file mapvoting.qc.
Referenced by GameTypeVote_AddVotable(), GameTypeVote_SendOption(), GameTypeVote_Start(), MapVote_AddVotable(), MapVote_CheckRules_1(), MapVote_CheckRules_2(), MapVote_Finished(), MapVote_SendEntity(), MapVote_Tick(), and MapVote_WriteMask().
string mapvote_maps_pakfile[MAPVOTE_COUNT] |
Definition at line 31 of file mapvoting.qc.
Referenced by GameTypeVote_AddVotable(), 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().
bool mapvote_maps_suggested[MAPVOTE_COUNT] |
Definition at line 32 of file mapvoting.qc.
Referenced by GameTypeVote_AddVotable(), MapVote_AddVotable(), and MapVote_Finished().
float mapvote_nextthink |
Definition at line 20 of file mapvoting.qc.
Referenced by MapVote_Think().
bool mapvote_run |
Definition at line 38 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_1(), MapVote_CheckRules_2(), MapVote_Finished(), and MapVote_SendEntity().
int mapvote_suggestion_ptr |
Definition at line 34 of file mapvoting.qc.
Referenced by MapVote_Init(), and MapVote_Suggest().
string mapvote_suggestions[MAPVOTE_COUNT] |
Definition at line 33 of file mapvoting.qc.
Referenced by MapVote_Init(), and MapVote_Suggest().
float mapvote_timeout |
Definition at line 22 of file mapvoting.qc.
Referenced by GameTypeVote_Start(), MapVote_CheckRules_2(), MapVote_Init(), and MapVote_SendEntity().
int mapvote_voters |
Definition at line 35 of file mapvoting.qc.
Referenced by MapVote_CheckRules_1(), MapVote_CheckRules_2(), and MapVote_Finished().