mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-03 23:04:08 +01:00
make gtk include an invite ID in rematch invitations
otherwise Android refuses to accept the second "" it receives.
This commit is contained in:
parent
cb87a849ab
commit
057728c287
6 changed files with 17 additions and 4 deletions
|
@ -82,7 +82,7 @@ class XWService extends Service {
|
|||
s_seen.add( inviteID );
|
||||
}
|
||||
}
|
||||
Log.d( TAG, "checkNotDupe(%s) => %b", inviteID, !isDupe );
|
||||
Log.d( TAG, "checkNotDupe('%s') => %b", inviteID, !isDupe );
|
||||
return !isDupe;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,6 +61,13 @@ nli_setDevID( NetLaunchInfo* nli, XP_U32 devID )
|
|||
types_addType( &nli->_conTypes, COMMS_CONN_RELAY );
|
||||
}
|
||||
|
||||
void
|
||||
nli_setInviteID( NetLaunchInfo* nli, const XP_UCHAR* inviteID )
|
||||
{
|
||||
nli->inviteID[0] = '\0';
|
||||
XP_STRCAT( nli->inviteID, inviteID );
|
||||
}
|
||||
|
||||
void
|
||||
nli_saveToStream( const NetLaunchInfo* nli, XWStreamCtxt* stream )
|
||||
{
|
||||
|
|
|
@ -76,6 +76,7 @@ void nli_saveToStream( const NetLaunchInfo* invit, XWStreamCtxt* stream );
|
|||
void nli_makeAddrRec( const NetLaunchInfo* invit, CommsAddrRec* addr );
|
||||
|
||||
void nli_setDevID( NetLaunchInfo* invit, XP_U32 devID );
|
||||
void nli_setInviteID( NetLaunchInfo* invit, const XP_UCHAR* inviteID );
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1640,6 +1640,9 @@ send_invites( CommonGlobals* cGlobals, XP_U16 nPlayers,
|
|||
|
||||
NetLaunchInfo nli = {0};
|
||||
nli_init( &nli, cGlobals->gi, &addr, nPlayers, forceChannel );
|
||||
XP_UCHAR buf[32];
|
||||
snprintf( buf, sizeof(buf), "%X", makeRandomInt() );
|
||||
nli_setInviteID( &nli, buf );
|
||||
nli_setDevID( &nli, linux_getDevIDRelay( cGlobals->params ) );
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
|
@ -1558,8 +1558,8 @@ linuxChangeRoles( CommonGlobals* cGlobals )
|
|||
}
|
||||
#endif
|
||||
|
||||
static unsigned int
|
||||
defaultRandomSeed()
|
||||
unsigned int
|
||||
makeRandomInt()
|
||||
{
|
||||
/* use kernel device rather than time() so can run multiple times/second
|
||||
without getting the same results. */
|
||||
|
@ -2034,7 +2034,7 @@ main( int argc, char** argv )
|
|||
XP_Bool isServer = XP_FALSE;
|
||||
// char* portNum = NULL;
|
||||
// char* hostName = "localhost";
|
||||
unsigned int seed = defaultRandomSeed();
|
||||
unsigned int seed = makeRandomInt();
|
||||
LaunchParams mainParams;
|
||||
XP_U16 nPlayerDicts = 0;
|
||||
XP_U16 robotCount = 0;
|
||||
|
|
|
@ -111,6 +111,8 @@ const XP_UCHAR* linux_getDevID( LaunchParams* params, DevIDType* typ );
|
|||
void linux_doInitialReg( LaunchParams* params, XP_Bool idIsNew );
|
||||
XP_Bool linux_setupDevidParams( LaunchParams* params );
|
||||
|
||||
unsigned int makeRandomInt();
|
||||
|
||||
/* void initParams( LaunchParams* params ); */
|
||||
/* void freeParams( LaunchParams* params ); */
|
||||
|
||||
|
|
Loading…
Reference in a new issue