]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/command/vote.qh
Update the types of some voting related globals and fields
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / vote.qh
1 #pragma once
2
3 bool autocvar_sv_vote_call;
4 bool autocvar_sv_vote_change;
5 string autocvar_sv_vote_commands;
6 int autocvar_sv_vote_limit;
7 float autocvar_sv_vote_majority_factor;
8 float autocvar_sv_vote_majority_factor_of_voted;
9 bool autocvar_sv_vote_master;
10 bool autocvar_sv_vote_master_callable;
11 string autocvar_sv_vote_master_commands;
12 string autocvar_sv_vote_master_password;
13 int autocvar_sv_vote_master_playerlimit;
14 bool autocvar_sv_vote_no_stops_vote;
15 int autocvar_sv_vote_nospectators;
16 //string autocvar_sv_vote_only_commands;
17 bool autocvar_sv_vote_override_mostrecent;
18 bool autocvar_sv_vote_singlecount;
19 float autocvar_sv_vote_stop;
20 float autocvar_sv_vote_timeout;
21 float autocvar_sv_vote_wait;
22 bool autocvar_sv_vote_gamestart;
23
24 // definitions for command selection between progs
25 const float VC_ASGNMNT_BOTH = 1;
26 const float VC_ASGNMNT_CLIENTONLY = 2;
27 const float VC_ASGNMNT_SERVERONLY = 3;
28
29 // vote selection definitions
30 const float VOTE_SELECT_ABSTAIN = -2;
31 const float VOTE_SELECT_REJECT = -1;
32 const float VOTE_SELECT_NULL = 0;
33 const float VOTE_SELECT_ACCEPT = 1;
34
35 // different statuses of the current vote
36 const float VOTE_NULL = 0;
37 const float VOTE_NORMAL = 1;
38 const float VOTE_MASTER = 2;
39
40 // global vote information declarations
41 entity vote_caller;         // original caller of the current vote
42 string vote_caller_name;    // name of the vote caller
43 int vote_called;            // stores status of current vote (See VOTE_*)
44 float vote_endtime;         // time when the vote is finished
45 int vote_accept_count;      // total amount of players who accept the vote (counted by VoteCount() function)
46 int vote_reject_count;      // same as above, but rejected
47 int vote_abstain_count;     // same as above, but abstained
48 int vote_needed_overall;    // total amount of players NEEDED for a vote to pass (based on sv_vote_majority_factor)
49 .bool vote_master;          // flag for if the player has vote master privileges
50 .float vote_waittime;       // flag for how long the player must wait before they can vote again
51 .int vote_selection;        // flag for which vote selection the player has made (See VOTE_SELECT_*)
52 string vote_called_command; // command sent by client
53 string vote_called_display; // visual string of command sent by client
54 string vote_parsed_command; // command which is fixed after being parsed
55 string vote_parsed_display; // visual string which is fixed after being parsed
56
57 // allow functions to be used in other code like world.qc and teamplay.qc
58 void VoteThink();
59 void VoteReset();
60 void VoteCommand(int request, entity caller, int argc, string vote_command);
61
62 // warmup and nagger stuff
63 const float RESTART_COUNTDOWN = 10;
64 entity nagger;
65 int readycount;                    // amount of players who are ready
66 .bool ready;                       // flag for if a player is ready
67 .float last_ready;                 // last ready time for anti-spam
68 .int team_saved;                   // team number to restore upon map reset
69 .void(entity this) reset;          // if set, an entity is reset using this
70 .void(entity this) reset2;         // if set, an entity is reset using this (after calling ALL the reset functions for other entities)
71 void reset_map(float dorespawn, bool is_fake_round_start);
72 void ReadyCount();
73 void ReadyRestart_force(bool is_fake_round_start);
74 void VoteCount(float first_count);
75 void Nagger_Init();
76
77 IntrusiveList g_saved_team;
78 STATIC_INIT(g_saved_team) { g_saved_team = IL_NEW(); }