This commit is contained in:
Eric House 2022-09-17 19:47:12 -07:00
parent 6b29ee92e6
commit 8a64d53f61
7 changed files with 14 additions and 24 deletions

View file

@ -3154,9 +3154,7 @@ public class BoardDelegate extends DelegateBase
private boolean tryOtherInvites( CommsAddrRec addr )
{
Log.d( TAG, "tryOtherInvites(%s)", addr );
NetLaunchInfo nli = nliForMe();
XwJNI.comms_invite( m_jniGamePtr, nli, addr );
boolean result = true;
XwJNI.comms_invite( m_jniGamePtr, nliForMe(), addr );
// Not sure what to do about this recordInviteSent stuff
CommsConnTypeSet conTypes = addr.conTypes;
@ -3164,7 +3162,7 @@ public class BoardDelegate extends DelegateBase
switch ( typ ) {
case COMMS_CONN_MQTT:
// MQTTUtils.inviteRemote( m_jniGamePtr, addr.mqtt_devID, nli );
// recordInviteSent( InviteMeans.MQTT, addr.mqtt_devID );
recordInviteSent( InviteMeans.MQTT, addr.mqtt_devID );
break;
case COMMS_CONN_BT:
// BTUtils.inviteRemote( m_activity, addr.bt_btAddr, nli );
@ -3183,7 +3181,7 @@ public class BoardDelegate extends DelegateBase
Log.d( TAG, "not inviting using addr type %s", typ );
}
}
return result;
return true;
}
private void sendNBSInviteIf( String phone, NetLaunchInfo nli,

View file

@ -542,6 +542,7 @@ public class MQTTUtils extends Thread
addToSendQueue( context, topic[0], packet );
}
// This goes away? comms_invite() is already getting called. PENDING
public static void addInvite( GamePtr game, String devID, NetLaunchInfo nli )
{
CommsAddrRec destAddr = new CommsAddrRec(CommsConnType.COMMS_CONN_MQTT)

View file

@ -2628,6 +2628,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_comms_1invite
{
XWJNI_START_GLOBALS();
CommsCtxt* comms = state->game.comms;
XP_ASSERT( NULL != comms );
if ( NULL != comms ) {
CommsAddrRec destAddr;
getJAddrRec( env, &destAddr, jaddr );

View file

@ -689,7 +689,6 @@ addrFromStreamOne( CommsAddrRec* addrP, XWStreamCtxt* stream, CommsConnType typ
break;
case COMMS_CONN_RELAY: {
IpRelay ip_relay = {{0}};
stringFromStreamHere( stream, ip_relay.invite,
sizeof(ip_relay.invite) );
stringFromStreamHere( stream, ip_relay.hostName,
@ -2881,13 +2880,14 @@ comms_checkIncomingStream( CommsCtxt* comms, XWEnv xwe, XWStreamCtxt* stream,
messageValid = parseSmallHeader( comms, xwe, stream, &stuff );
}
}
if ( messageValid ) {
state->msgID = stuff.msgID;
CNO_FMT( cbuf, stuff.channelNo );
XP_LOGFF( TAGFMT() "rcd on %s: msgID=%d, lastMsgRcd=%d ",
TAGPRMS, cbuf, stuff.msgID, stuff.lastMsgRcd );
} else {
XP_LOGFF( TAGFMT() "got message to self?", TAGPRMS );
XP_LOGFF( TAGFMT() "got message to self?", TAGPRMS ); /* firing */
}
AddressRecord* rec = NULL;

View file

@ -837,7 +837,6 @@ new_game_impl( GtkGameGlobals* globals, XP_Bool fireConnDlg )
XP_Bool success = XP_FALSE;
CommonGlobals* cGlobals = &globals->cGlobals;
CurGameInfo* gi = cGlobals->gi;
success = gtkNewGameDialog( globals, gi, &cGlobals->selfAddr,
XP_TRUE, fireConnDlg );
@ -2694,16 +2693,4 @@ loadGameNoDraw( GtkGameGlobals* globals, LaunchParams* params,
stream_destroy( stream, NULL_XWE );
return loaded;
}
XP_Bool
makeNewGame( GtkGameGlobals* globals )
{
CommonGlobals* cGlobals = &globals->cGlobals;
XP_Bool success = gtkNewGameDialog( globals, cGlobals->gi,
&cGlobals->selfAddr,
XP_TRUE, XP_FALSE );
LOG_RETURNF( "%s", boolToStr(success) );
return success;
}
#endif /* PLATFORM_GTK */

View file

@ -175,7 +175,6 @@ typedef struct GtkGameGlobals {
void initBoardGlobalsGtk( GtkGameGlobals* globals, LaunchParams* params,
const CurGameInfo* gi );
void freeGlobals( GtkGameGlobals* globals );
XP_Bool makeNewGame( GtkGameGlobals* globals );
XP_Bool loadGameNoDraw( GtkGameGlobals* globals, LaunchParams* params,
sqlite3_int64 rowid );
void destroy_board_window( GtkWidget* widget, GtkGameGlobals* globals );

View file

@ -34,6 +34,7 @@
#include "gtkask.h"
#include "device.h"
#include "gtkkpdlg.h"
#include "gtknewgame.h"
static void onNewData( GtkAppGlobals* apg, sqlite3_int64 rowid,
XP_Bool isNew );
@ -311,13 +312,16 @@ handle_newgame_button( GtkWidget* XP_UNUSED(widget), void* closure )
GtkGameGlobals* globals = calloc( 1, sizeof(*globals) );
apg->cag.params->needsNewGame = XP_FALSE;
initBoardGlobalsGtk( globals, apg->cag.params, NULL );
if ( !makeNewGame( globals ) ) {
freeGlobals( globals );
} else {
if ( gtkNewGameDialog( globals, globals->cGlobals.gi,
&globals->cGlobals.selfAddr,
XP_TRUE, XP_FALSE ) ) {
GtkWidget* gameWindow = globals->window;
globals->cGlobals.rowid = -1;
recordOpened( apg, globals );
gtk_widget_show( gameWindow );
} else {
freeGlobals( globals );
}
}