mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-04 20:46:28 +01:00
add commandline params that disable comms types on game creation so
relay not connecting initally can be tested.
This commit is contained in:
parent
c8e55a85a3
commit
b2b60d6c48
3 changed files with 38 additions and 0 deletions
|
@ -482,12 +482,18 @@ addDropChecks( GtkGameGlobals* globals )
|
|||
gtk_widget_show( widget );
|
||||
|
||||
widget = gtk_check_button_new_with_label( "Incoming" );
|
||||
if ( comms_getAddrDisabled( comms, typ, XP_FALSE ) ) {
|
||||
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(widget), TRUE );
|
||||
}
|
||||
g_signal_connect( GTK_OBJECT(widget), "toggled", G_CALLBACK(drop_msg_toggle),
|
||||
datum );
|
||||
gtk_box_pack_start( GTK_BOX(hbox), widget, FALSE, TRUE, 0);
|
||||
gtk_widget_show( widget );
|
||||
|
||||
widget = gtk_check_button_new_with_label( "Outgoing" );
|
||||
if ( comms_getAddrDisabled( comms, typ, XP_TRUE ) ) {
|
||||
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(widget), TRUE );
|
||||
}
|
||||
g_signal_connect( GTK_OBJECT(widget), "toggled", G_CALLBACK(drop_msg_toggle),
|
||||
(void*)(((long)datum) | 1) );
|
||||
gtk_box_pack_start( GTK_BOX(hbox), widget, FALSE, TRUE, 0);
|
||||
|
@ -572,6 +578,12 @@ createOrLoadObjects( GtkGameGlobals* globals )
|
|||
// addr.conType = params->conType;
|
||||
CommsConnType typ;
|
||||
for ( XP_U32 st = 0; addr_iter( &addr, &typ, &st ); ) {
|
||||
if ( params->commsDisableds[typ][0] ) {
|
||||
comms_setAddrDisabled( cGlobals->game.comms, typ, XP_FALSE, XP_TRUE );
|
||||
}
|
||||
if ( params->commsDisableds[typ][1] ) {
|
||||
comms_setAddrDisabled( cGlobals->game.comms, typ, XP_TRUE, XP_TRUE );
|
||||
}
|
||||
switch( typ ) {
|
||||
#ifdef XWFEATURE_RELAY
|
||||
case COMMS_CONN_RELAY:
|
||||
|
|
|
@ -635,6 +635,11 @@ typedef enum {
|
|||
,CMD_SPLITPACKETS
|
||||
,CMD_CHAT
|
||||
,CMD_USEUDP
|
||||
,CMD_DROPSENDRELAY
|
||||
,CMD_DROPRCVRELAY
|
||||
,CMD_DROPSENDSMS
|
||||
,CMD_DROPRCVSMS
|
||||
|
||||
#ifdef XWFEATURE_CROSSHAIRS
|
||||
,CMD_NOCROSSHAIRS
|
||||
#endif
|
||||
|
@ -746,6 +751,12 @@ static CmdInfoRec CmdInfoRecs[] = {
|
|||
"sections every random MOD <n> seconds to test relay reassembly" }
|
||||
,{ CMD_CHAT, true, "send-chat", "send a chat every <n> seconds" }
|
||||
,{ CMD_USEUDP, false, "use-udp", "connect to relay new-style, via udp not tcp" }
|
||||
|
||||
,{ CMD_DROPSENDRELAY, false, "drop-send-relay", "start new games with relay send disabled" }
|
||||
,{ CMD_DROPRCVRELAY, false, "drop-receive-relay", "start new games with relay receive disabled" }
|
||||
,{ CMD_DROPSENDSMS, false, "drop-send-sms", "start new games with sms send disabled" }
|
||||
,{ CMD_DROPRCVSMS, false, "drop-receive-sms", "start new games with sms receive disabled" }
|
||||
|
||||
#ifdef XWFEATURE_CROSSHAIRS
|
||||
,{ CMD_NOCROSSHAIRS, false, "hide-crosshairs",
|
||||
"don't show crosshairs on board" }
|
||||
|
@ -2349,6 +2360,20 @@ main( int argc, char** argv )
|
|||
case CMD_USEUDP:
|
||||
mainParams.useUdp = true;
|
||||
break;
|
||||
|
||||
case CMD_DROPSENDRELAY:
|
||||
mainParams.commsDisableds[COMMS_CONN_RELAY][1] = XP_TRUE;
|
||||
break;
|
||||
case CMD_DROPRCVRELAY:
|
||||
mainParams.commsDisableds[COMMS_CONN_RELAY][0] = XP_TRUE;
|
||||
break;
|
||||
case CMD_DROPSENDSMS:
|
||||
mainParams.commsDisableds[COMMS_CONN_SMS][1] = XP_TRUE;
|
||||
break;
|
||||
case CMD_DROPRCVSMS:
|
||||
mainParams.commsDisableds[COMMS_CONN_SMS][0] = XP_TRUE;
|
||||
break;
|
||||
|
||||
#ifdef XWFEATURE_CROSSHAIRS
|
||||
case CMD_NOCROSSHAIRS:
|
||||
mainParams.hideCrosshairs = XP_TRUE;
|
||||
|
|
|
@ -118,6 +118,7 @@ typedef struct LaunchParams {
|
|||
XP_U16 robotThinkMin, robotThinkMax;
|
||||
XP_U16 robotTradePct;
|
||||
#endif
|
||||
XP_Bool commsDisableds[COMMS_CONN_NTYPES][2];
|
||||
|
||||
DeviceRole serverRole;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue