]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/command/vote.qh
Merge remote-tracking branch 'remotes/origin/master' into TimePath/itemsys
[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 string vote_caller_name; // name of the vote caller
28 float vote_called; // stores status of current vote (See VOTE_*)
29 float vote_endtime; // time when the vote is finished
30 float vote_accept_count; // total amount of players who accept the vote (counted by VoteCount() function)
31 float vote_reject_count; // same as above, but rejected
32 float vote_abstain_count; // same as above, but abstained
33 float vote_needed_overall; // total amount of players NEEDED for a vote to pass (based on sv_vote_majority_factor)
34 .float vote_master; // flag for if the player has vote master privelages
35 .float vote_waittime; // flag for how long the player must wait before they can vote again
36 .float vote_selection; // flag for which vote selection the player has made (See VOTE_SELECT_*)
37 string vote_called_command; // command sent by client
38 string vote_called_display; // visual string of command sent by client
39 string vote_parsed_command; // command which is fixed after being parsed
40 string vote_parsed_display; // visual string which is fixed after being parsed
41
42 // allow functions to be used in other code like g_world.qc and teamplay.qc
43 void VoteThink();
44 void VoteReset();
45 void VoteCommand(float request, entity caller, float argc, string vote_command);
46
47 // warmup and nagger stuff
48 const float RESTART_COUNTDOWN = 10;
49 entity nagger;
50 float readycount; // amount of players who are ready
51 float readyrestart_happened; // keeps track of whether a restart has already happened
52 float restart_mapalreadyrestarted; // bool, indicates whether reset_map() was already executed
53 .float ready; // flag for if a player is ready
54 void reset_map(float dorespawn);
55 void ReadyCount();
56 void ReadyRestart_force();
57 #endif