[server] Implement CGameMode::Frame(...)

* Update `CNetGame::Process()`
This commit is contained in:
RD42
2024-06-25 22:26:45 +08:00
parent 52ee926fdd
commit 2df59766ac
3 changed files with 38 additions and 1 deletions
+29
View File
@@ -133,6 +133,35 @@ void CGameMode::Unload()
//----------------------------------------------------------------------------------
void CGameMode::Frame(float fElapsedTime)
{
if (!m_bInitialised)
return;
if (!m_bSleeping)
return;
if (m_fSleepTime > 0.0f)
{
m_fSleepTime -= fElapsedTime;
}
else
{
cell ret;
int err = amx_Exec(&m_amx, &ret, AMX_EXEC_CONT);
if (err == AMX_ERR_SLEEP)
{
m_bSleeping = true;
m_fSleepTime = ((float)ret / 1000.0f);
}
else
{
m_bSleeping = false;
AMXPrintError(this, &m_amx, err);
}
}
}
//----------------------------------------------------------------------------------
int CGameMode::CallPublic(char* szFuncName)