]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/command/vote.qh
Merge branch 'master' into terencehill/lms_updates
[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 // global vote information declarations
41 entity vote_caller;         // original caller of the current vote
42 string vote_caller_name;    // name of the vote caller
43 float vote_called;          // stores status of current vote (See VOTE_*)
44 float vote_endtime;         // time when the vote is finished
45 float vote_accept_count;    // total amount of players who accept the vote (counted by VoteCount() function)
46 float vote_reject_count;    // same as above, but rejected
47 float vote_abstain_count;   // same as above, but abstained
48 float vote_needed_overall;  // total amount of players NEEDED for a vote to pass (based on sv_vote_majority_factor)
49 .float vote_master;         // flag for if the player has vote master privelages
50 .float vote_waittime;       // flag for how long the player must wait before they can vote again
51 .float vote_selection;      // flag for which vote selection the player has made (See VOTE_SELECT_*)
52 string vote_called_command; // command sent by client
53 string vote_called_display; // visual string of command sent by client
54 string vote_parsed_command; // command which is fixed after being parsed
55 string vote_parsed_display; // visual string which is fixed after being parsed
56
57 // allow functions to be used in other code like world.qc and teamplay.qc
58 void VoteThink();
59 void VoteReset();
60 void VoteCommand(int request, entity caller, int argc, string vote_command);
61
62 // warmup and nagger stuff
63 const float RESTART_COUNTDOWN = 10;
64 entity nagger;
65 float readycount;                  // amount of players who are ready
66 float readyrestart_happened;       // keeps track of whether a restart has already happened
67 float restart_mapalreadyrestarted; // bool, indicates whether reset_map() was already executed
68 .float ready;                      // flag for if a player is ready
69 .int team_saved;                   // team number to restore upon map reset
70 .void(entity this) reset;              // if set, an entity is reset using this
71 .void(entity this) reset2;         // if set, an entity is reset using this (after calling ALL the reset functions for other entities)
72 void reset_map(float dorespawn);
73 void ReadyCount();
74 void ReadyRestart_force();
75 void VoteCount(float first_count);
76 void Nagger_Init();
77
78 IntrusiveList g_saved_team;
79 STATIC_INIT(g_saved_team) { g_saved_team = IL_NEW(); }