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