aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/server/vote_controller.h
diff options
context:
space:
mode:
authorMichael Sartain <[email protected]>2014-10-02 08:25:55 -0700
committerMichael Sartain <[email protected]>2014-10-02 08:25:55 -0700
commit55ed12f8d1eb6887d348be03aee5573d44177ffb (patch)
tree3686f7ca78c780cd9a3d367b79a9d9250c1be7c0 /mp/src/game/server/vote_controller.h
parent* Added support for Visual C++ 2013 Express to VPC (diff)
downloadsource-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.tar.xz
source-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.zip
Updated the SDK with the latest code from the TF and HL2 branches.
Diffstat (limited to 'mp/src/game/server/vote_controller.h')
-rw-r--r--mp/src/game/server/vote_controller.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/mp/src/game/server/vote_controller.h b/mp/src/game/server/vote_controller.h
index 0376d6a6..ccc55cd5 100644
--- a/mp/src/game/server/vote_controller.h
+++ b/mp/src/game/server/vote_controller.h
@@ -17,7 +17,7 @@
#define MAX_COMMAND_LENGTH 64
#define MAX_CREATE_ERROR_STRING 96
-class CBaseIssue // Abstract base class for all things-that-can-be-voted-on.
+class CBaseIssue // Base class concept for vote issues (i.e. Kick Player). Created per level-load and destroyed by CVoteController's dtor.
{
public:
CBaseIssue(const char *typeString);
@@ -41,6 +41,9 @@ public:
virtual void SetYesNoVoteCount( int iNumYesVotes, int iNumNoVotes, int iNumPotentialVotes );
virtual bool GetVoteOptions( CUtlVector <const char*> &vecNames ); // We use this to generate options for voting
virtual bool BRecordVoteFailureEventForEntity( int iVoteCallingEntityIndex ) const { return iVoteCallingEntityIndex != DEDICATED_SERVER; }
+ void SetIssueCooldownDuration( float flDuration ) { m_flNextCallTime = gpGlobals->curtime + flDuration; } // The issue can not be raised again for this period of time (in seconds)
+
+ CHandle< CBasePlayer > m_hPlayerTarget; // If the target of the issue is a player, we should store them here
protected:
static void ListStandardNoArgCommand( CBasePlayer *forWhom, const char *issueString ); // List a Yes vote command
@@ -59,6 +62,7 @@ protected:
int m_iNumYesVotes;
int m_iNumNoVotes;
int m_iNumPotentialVotes;
+ float m_flNextCallTime;
};
class CVoteController : public CBaseEntity
@@ -93,7 +97,8 @@ public:
void ListIssues( CBasePlayer *pForWhom );
bool IsValidVoter( CBasePlayer *pWhom );
bool CanTeamCastVote( int iTeam ) const;
- void SendVoteFailedMessage( vote_create_failed_t nReason = VOTE_FAILED_GENERIC, CBasePlayer *pVoteCaller = NULL, int nTime = -1 );
+ void SendVoteCreationFailedMessage( vote_create_failed_t nReason, CBasePlayer *pVoteCaller, int nTime = -1 );
+ void SendVoteFailedToPassMessage( vote_create_failed_t nReason );
void VoteChoice_Increment( int nVoteChoice );
void VoteChoice_Decrement( int nVoteChoice );
int GetWinningVoteOption( void );
@@ -101,6 +106,8 @@ public:
bool CanEntityCallVote( CBasePlayer *pPlayer, int &nCooldown );
bool IsVoteActive( void ) { return m_iActiveIssueIndex != INVALID_ISSUE; }
+ void AddPlayerToKickWatchList( CSteamID steamID, float flDuration );
+
protected:
void ResetData( void );
void VoteControllerThink( void );