]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/command/vote.qh
Merge branch 'master' into LegendaryGuard/cyber
[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 int autocvar_sv_vote_limit;
7 float autocvar_sv_vote_majority_factor;
8 float autocvar_sv_vote_majority_factor_of_voted;
9 bool autocvar_sv_vote_master;
10 bool autocvar_sv_vote_master_callable;
11 string autocvar_sv_vote_master_commands;
12 string autocvar_sv_vote_master_password;
13 int autocvar_sv_vote_master_playerlimit;
14 bool autocvar_sv_vote_no_stops_vote;
15 int autocvar_sv_vote_nospectators;
16 //string autocvar_sv_vote_only_commands;
17 bool autocvar_sv_vote_override_mostrecent;
18 bool autocvar_sv_vote_singlecount;
19 float autocvar_sv_vote_stop;
20 float autocvar_sv_vote_timeout;
21 float autocvar_sv_vote_wait;
22 bool autocvar_sv_vote_gamestart;
23
24 // definitions for command selection between progs
25 const float VC_ASGNMNT_BOTH = 1;
26 const float VC_ASGNMNT_CLIENTONLY = 2;
27 const float VC_ASGNMNT_SERVERONLY = 3;
28
29 // vote selection definitions
30 const float VOTE_SELECT_ABSTAIN = -2;
31 const float VOTE_SELECT_REJECT = -1;
32 const float VOTE_SELECT_NULL = 0;
33 const float VOTE_SELECT_ACCEPT = 1;
34
35 // different statuses of the current vote
36 const float VOTE_NULL = 0;
37 const float VOTE_NORMAL = 1;
38 const float VOTE_MASTER = 2;
39
40 // z411 vote targets
41 const float VOTE_TARGET_ALL = 0;
42 const float VOTE_TARGET_TEAM = 1;
43 const float VOTE_TARGET_SINGLE = 2;
44
45 // global vote information declarations
46 entity vote_caller;         // original caller of the current vote
47 string vote_caller_name;    // name of the vote caller
48 float vote_called;          // stores status of current vote (See VOTE_*)
49 float vote_endtime;         // time when the vote is finished
50 float vote_accept_count;    // total amount of players who accept the vote (counted by VoteCount() function)
51 float vote_reject_count;    // same as above, but rejected
52 float vote_abstain_count;   // same as above, but abstained
53 float vote_needed_overall;  // total amount of players NEEDED for a vote to pass (based on sv_vote_majority_factor)
54 float vote_target_type; // z411
55 entity vote_target; // z411
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 world.qc and teamplay.qc
65 void VoteThink();
66 void VoteReset();
67 void VoteCommand(int request, entity caller, int 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 ready;                      // flag for if a player is ready
74 .float last_ready;                                 // z411 time of the last readyup for anti-spam
75 .int team_saved;                   // team number to restore upon map reset
76 .void(entity this) reset;              // if set, an entity is reset using this
77 .void(entity this) reset2;         // if set, an entity is reset using this (after calling ALL the reset functions for other entities)
78 void reset_map(float dorespawn, bool is_fake_round_start);
79 void ReadyCount();
80 void ReadyRestart_force(bool is_fake_round_start);
81 void VoteCount(float first_count);
82 void Nagger_Init();
83
84 IntrusiveList g_saved_team;
85 STATIC_INIT(g_saved_team) { g_saved_team = IL_NEW(); }