work around old unstarted games where gi only was saved

I think....
This commit is contained in:
Eric House 2022-09-15 08:18:20 -07:00
parent f74db30a5d
commit 5c40f175bb
2 changed files with 12 additions and 8 deletions

View file

@ -407,16 +407,19 @@ public class GameUtils {
postMoveDroppedForDictNotification( context, rowid, gi.gameID,
gi.isoCode() );
} else {
String langName = gi.langName( context );
gamePtr = XwJNI.initFromStream( rowid, stream, gi, util, null,
CommonPrefs.get(context),
tp );
CommonPrefs.get(context), tp );
if ( null == gamePtr ) {
Assert.assertTrueNR( gi.serverRole != DeviceRole.SERVER_ISCLIENT );
CommsAddrRec selfAddr = CommsAddrRec.getSelfAddr( context, gi );
gamePtr = XwJNI.initNew( gi, selfAddr, (CommsAddrRec)null,
(UtilCtxt)null, (DrawCtx)null,
CommonPrefs.get(context), null );
// Assert.assertTrueNR( gi.serverRole != DeviceRole.SERVER_ISCLIENT ); // firing
if ( DeviceRole.SERVER_ISCLIENT == gi.serverRole ) {
Log.e( TAG, "bad game? ISCLIENT, but has no host address"
+ " and won't open" );
} else {
CommsAddrRec selfAddr = CommsAddrRec.getSelfAddr( context, gi );
gamePtr = XwJNI.initNew( gi, selfAddr, (CommsAddrRec)null,
(UtilCtxt)null, (DrawCtx)null,
CommonPrefs.get(context), null );
}
}
}
}

View file

@ -378,6 +378,7 @@ game_makeFromStream( MPFORMAL XWEnv xwe, XWStreamCtxt* stream,
procs, onRoleChanged, game,
gi->forceChannel );
} else {
XP_ASSERT( NULL == game->comms );
game->comms = NULL;
}