From 43896ff187a4e61f418084d9f18b9810634c9098 Mon Sep 17 00:00:00 2001 From: Andy2 Date: Fri, 12 Nov 2010 18:25:15 -0800 Subject: [PATCH] remove unused method and variable --- xwords4/relay/cref.cpp | 29 ----------------------------- xwords4/relay/cref.h | 3 --- 2 files changed, 32 deletions(-) diff --git a/xwords4/relay/cref.cpp b/xwords4/relay/cref.cpp index 96b590234..472a59cf3 100644 --- a/xwords4/relay/cref.cpp +++ b/xwords4/relay/cref.cpp @@ -92,7 +92,6 @@ CookieRef::ReInit( const char* cookie, const char* connName, CookieID id, m_nPlayersHere = nAlreadyHere; m_locking_thread = 0; m_starttime = uptime(); - m_gameFull = false; m_in_handleEvents = false; m_langCode = langCode; m_nPendingAcks = 0; @@ -275,33 +274,6 @@ CookieRef::SocketForHost( HostID dest ) return socket; } -bool -CookieRef::GameOpen( const char* cookie ) -{ - bool accept = false; - /* First, do we have room. Second, are we missing this guy? */ - - if ( m_gameFull ) { - /* do nothing; reject */ - logf( XW_LOGINFO, "reject: game for %s is full", cookie ); - } else if ( m_curState != XWS_INITED - && m_curState != XWS_WAITMORE ) { - /* do nothing; reject */ - logf( XW_LOGINFO, "reject: bad state %s", stateString(m_curState) ); - } else { - accept = true; - } - - /* Error to connect if cookie doesn't match. */ - if ( accept && !!cookie && 0 != strcasecmp( cookie, Cookie() ) ) { - logf( XW_LOGERROR, "%s: not accepting b/c cookie mismatch: %s vs %s", - __func__, cookie, Cookie() ); - accept = false; - } - - return accept; -} /* GameOpen */ - bool CookieRef::AlreadyHere( unsigned short seed, int socket ) { @@ -871,7 +843,6 @@ CookieRef::postCheckAllHere() { if ( m_nPendingAcks == 0 && m_nPlayersHere == m_nPlayersSought ) { /* complete! */ - m_gameFull = true; CRefEvent evt( XWE_ALLHERE ); m_eventQueue.push_back( evt ); } diff --git a/xwords4/relay/cref.h b/xwords4/relay/cref.h index ddaae86e8..48a7720cb 100644 --- a/xwords4/relay/cref.h +++ b/xwords4/relay/cref.h @@ -98,7 +98,6 @@ class CookieRef { bool AlreadyHere( unsigned short seed, int socket ); /* reconnect case */ bool AlreadyHere( HostID hid, unsigned short seed, int socket ); - bool GameOpen( const char* cookie ); /* for console */ void _PrintCookieInfo( string& out ); @@ -254,8 +253,6 @@ class CookieRef { static void s_checkAck( void* closure ); vector m_sockets; - bool m_gameFull; /* once we've filled up, no more *new* - connections ever */ int m_heatbeat; /* might change per carrier or something. */ string m_cookie; /* cookie used for initial connections */ string m_connName; /* globally unique name */