mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-11 08:48:06 +01:00
implement setIsServer(). With this change I've been successful --
once -- having two games on the same device play against each other.
This commit is contained in:
parent
31c594a06e
commit
14edbd7f18
1 changed files with 15 additions and 0 deletions
|
@ -604,6 +604,21 @@ public class BoardActivity extends Activity implements UtilCtxt {
|
||||||
R.string.tiles_left_title );
|
R.string.tiles_left_title );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setIsServer( boolean isServer )
|
||||||
|
{
|
||||||
|
Utils.logf( "setIsServer(%s)", isServer?"true":"false" );
|
||||||
|
DeviceRole newRole = isServer? DeviceRole.SERVER_ISSERVER
|
||||||
|
: DeviceRole.SERVER_ISCLIENT;
|
||||||
|
if ( newRole != m_gi.serverRole ) {
|
||||||
|
Utils.logf( "new role: %s; old role: %s",
|
||||||
|
newRole.toString(), m_gi.serverRole.toString() );
|
||||||
|
m_gi.serverRole = newRole;
|
||||||
|
if ( !isServer ) {
|
||||||
|
m_jniThread.handle( JNIThread.JNICmd.CMD_SWITCHCLIENT );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setTimer( int why, int when, int handle )
|
public void setTimer( int why, int when, int handle )
|
||||||
{
|
{
|
||||||
if ( null != m_timers[why] ) {
|
if ( null != m_timers[why] ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue