mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-06 20:45:54 +01:00
for testing, add -H option to prevent client from sending heartbeat
messages to relay.
This commit is contained in:
parent
abbd1a072f
commit
ca8877a5de
3 changed files with 18 additions and 5 deletions
|
@ -1083,7 +1083,9 @@ heartbeat_timer_func( gpointer data )
|
||||||
{
|
{
|
||||||
GtkAppGlobals* globals = (GtkAppGlobals*)data;
|
GtkAppGlobals* globals = (GtkAppGlobals*)data;
|
||||||
|
|
||||||
|
if ( !globals->cGlobals.params->noHeartbeat ) {
|
||||||
fireTimer( globals, TIMER_HEARTBEAT );
|
fireTimer( globals, TIMER_HEARTBEAT );
|
||||||
|
}
|
||||||
|
|
||||||
return (gint)0;
|
return (gint)0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,10 +165,15 @@ linux_getErrString( UtilErrID id )
|
||||||
message = "Tile assignment can't be undone.";
|
message = "Tile assignment can't be undone.";
|
||||||
break;
|
break;
|
||||||
case ERR_RELAY_BASE + XWRELAY_ERROR_TIMEOUT:
|
case ERR_RELAY_BASE + XWRELAY_ERROR_TIMEOUT:
|
||||||
message = "The relay timed you out; maybe the other players didn't show.";
|
message = "The relay timed you out; maybe the other players "
|
||||||
|
"didn't show.";
|
||||||
break;
|
break;
|
||||||
case ERR_RELAY_BASE + XWRELAY_ERROR_HEART:
|
case ERR_RELAY_BASE + XWRELAY_ERROR_HEART_YOU:
|
||||||
message = "You were disconnected from relay because it didn't hear from you in too long.";
|
message = "You were disconnected from relay because it didn't "
|
||||||
|
"hear from you in too long.";
|
||||||
|
break;
|
||||||
|
case ERR_RELAY_BASE + XWRELAY_ERROR_HEART_OTHER:
|
||||||
|
message = "The relay has lost contact with a device in this game.";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -198,6 +203,7 @@ usage( char* appName, char* msg )
|
||||||
"\t [-S] # slow robot down \n"
|
"\t [-S] # slow robot down \n"
|
||||||
"\t [-i] # print game history when game over\n"
|
"\t [-i] # print game history when game over\n"
|
||||||
"\t [-U] # call 'Undo' after game ends\n"
|
"\t [-U] # call 'Undo' after game ends\n"
|
||||||
|
"\t [-H] # Don't send heartbeats to relay\n"
|
||||||
"\t [-r name]* # same-process robot\n"
|
"\t [-r name]* # same-process robot\n"
|
||||||
"\t [-n name]* # same-process player (no network used)\n"
|
"\t [-n name]* # same-process player (no network used)\n"
|
||||||
"\t [-w pwd]* # passwd for matching local player\n"
|
"\t [-w pwd]* # passwd for matching local player\n"
|
||||||
|
@ -554,6 +560,7 @@ main( int argc, char** argv )
|
||||||
mainParams.undoWhenDone = XP_FALSE;
|
mainParams.undoWhenDone = XP_FALSE;
|
||||||
mainParams.gi.timerEnabled = XP_FALSE;
|
mainParams.gi.timerEnabled = XP_FALSE;
|
||||||
mainParams.gi.robotSmartness = SMART_ROBOT;
|
mainParams.gi.robotSmartness = SMART_ROBOT;
|
||||||
|
mainParams.noHeartbeat = XP_FALSE;
|
||||||
|
|
||||||
/* serverName = mainParams.info.clientInfo.serverName = "localhost"; */
|
/* serverName = mainParams.info.clientInfo.serverName = "localhost"; */
|
||||||
|
|
||||||
|
@ -576,7 +583,7 @@ main( int argc, char** argv )
|
||||||
#if defined PLATFORM_GTK
|
#if defined PLATFORM_GTK
|
||||||
"o"
|
"o"
|
||||||
#endif
|
#endif
|
||||||
"kKf:l:n:Nsd:a:p:e:r:b:qw:Sit:UmvcC:" );
|
"kKf:l:n:Nsd:a:p:e:r:b:qw:Sit:HUmvcC:" );
|
||||||
switch( opt ) {
|
switch( opt ) {
|
||||||
case 'h':
|
case 'h':
|
||||||
case '?':
|
case '?':
|
||||||
|
@ -649,6 +656,9 @@ main( int argc, char** argv )
|
||||||
case 'U':
|
case 'U':
|
||||||
mainParams.undoWhenDone = XP_TRUE;
|
mainParams.undoWhenDone = XP_TRUE;
|
||||||
break;
|
break;
|
||||||
|
case 'H':
|
||||||
|
mainParams.noHeartbeat = XP_TRUE;
|
||||||
|
break;
|
||||||
case 'a':
|
case 'a':
|
||||||
/* mainParams.info.clientInfo.serverName = */
|
/* mainParams.info.clientInfo.serverName = */
|
||||||
relayName = optarg;
|
relayName = optarg;
|
||||||
|
|
|
@ -56,6 +56,7 @@ typedef struct LaunchParams {
|
||||||
// XP_Bool mainParams;
|
// XP_Bool mainParams;
|
||||||
XP_Bool skipWarnings;
|
XP_Bool skipWarnings;
|
||||||
XP_Bool showRobotScores;
|
XP_Bool showRobotScores;
|
||||||
|
XP_Bool noHeartbeat;
|
||||||
|
|
||||||
Connectedness serverRole;
|
Connectedness serverRole;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue