Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
vote.qh
Go to the documentation of this file.
1#pragma once
2
19//string autocvar_sv_vote_only_commands;
25
26// definitions for command selection between progs
27const float VC_ASGNMNT_BOTH = 1;
28const float VC_ASGNMNT_CLIENTONLY = 2;
29const float VC_ASGNMNT_SERVERONLY = 3;
30
31// vote selection definitions
32const float VOTE_SELECT_ABSTAIN = -2;
33const float VOTE_SELECT_REJECT = -1;
34const float VOTE_SELECT_NULL = 0;
35const float VOTE_SELECT_ACCEPT = 1;
36
37// different statuses of the current vote
38const float VOTE_NULL = 0;
39const float VOTE_NORMAL = 1;
40const float VOTE_MASTER = 2;
41
42// global vote information declarations
43entity vote_caller; // original caller of the current vote
44string vote_caller_name; // name of the vote caller
45int vote_called; // stores status of current vote (See VOTE_*)
46float vote_endtime; // time when the vote is finished
47int vote_accept_count; // total amount of players who accept the vote (counted by VoteCount() function)
48int vote_reject_count; // same as above, but rejected
49int vote_abstain_count; // same as above, but abstained
50int vote_needed_overall; // total amount of players NEEDED for a vote to pass (based on sv_vote_majority_factor)
51.bool vote_master; // flag for if the player has vote master privileges
52.float vote_waittime; // flag for how long the player must wait before they can vote again
53.int vote_selection; // flag for which vote selection the player has made (See VOTE_SELECT_*)
54string vote_called_command; // command sent by client
55string vote_called_display; // visual string of command sent by client
56string vote_parsed_command; // command which is fixed after being parsed
57string vote_parsed_display; // visual string which is fixed after being parsed
58
59// allow functions to be used in other code like world.qc and teamplay.qc
60void VoteThink();
61void VoteReset(bool verbose);
62void VoteCommand(int request, entity caller, int argc, string vote_command);
63string ValidateMap(string validated_map, entity caller);
64
65// warmup and nagger stuff
66const float RESTART_COUNTDOWN = 10;
68int readycount; // amount of players who are ready
69.bool ready; // flag for if a player is ready
70.int team_saved; // team number to restore upon map reset
71.void(entity this) reset; // if set, an entity is reset using this
72.void(entity this) reset2; // if set, an entity is reset using this (after calling ALL the reset functions for other entities)
73void reset_map(bool is_fake_round_start);
74void ReadyCount();
75void ReadyRestart_force(bool is_fake_round_start);
76void VoteCount(float first_count);
77void Nagger_Init();
78
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
limitations: NULL cannot be present elements can only be present once a maximum of IL_MAX lists can e...
bool ready
Definition main.qh:88
#define IL_NEW()
void ReadyCount()
Definition vote.qc:553
string vote_caller_name
Definition vote.qh:44
float vote_waittime
Definition vote.qh:52
const float VOTE_NORMAL
Definition vote.qh:39
string vote_called_command
Definition vote.qh:54
string vote_parsed_display
Definition vote.qh:57
int vote_needed_overall
Definition vote.qh:50
bool autocvar_sv_vote_master_callable
Definition vote.qh:12
bool autocvar_sv_vote_no_stops_vote
Definition vote.qh:17
const float VC_ASGNMNT_BOTH
Definition vote.qh:27
float vote_endtime
Definition vote.qh:46
const float VOTE_MASTER
Definition vote.qh:40
const float RESTART_COUNTDOWN
Definition vote.qh:66
IntrusiveList g_saved_team
Definition vote.qh:79
int autocvar_sv_vote_limit
Definition vote.qh:8
void VoteThink()
Definition vote.qc:336
void Nagger_Init()
Definition vote.qc:97
bool autocvar_sv_vote_change
Definition vote.qh:4
const float VOTE_SELECT_REJECT
Definition vote.qh:33
entity nagger
Definition vote.qh:67
bool autocvar_sv_vote_master
Definition vote.qh:11
void reset_map(bool is_fake_round_start)
Definition vote.qc:351
bool autocvar_sv_vote_call
Definition vote.qh:3
int team_saved
Definition vote.qh:70
string ValidateMap(string validated_map, entity caller)
Definition vote.qc:672
int vote_selection
Definition vote.qh:53
const float VC_ASGNMNT_CLIENTONLY
Definition vote.qh:28
const float VOTE_NULL
Definition vote.qh:38
int vote_accept_count
Definition vote.qh:47
string vote_parsed_command
Definition vote.qh:56
void VoteCount(float first_count)
Definition vote.qc:220
int readycount
Definition vote.qh:68
string autocvar_sv_vote_commands
Definition vote.qh:5
string vote_called_display
Definition vote.qh:55
void VoteReset(bool verbose)
Definition vote.qc:129
void VoteCommand(int request, entity caller, int argc, string vote_command)
Definition vote.qc:1431
string autocvar_sv_vote_master_commands
Definition vote.qh:13
float autocvar_sv_vote_majority_factor_of_voted
Definition vote.qh:10
bool autocvar_sv_vote_debug
Definition vote.qh:6
entity vote_caller
Definition vote.qh:43
string autocvar_sv_vote_master_password
Definition vote.qh:15
int autocvar_sv_vote_nospectators
Definition vote.qh:18
const float VOTE_SELECT_ACCEPT
Definition vote.qh:35
string autocvar_sv_vote_master_ids
Definition vote.qh:14
bool vote_master
Definition vote.qh:51
const float VOTE_SELECT_NULL
Definition vote.qh:34
float autocvar_sv_vote_stop
Definition vote.qh:22
float autocvar_sv_vote_timeout
Definition vote.qh:23
const float VC_ASGNMNT_SERVERONLY
Definition vote.qh:29
int autocvar_sv_vote_master_playerlimit
Definition vote.qh:16
float autocvar_sv_vote_wait
Definition vote.qh:24
const float VOTE_SELECT_ABSTAIN
Definition vote.qh:32
int vote_called
Definition vote.qh:45
bool autocvar_sv_vote_singlecount
Definition vote.qh:21
bool autocvar_sv_vote_override_mostrecent
Definition vote.qh:20
int vote_reject_count
Definition vote.qh:48
int vote_abstain_count
Definition vote.qh:49
void ReadyRestart_force(bool is_fake_round_start)
Definition vote.qc:441
float autocvar_sv_vote_majority_factor
Definition vote.qh:9
bool autocvar_sv_vote_gamestart
Definition vote.qh:7
#define STATIC_INIT(func)
during worldspawn
Definition static.qh:32