]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/command/vote.qh
Merge branch 'Mario/playerdemo_removal'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / vote.qh
1 #pragma once
2
3 // ================================================
4 //  Declarations for the vote system/vote commands
5 //  Last updated: December 14th, 2011
6 // ================================================
7
8 // definitions for command selection between progs
9 const float VC_ASGNMNT_BOTH = 1;
10 const float VC_ASGNMNT_CLIENTONLY = 2;
11 const float VC_ASGNMNT_SERVERONLY = 3;
12
13 // vote selection definitions
14 const float VOTE_SELECT_ABSTAIN = -2;
15 const float VOTE_SELECT_REJECT = -1;
16 const float VOTE_SELECT_NULL = 0;
17 const float VOTE_SELECT_ACCEPT = 1;
18
19 // different statuses of the current vote
20 const float VOTE_NULL = 0;
21 const float VOTE_NORMAL = 1;
22 const float VOTE_MASTER = 2;
23
24 // global vote information declarations
25 entity vote_caller;         // original caller of the current vote
26 string vote_caller_name;    // name of the vote caller
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 void ReadyRestart_force();
56 void VoteCount(float first_count);
57 void Nagger_Init();