From 4ba1b2418c97944d89ae9f87b311871caf3d1721 Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 25 Aug 2022 11:19:50 -0700 Subject: [PATCH] cleanup: remove some relay stuff --- xwords4/linux/gtkboard.c | 13 +++++-------- xwords4/linux/gtkinvit.c | 8 +++----- xwords4/linux/gtkinvit.h | 2 +- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/xwords4/linux/gtkboard.c b/xwords4/linux/gtkboard.c index d42d5a43b..f687e575e 100644 --- a/xwords4/linux/gtkboard.c +++ b/xwords4/linux/gtkboard.c @@ -86,7 +86,6 @@ static void handle_invite_button( GtkWidget* widget, GtkGameGlobals* globals ); static void gtkShowFinalScores( const GtkGameGlobals* globals, XP_Bool ignoreTimeout ); static void send_invites( CommonGlobals* cGlobals, XP_U16 nPlayers, - XP_U32 relayDevID, const XP_UCHAR* relayID, const CommsAddrRec* addrs ); #define GTK_TRAY_HT_ROWS 3 @@ -729,7 +728,7 @@ on_board_window_shown( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals ) CommsAddrRec addr = {0}; addrFromStream( &addr, stream ); - send_invites( cGlobals, 1, 0, relayID, &addr ); + send_invites( cGlobals, 1, &addr ); } } stream_destroy( stream, NULL_XWE ); @@ -1460,19 +1459,16 @@ handle_invite_button( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals ) CommsAddrRec inviteAddr = {0}; gint nPlayers = nMissing; - XP_U32 relayDevID = 0; - XP_Bool confirmed = gtkInviteDlg( globals, &inviteAddr, &nPlayers, - &relayDevID ); + XP_Bool confirmed = gtkInviteDlg( globals, &inviteAddr, &nPlayers ); XP_LOGFF( "gtkInviteDlg() => %s", boolToStr(confirmed) ); if ( confirmed ) { - send_invites( cGlobals, nPlayers, relayDevID, NULL, &inviteAddr ); + send_invites( cGlobals, nPlayers, &inviteAddr ); } } /* handle_invite_button */ static void send_invites( CommonGlobals* cGlobals, XP_U16 nPlayers, - XP_U32 relayDevID, const XP_UCHAR* relayID, const CommsAddrRec* destAddr ) { CommsAddrRec myAddr = {0}; @@ -1515,11 +1511,12 @@ send_invites( CommonGlobals* cGlobals, XP_U16 nPlayers, linux_sms_invite( cGlobals->params, &nli, destAddr->u.sms.phone, destAddr->u.sms.port ); } - +#ifdef XWFEATURE_RELAY if ( 0 != relayDevID || !!relayID ) { XP_ASSERT( 0 != relayDevID || (!!relayID && !!relayID[0]) ); relaycon_invite( cGlobals->params, relayDevID, relayID, &nli ); } +#endif if ( addr_hasType( destAddr, COMMS_CONN_MQTT ) ) { mqttc_invite( cGlobals->params, &nli, &destAddr->u.mqtt.devID ); diff --git a/xwords4/linux/gtkinvit.c b/xwords4/linux/gtkinvit.c index c607c1f90..e14eb4d34 100644 --- a/xwords4/linux/gtkinvit.c +++ b/xwords4/linux/gtkinvit.c @@ -44,12 +44,12 @@ typedef struct _GtkInviteState { XW_DUtilCtxt* dutil; /* hang onto as optimization */ CommsAddrRec* addr; gint* nPlayersP; - XP_U32* relayDevIDp; gint maxPlayers; GtkWidget* nPlayersCombo; - /* relay */ +#ifdef XWFEATURE_RELAY GtkWidget* devID; +#endif /* BT */ GtkWidget* bthost; /* SMS */ @@ -349,14 +349,12 @@ onPageChanged( GtkNotebook* XP_UNUSED(notebook), gpointer XP_UNUSED(arg1), } XP_Bool -gtkInviteDlg( GtkGameGlobals* globals, CommsAddrRec* addr, - gint* nPlayersP, XP_U32* relayDevIDp ) +gtkInviteDlg( GtkGameGlobals* globals, CommsAddrRec* addr, gint* nPlayersP ) { GtkInviteState state = { .globals = globals, .addr = addr, .nPlayersP = nPlayersP, - .relayDevIDp = relayDevIDp, .maxPlayers = *nPlayersP, .dutil = globals->cGlobals.params->dutil, }; diff --git a/xwords4/linux/gtkinvit.h b/xwords4/linux/gtkinvit.h index 3f5cb960d..de97d81b4 100644 --- a/xwords4/linux/gtkinvit.h +++ b/xwords4/linux/gtkinvit.h @@ -24,7 +24,7 @@ /* return true if not cancelled */ XP_Bool gtkInviteDlg( GtkGameGlobals* globals, CommsAddrRec* addr, - /*inout*/ gint* nPlayers, /* out */ XP_U32* relayDevID ); + /*inout*/ gint* nPlayers ); #endif