diff --git a/xwords4/relay/cref.cpp b/xwords4/relay/cref.cpp index 33053b458..471fddc54 100644 --- a/xwords4/relay/cref.cpp +++ b/xwords4/relay/cref.cpp @@ -86,7 +86,6 @@ CookieRef::ReInit( const char* cookie, const char* connName, CookieID id, m_cookie = cookie==NULL?"":cookie; m_connName = connName==NULL?"":connName; m_cookieID = id; - m_totalSent = 0; m_curState = XWS_INITED; m_nPlayersSought = nPlayers; m_nPlayersHere = nAlreadyHere; @@ -132,9 +131,7 @@ CookieRef::~CookieRef() printSeeds(__func__); - logf( XW_LOGINFO, - "CookieRef for %d being deleted; sent %d bytes over lifetime", - m_cookieID, m_totalSent ); + logf( XW_LOGINFO, "CookieRef for %d being deleted", m_cookieID ); } /* ~CookieRef */ void @@ -729,7 +726,7 @@ CookieRef::send_with_length( int socket, unsigned char* buf, int bufLen, { bool failed = false; if ( send_with_length_unsafe( socket, buf, bufLen ) ) { - RecordSent( bufLen, socket ); + DBMgr::Get()->RecordSent( ConnName(), HostForSocket(socket), bufLen ); } else { failed = true; } @@ -1006,13 +1003,6 @@ CookieRef::send_msg( int socket, HostID id, XWRelayMsg msg, XWREASON why, send_with_length( socket, buf, len, cascade ); } /* send_msg */ - -void -CookieRef::RecordSent( int nBytes, int socket ) { - m_totalSent += nBytes; - DBMgr::Get()->RecordSent( ConnName(), HostForSocket(socket), nBytes ); -} - void CookieRef::notifyOthers( int socket, XWRelayMsg msg, XWREASON why ) { @@ -1311,9 +1301,6 @@ CookieRef::_PrintCookieInfo( string& out ) snprintf( buf, sizeof(buf), "id=%d\n", GetCookieID() ); out += buf; - snprintf( buf, sizeof(buf), "Bytes sent=%d\n", m_totalSent ); - out += buf; - snprintf( buf, sizeof(buf), "Total players=%d\n", m_nPlayersSought ); out += buf; snprintf( buf, sizeof(buf), "Players here=%d\n", m_nPlayersHere ); diff --git a/xwords4/relay/cref.h b/xwords4/relay/cref.h index e6638e1ec..c8c9af94a 100644 --- a/xwords4/relay/cref.h +++ b/xwords4/relay/cref.h @@ -81,7 +81,6 @@ class CookieRef { /* Within this cookie, remember that this hostID and socket go together. If the hostID is HOST_ID_SERVER, it's the server. */ CookieID GetCookieID() { return m_cookieID; } - int GetTotalSent() { return m_totalSent; } int GetPlayersSought() { return m_nPlayersSought; } int GetPlayersHere() { return m_nPlayersHere; } @@ -181,7 +180,6 @@ class CookieRef { bool cascade ); void send_msg( int socket, HostID id, XWRelayMsg msg, XWREASON why, bool cascade ); - void RecordSent( int nBytes, int socket ); void pushConnectEvent( int socket, int nPlayersH, int nPlayersS, int seed ); void pushReconnectEvent( int socket, HostID srcID, @@ -258,7 +256,6 @@ class CookieRef { string m_cookie; /* cookie used for initial connections */ string m_connName; /* globally unique name */ CookieID m_cookieID; /* Unique among current games on this server */ - int m_totalSent; /* Guard the event queue. Only one thread at a time can post to the queue, but once in a thread can post new events while processing diff --git a/xwords4/relay/crefmgr.cpp b/xwords4/relay/crefmgr.cpp index b740403c4..9efb7fab2 100644 --- a/xwords4/relay/crefmgr.cpp +++ b/xwords4/relay/crefmgr.cpp @@ -174,7 +174,6 @@ CRefMgr::GetStats( CrefMgrInfo& mgrInfo ) info.m_connName = cref->ConnName(); info.m_cookieID = cref->GetCookieID(); info.m_curState = cref->CurState(); - info.m_totalSent = cref->GetTotalSent(); info.m_nPlayersSought = cref->GetPlayersSought(); info.m_nPlayersHere = cref->GetPlayersHere(); info.m_startTime = cref->GetStarttime(); diff --git a/xwords4/relay/crefmgr.h b/xwords4/relay/crefmgr.h index f90daa20a..08c024ecd 100644 --- a/xwords4/relay/crefmgr.h +++ b/xwords4/relay/crefmgr.h @@ -50,7 +50,6 @@ class CrefInfo { string m_cookie; string m_connName; CookieID m_cookieID; - int m_totalSent; int m_nPlayersSought; int m_nPlayersHere; XW_RELAY_STATE m_curState; @@ -329,14 +328,6 @@ class SafeCref { } } - int GetTotalSent() { - if ( IsValid() ) { - return m_cref->GetTotalSent(); - } else { - return -1; /* so don't crash.... */ - } - } - int GetPlayersTotal() { if ( IsValid() ) { return m_cref->GetPlayersSought(); diff --git a/xwords4/relay/http.cpp b/xwords4/relay/http.cpp index be38a0880..d27defb87 100644 --- a/xwords4/relay/http.cpp +++ b/xwords4/relay/http.cpp @@ -152,7 +152,6 @@ printCrefs( FILE* fil, const CrefMgrInfo* info, bool isLocal ) "