remove players from db as well as runtime when ack times out

This commit is contained in:
Andy2 2010-09-16 06:49:35 -07:00
parent ca6039e890
commit 50c387d75e
3 changed files with 8 additions and 0 deletions

View file

@ -826,6 +826,7 @@ CookieRef::modPending( const CRefEvent* evt, bool keep )
if ( keep ) {
iter->m_ackPending = false;
} else {
DBMgr::Get()->RmPlayers( ConnName(), iter->m_nPlayersH );
m_sockets.erase( iter );
}
break;

View file

@ -179,6 +179,12 @@ DBMgr::AddPlayers( const char* connName, int nToAdd )
execSql( query );
}
void
DBMgr::RmPlayers( const char* connName, int nToAdd )
{
AddPlayers( connName, 0 - nToAdd );
}
void
DBMgr::AddCID( const char* const connName, CookieID cid )
{

View file

@ -42,6 +42,7 @@ class DBMgr {
char* connNameBuf, int bufLen );
void AddPlayers( const char* const connName, int nToAdd );
void RmPlayers( const char* const connName, int nToAdd );
void AddCID( const char* connName, CookieID cid );
void ClearCID( const char* connName );