Skip to content

Instantly share code, notes, and snippets.

@ProdigySim
Created October 14, 2020 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ProdigySim/73c9d1d5b13c42c4585068034d32822b to your computer and use it in GitHub Desktop.
Save ProdigySim/73c9d1d5b13c42c4585068034d32822b to your computer and use it in GitHub Desktop.
void CGameclient::ExecuteStringcommand() {
double now = getRealTime();
int maxCmdsPerSecond = sv_quota_stringcmdspersecond->GetInt();
if ( now - this->m_dLastCmdTime < 1.0 )
{
this->m_cmdQuotaCount = this->m_cmdQuotaCount + 1;
}
else
{
this->m_dLastCmdTime = now;
this->m_cmdQuotaCount = 1;
}
if ( maxCmdsPerSecond < this->m_cmdQuotaCount ) {
// Disconnected: Issued too many commands"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment