]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/command/vote.qh
Merge branch 'drjaska/fix-race-spectating' into 'master'
[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 bool autocvar_sv_vote_debug;
7 bool autocvar_sv_vote_gamestart;
8 int autocvar_sv_vote_limit;
9 float autocvar_sv_vote_majority_factor;
10 float autocvar_sv_vote_majority_factor_of_voted;
11 bool autocvar_sv_vote_master;
12 bool autocvar_sv_vote_master_callable;
13 string autocvar_sv_vote_master_commands;
14 string autocvar_sv_vote_master_password;
15 int autocvar_sv_vote_master_playerlimit;
16 bool autocvar_sv_vote_no_stops_vote;
17 int autocvar_sv_vote_nospectators;
18 //string autocvar_sv_vote_only_commands;
19 bool autocvar_sv_vote_override_mostrecent;
20 bool autocvar_sv_vote_singlecount;
21 float autocvar_sv_vote_stop;
22 float autocvar_sv_vote_timeout;
23 float autocvar_sv_vote_wait;
24
25 // definitions for command selection between progs
26 const float VC_ASGNMNT_BOTH = 1;
27 const float VC_ASGNMNT_CLIENTONLY = 2;
28 const float VC_ASGNMNT_SERVERONLY = 3;
29
30 // vote selection definitions
31 const float VOTE_SELECT_ABSTAIN = -2;
32 const float VOTE_SELECT_REJECT = -1;
33 const float VOTE_SELECT_NULL = 0;
34 const float VOTE_SELECT_ACCEPT = 1;
35
36 // different statuses of the current vote
37 const float VOTE_NULL = 0;
38 const float VOTE_NORMAL = 1;
39 const float VOTE_MASTER = 2;
40
41 // global vote information declarations
42 entity vote_caller;         // original caller of the current vote
43 string vote_caller_name;    // name of the vote caller
44 int vote_called;            // stores status of current vote (See VOTE_*)
45 float vote_endtime;         // time when the vote is finished
46 int vote_accept_count;      // total amount of players who accept the vote (counted by VoteCount() function)
47 int vote_reject_count;      // same as above, but rejected
48 int vote_abstain_count;     // same as above, but abstained
49 int vote_needed_overall;    // total amount of players NEEDED for a vote to pass (based on sv_vote_majority_factor)
50 .bool vote_master;          // flag for if the player has vote master privileges
51 .float vote_waittime;       // flag for how long the player must wait before they can vote again
52 .int vote_selection;        // flag for which vote selection the player has made (See VOTE_SELECT_*)
53 string vote_called_command; // command sent by client
54 string vote_called_display; // visual string of command sent by client
55 string vote_parsed_command; // command which is fixed after being parsed
56 string vote_parsed_display; // visual string which is fixed after being parsed
57
58 // allow functions to be used in other code like world.qc and teamplay.qc
59 void VoteThink();
60 void VoteReset(bool verbose);
61 void VoteCommand(int request, entity caller, int argc, string vote_command);
62
63 // warmup and nagger stuff
64 const float RESTART_COUNTDOWN = 10;
65 entity nagger;
66 int readycount;                    // amount of players who are ready
67 .bool ready;                       // flag for if a player is ready
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(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(); }