15#include <recipientfilter.h>
96 std::array<bool, MaxPlayers> Waiting{};
104 Schema::CVoteController Controller();
107 void DropVoter(
int slot);
108 void CloseIfAllVoted();
109 void SendStart(
const Ballot& ballot);
110 void SendOutcome(
const VoteRequest& request,
bool passed);
111 void PublishBallot(
int slot,
int option);
112 void PublishCounts(
const VoteTally& tally);
114 CRecipientFilter Recipients()
const;
116 Interfaces& _interfaces;
117 EntitySystem& _entities;
118 PlayerManager& _players;
120 Scheduler& _scheduler;
123 NetMessageInfo_t* _voteStartType =
nullptr;
124 NetMessageInfo_t* _votePassType =
nullptr;
125 NetMessageInfo_t* _voteFailedType =
nullptr;
126 std::optional<Ballot> _running;
128 Subscription _leaving;
runtime.Entities: finds and creates entities. Everything it returns is valid for this frame only; see...
Creates, fires and listens to game events.
The roster: every connected player, and the signals for the connection lifecycle.
One-shot delays and repeating timers, run on the game thread.
Vote(const Vote &)=delete
Vote & operator=(const Vote &)=delete
Vote(Interfaces &interfaces, EntitySystem &entities, PlayerManager &players, GameEvents &events, Scheduler &scheduler)
bool TryCastBallot(int slot, std::string_view option)
bool Start(VoteRequest request)
void End(VoteEndReason reason)
@ Cancelled
an admin (or a peer feature) called it off
@ AllVoted
every eligible player cast a ballot
Centralized holder for all SDK interface pointers.
std::function< bool(const VoteTally &)> Passed
std::function< void(bool passed, VoteEndReason reason)> Finished
int Eligible
players who could vote