include game name in invitation

This commit is contained in:
Eric House 2015-02-12 07:48:15 -08:00
parent f4a691da6b
commit 270f2922b1
2 changed files with 13 additions and 5 deletions

View file

@ -1184,8 +1184,7 @@ public class BoardDelegate extends DelegateBase
{
String data = null;
if ( 0 < m_nMissing ) { // Isn't there a better test??
NetLaunchInfo nli = new NetLaunchInfo( m_gi.gameID, m_gi.dictLang,
m_gi.dictName, m_gi.nPlayers );
NetLaunchInfo nli = new NetLaunchInfo( m_gi );
Assert.assertTrue( 0 <= m_nGuestDevs );
nli.forceChannel = 1 + m_nGuestDevs;
for ( Iterator<CommsConnType> iter = m_connTypes.iterator();
@ -1808,6 +1807,7 @@ public class BoardDelegate extends DelegateBase
{
if ( 0 == m_jniGamePtr ) {
try {
String gameName = DBUtils.getName( m_activity, m_rowid );
String[] dictNames = GameUtils.dictNames( m_activity, m_rowid );
DictUtils.DictPairs pairs = DictUtils.openDicts( m_activity, dictNames );
@ -1819,6 +1819,7 @@ public class BoardDelegate extends DelegateBase
byte[] stream = GameUtils.savedGame( m_activity, m_gameLock );
m_gi = new CurGameInfo( m_activity );
m_gi.setName( gameName );
XwJNI.gi_from_stream( m_gi, stream );
DbgUtils.logf( "BoardDelegate:after loadGame: gi.nPlayers: %d", m_gi.nPlayers );
String langName = m_gi.langName();

View file

@ -99,7 +99,7 @@ public class NetLaunchInfo {
lang = bundle.getInt( MultiService.LANG );
forceChannel = bundle.getInt( MultiService.FORCECHANNEL );
dict = bundle.getString( MultiService.DICT );
gameName= bundle.getString( MultiService.GAMENAME );
gameName = bundle.getString( MultiService.GAMENAME );
nPlayersT = bundle.getInt( MultiService.NPLAYERST );
nPlayersH = bundle.getInt( MultiService.NPLAYERSH );
gameID = bundle.getInt( MultiService.GAMEID );
@ -164,9 +164,11 @@ public class NetLaunchInfo {
calcValid();
}
public NetLaunchInfo( int gamID, int dictLang, String dictName, int nPlayers )
public NetLaunchInfo( int gamID, String gamNam, int dictLang,
String dictName, int nPlayers )
{
this();
gameName = gamNam;
dict = dictName;
lang = dictLang;
nPlayersT = nPlayers;
@ -181,9 +183,14 @@ public class NetLaunchInfo {
forceChannel = fc;
}
public NetLaunchInfo( CurGameInfo gi )
{
this( gi.gameID, gi.getName(), gi.dictLang, gi.dictName, gi.nPlayers );
}
public NetLaunchInfo( GameSummary summary, CurGameInfo gi )
{
this( gi.gameID, gi.dictLang, gi.dictName, gi.nPlayers );
this( gi );
for ( CommsConnType typ : summary.conTypes.getTypes() ) {
DbgUtils.logf( "NetLaunchInfo(): got type %s", typ.toString() );