From 463e9c3ccfc51ad035ae217a520d366615043d82 Mon Sep 17 00:00:00 2001 From: Andy2 Date: Sat, 11 Sep 2010 01:23:39 -0700 Subject: [PATCH] pass langCode in reconnect case too --- xwords4/relay/crefmgr.cpp | 4 ++-- xwords4/relay/crefmgr.h | 2 +- xwords4/relay/xwrelay.cpp | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/xwords4/relay/crefmgr.cpp b/xwords4/relay/crefmgr.cpp index b24447e62..e84a883a8 100644 --- a/xwords4/relay/crefmgr.cpp +++ b/xwords4/relay/crefmgr.cpp @@ -681,7 +681,7 @@ SafeCref::SafeCref( const char* cookie, int socket, int nPlayersH, int nPlayersS /* REconnect case */ SafeCref::SafeCref( const char* connName, HostID hid, int socket, int nPlayersH, int nPlayersS, - unsigned short gameSeed ) + unsigned short gameSeed, int langCode ) : m_cref( NULL ) , m_mgr( CRefMgr::Get() ) , m_isValid( false ) @@ -689,7 +689,7 @@ SafeCref::SafeCref( const char* connName, HostID hid, CookieRef* cref; cref = m_mgr->getMakeCookieRef_locked( NULL, connName, hid, socket, nPlayersH, - nPlayersS, -1, gameSeed ); + nPlayersS, langCode, gameSeed ); if ( cref != NULL ) { m_locked = cref->Lock(); m_cref = cref; diff --git a/xwords4/relay/crefmgr.h b/xwords4/relay/crefmgr.h index 0523d7572..68abd0e51 100644 --- a/xwords4/relay/crefmgr.h +++ b/xwords4/relay/crefmgr.h @@ -185,7 +185,7 @@ class SafeCref { /* for reconnect */ SafeCref( const char* connName, HostID hid, int socket, int nPlayersH, int nPlayersS, - unsigned short gameSeed ); + unsigned short gameSeed, int langCode ); SafeCref( CookieID cid, bool failOk = false ); SafeCref( int socket ); SafeCref( CookieRef* cref ); diff --git a/xwords4/relay/xwrelay.cpp b/xwords4/relay/xwrelay.cpp index b9e88cf86..08292272d 100644 --- a/xwords4/relay/xwrelay.cpp +++ b/xwords4/relay/xwrelay.cpp @@ -164,7 +164,9 @@ cmdToStr( XWRELAY_Cmd cmd ) CASESTR(XWRELAY_DISCONNECT_YOU); CASESTR(XWRELAY_DISCONNECT_OTHER); CASESTR(XWRELAY_CONNECTDENIED); +#ifdef RELAY_HEARTBEAT CASESTR(XWRELAY_HEARTBEAT); +#endif CASESTR(XWRELAY_MSG_FROMRELAY); CASESTR(XWRELAY_MSG_TORELAY); default: @@ -379,7 +381,7 @@ processReconnect( unsigned char* bufp, int bufLen, int socket ) SafeCref scr( connName[0]? connName : NULL, srcID, socket, nPlayersH, - nPlayersT, gameSeed ); + nPlayersT, gameSeed, langCode ); success = scr.Reconnect( socket, srcID, nPlayersH, nPlayersT, gameSeed ); }