mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
when resetting game, if it's multi-device but doesn't have a default
address (as will be the case if it was just created), get and give it one.
This commit is contained in:
parent
3cbda7471c
commit
e1b7a0f44d
1 changed files with 8 additions and 0 deletions
|
@ -28,6 +28,7 @@ import java.util.ArrayList;
|
|||
import android.content.res.AssetManager;
|
||||
|
||||
import org.eehouse.android.xw4.jni.*;
|
||||
import org.eehouse.android.xw4.jni.CurGameInfo.DeviceRole;
|
||||
|
||||
public class GameUtils {
|
||||
|
||||
|
@ -65,12 +66,19 @@ public class GameUtils {
|
|||
CurGameInfo gi = new CurGameInfo( context );
|
||||
CommsAddrRec addr = null;
|
||||
|
||||
// loadMakeGame, if makinga new game, will add comms as long
|
||||
// as DeviceRole.SERVER_STANDALONE != gi.serverRole
|
||||
loadMakeGame( context, gamePtr, gi, pathIn );
|
||||
byte[] dictBytes = GameUtils.openDict( context, gi.dictName );
|
||||
|
||||
if ( XwJNI.game_hasComms( gamePtr ) ) {
|
||||
addr = new CommsAddrRec( context );
|
||||
XwJNI.comms_getAddr( gamePtr, addr );
|
||||
if ( CommsAddrRec.CommsConnType.COMMS_CONN_NONE == addr.conType ) {
|
||||
String relayName = CommonPrefs.getDefaultRelayHost( context );
|
||||
int relayPort = CommonPrefs.getDefaultRelayPort( context );
|
||||
XwJNI.comms_getInitialAddr( addr, relayName, relayPort );
|
||||
}
|
||||
}
|
||||
XwJNI.game_dispose( gamePtr );
|
||||
|
||||
|
|
Loading…
Reference in a new issue