aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/server/vote_controller.cpp
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-12-03 08:54:16 -0800
committerJoe Ludwig <[email protected]>2013-12-03 08:54:16 -0800
commitbeaae8ac45a2f322a792404092d4482065bef7ef (patch)
tree747f35193ba235f0f0b070c05b53468a54559c8e /mp/src/game/server/vote_controller.cpp
parentMake .xcconfigs text files too. (diff)
downloadsource-sdk-2013-beaae8ac45a2f322a792404092d4482065bef7ef.tar.xz
source-sdk-2013-beaae8ac45a2f322a792404092d4482065bef7ef.zip
Updated the SDK with the latest code from the TF and HL2 branches
* Adds support for Visual Studio 2012 and 2013 * VR Mode: . Switches from headtrack.dll to sourcevr.dll . Improved readability of the UI in VR . Removed the IPD calibration tool. TF2 will now obey the Oculus configuration file. Use the Oculus calibration tool in your SDK or install and run "OpenVR" under Tools in Steam to calibrate your IPD. . Added dropdown to enable VR mode in the Video options. Removed the -vr command line option. . Added the ability to switch in and out of VR mode without quitting the game . By default VR mode will run full screen. To switch back to a borderless window set the vr_force_windowed convar. . Added support for VR mode on Linux * Many assorted bug fixes and other changes from Team Fortress in various shared files
Diffstat (limited to 'mp/src/game/server/vote_controller.cpp')
-rw-r--r--mp/src/game/server/vote_controller.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/mp/src/game/server/vote_controller.cpp b/mp/src/game/server/vote_controller.cpp
index d052e0f9..316974ad 100644
--- a/mp/src/game/server/vote_controller.cpp
+++ b/mp/src/game/server/vote_controller.cpp
@@ -616,11 +616,7 @@ void CVoteController::VoteControllerThink( void )
}
else
{
- // Don't track failed dedicated server votes
- if ( m_iEntityHoldingVote != DEDICATED_SERVER )
- {
- m_potentialIssues[m_iActiveIssueIndex]->OnVoteFailed();
- }
+ m_potentialIssues[m_iActiveIssueIndex]->OnVoteFailed( m_iEntityHoldingVote );
m_resetVoteTimer.Start( 5.0 );
}
}
@@ -895,34 +891,38 @@ const char *CBaseIssue::GetVotePassedString( void )
//-----------------------------------------------------------------------------
// Purpose: Store failures to prevent vote spam
//-----------------------------------------------------------------------------
-void CBaseIssue::OnVoteFailed( void )
+void CBaseIssue::OnVoteFailed( int iEntityHoldingVote )
{
- // Check for an existing match
- for ( int index = 0; index < m_FailedVotes.Count(); index++ )
+ // Don't track failed dedicated server votes
+ if ( BRecordVoteFailureEventForEntity( iEntityHoldingVote ) )
{
- FailedVote *pFailedVote = m_FailedVotes[index];
- if ( Q_strcmp( pFailedVote->szFailedVoteParameter, GetDetailsString() ) == 0 )
+ // Check for an existing match
+ for ( int index = 0; index < m_FailedVotes.Count(); index++ )
{
- int nTime = sv_vote_failure_timer.GetInt();
+ FailedVote *pFailedVote = m_FailedVotes[index];
+ if ( Q_strcmp( pFailedVote->szFailedVoteParameter, GetDetailsString() ) == 0 )
+ {
+ int nTime = sv_vote_failure_timer.GetInt();
#ifdef TF_DLL
- if ( TFGameRules() && TFGameRules()->IsMannVsMachineMode() )
- {
- nTime = sv_vote_failure_timer_mvm.GetInt();
- }
+ if ( TFGameRules() && TFGameRules()->IsMannVsMachineMode() )
+ {
+ nTime = sv_vote_failure_timer_mvm.GetInt();
+ }
#endif // TF_DLL
- pFailedVote->flLockoutTime = gpGlobals->curtime + nTime;
+ pFailedVote->flLockoutTime = gpGlobals->curtime + nTime;
- return;
+ return;
+ }
}
- }
- // Need to create a new one
- FailedVote *pNewFailedVote = new FailedVote;
- int iIndex = m_FailedVotes.AddToTail( pNewFailedVote );
- Q_strcpy( m_FailedVotes[iIndex]->szFailedVoteParameter, GetDetailsString() );
- m_FailedVotes[iIndex]->flLockoutTime = gpGlobals->curtime + sv_vote_failure_timer.GetFloat();
+ // Need to create a new one
+ FailedVote *pNewFailedVote = new FailedVote;
+ int iIndex = m_FailedVotes.AddToTail( pNewFailedVote );
+ Q_strcpy( m_FailedVotes[iIndex]->szFailedVoteParameter, GetDetailsString() );
+ m_FailedVotes[iIndex]->flLockoutTime = gpGlobals->curtime + sv_vote_failure_timer.GetFloat();
+ }
}
//-----------------------------------------------------------------------------
@@ -939,7 +939,7 @@ bool CBaseIssue::CanTeamCallVote( int iTeam ) const
bool CBaseIssue::CanCallVote( int iEntIndex, const char *pszDetails, vote_create_failed_t &nFailCode, int &nTime )
{
// Automated server vote - don't bother testing against it
- if ( iEntIndex == DEDICATED_SERVER )
+ if ( !BRecordVoteFailureEventForEntity( iEntIndex ) )
return true;
// Bogus player