]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/command/vote.qh
Merge branch 'master' into Mario/showspecs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / vote.qh
1 #ifndef VOTE_H
2 #define VOTE_H
3
4 // ================================================
5 //  Declarations for the vote system/vote commands
6 //  Last updated: December 14th, 2011
7 // ================================================
8
9 // definitions for command selection between progs
10 const float VC_ASGNMNT_BOTH = 1;
11 const float VC_ASGNMNT_CLIENTONLY = 2;
12 const float VC_ASGNMNT_SERVERONLY = 3;
13
14 // vote selection definitions
15 const float VOTE_SELECT_ABSTAIN = -2;
16 const float VOTE_SELECT_REJECT = -1;
17 const float VOTE_SELECT_NULL = 0;
18 const float VOTE_SELECT_ACCEPT = 1;
19
20 // different statuses of the current vote
21 const float VOTE_NULL = 0;
22 const float VOTE_NORMAL = 1;
23 const float VOTE_MASTER = 2;
24
25 // global vote information declarations
26 entity vote_caller; // original caller of the current vote
27 float vote_called; // stores status of current vote (See VOTE_*)
28 float vote_endtime; // time when the vote is finished
29 float vote_accept_count; // total amount of players who accept the vote (counted by VoteCount() function)
30 float vote_reject_count; // same as above, but rejected
31 float vote_abstain_count; // same as above, but abstained
32 float vote_needed_overall; // total amount of players NEEDED for a vote to pass (based on sv_vote_majority_factor)
33 .float vote_master; // flag for if the player has vote master privelages
34 .float vote_waittime; // flag for how long the player must wait before they can vote again
35 .float vote_selection; // flag for which vote selection the player has made (See VOTE_SELECT_*)
36 string vote_called_command; // command sent by client
37 string vote_called_display; // visual string of command sent by client
38 string vote_parsed_command; // command which is fixed after being parsed
39 string vote_parsed_display; // visual string which is fixed after being parsed
40
41 // allow functions to be used in other code like g_world.qc and teamplay.qc
42 void VoteThink();
43 void VoteReset();
44 void VoteCommand(float request, entity caller, float argc, string vote_command);
45
46 // warmup and nagger stuff
47 const float RESTART_COUNTDOWN = 10;
48 entity nagger;
49 float readycount; // amount of players who are ready
50 float readyrestart_happened; // keeps track of whether a restart has already happened
51 float restart_mapalreadyrestarted; // bool, indicates whether reset_map() was already executed
52 .float ready; // flag for if a player is ready
53 void reset_map(float dorespawn);
54 void ReadyCount();
55 #endif