From f45f3bacbf287259f48f0675d27f1fccf72d9590 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 17 Dec 2013 21:57:10 -0800 Subject: [PATCH] fix so invitation results in a playable game (though dictionary is not yet available to invitation recipient) --- xwords4/linux/gtkboard.c | 8 +++++--- xwords4/linux/gtkmain.c | 2 +- xwords4/linux/linuxsms.c | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/xwords4/linux/gtkboard.c b/xwords4/linux/gtkboard.c index 92177d76d..9f0182510 100644 --- a/xwords4/linux/gtkboard.c +++ b/xwords4/linux/gtkboard.c @@ -536,9 +536,11 @@ createOrLoadObjects( GtkGameGlobals* globals ) #endif #ifdef XWFEATURE_SMS case COMMS_CONN_SMS: - XP_STRNCPY( addr.u.sms.phone, params->connInfo.sms.phone, - sizeof(addr.u.sms.phone) - 1 ); - addr.u.sms.port = params->connInfo.sms.port; + /* No! Don't overwrite what may be a return address with local + stuff */ + /* XP_STRNCPY( addr.u.sms.phone, params->connInfo.sms.phone, */ + /* sizeof(addr.u.sms.phone) - 1 ); */ + /* addr.u.sms.port = params->connInfo.sms.port; */ break; #endif default: diff --git a/xwords4/linux/gtkmain.c b/xwords4/linux/gtkmain.c index 701755312..ed56a5348 100644 --- a/xwords4/linux/gtkmain.c +++ b/xwords4/linux/gtkmain.c @@ -542,8 +542,8 @@ smsInviteReceived( void* closure, const XP_UCHAR* gameName, XP_U32 gameID, CurGameInfo gi = {0}; gi_copy( MPPARM(params->mpool) &gi, ¶ms->pgi ); + gi_setNPlayers( &gi, nPlayers, nHere ); gi.gameID = gameID; - gi.nPlayers = nPlayers; gi.dictLang = dictLang; replaceStringIfDifferent( params->mpool, &gi.dictName, dictName ); diff --git a/xwords4/linux/linuxsms.c b/xwords4/linux/linuxsms.c index 561b5788c..d06aa09ea 100644 --- a/xwords4/linux/linuxsms.c +++ b/xwords4/linux/linuxsms.c @@ -225,8 +225,9 @@ dispatch_data( LinSMS2Data* storage, XP_U16 XP_UNUSED(proto), { XP_USE( addr ); XP_U32 gameID = stream_getU32( stream ); - const XP_U8* data = stream_getPtr( stream ); XP_U16 len = stream_getSize( stream ); + XP_U8 data[len]; + stream_getBytes( stream, data, len ); (*storage->procs->msgReceived)( storage->procClosure, gameID, data, len, addr );