Skip to content

Commit 7617c2b

Browse files
committed
Don't give up after a timeout. Press Home and try again.
1 parent 4dadbdf commit 7617c2b

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

Common/Cpp/StreamConnections/ReliableStreamConnection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include "Common/CRC32/pabb_CRC32.h"
88
//#include "Common/Cpp/PrettyPrint.h"
9-
#include "Common/Cpp/Exceptions.h"
9+
//#include "Common/Cpp/Exceptions.h"
1010
#include "Common/Cpp/StreamConnections/PABotBase2_MessageDumper.h"
1111
#include "ReliableStreamConnection.h"
1212

SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramSwitch.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,12 @@ void TestProgram::program(MultiSwitchProgramEnvironment& env, CancellableScope&
517517

518518

519519

520+
#if 0
520521
UpdateMenuWatcher update_menu(console, COLOR_PURPLE);
521522
CheckOnlineWatcher check_online(COLOR_CYAN);
522523
update_menu.make_overlays(overlays);
523524
check_online.make_overlays(overlays);
524-
525+
#endif
525526

526527

527528

SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_GameEntry.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ void start_game_from_home_with_inference(
452452

453453
pbf_press_button(context, BUTTON_A, 160ms, 840ms);
454454

455-
while (true){
455+
for (int c = 0; c < 20; c++){
456456
HomeMenuWatcher home(console, std::chrono::milliseconds(2000));
457457
StartGameUserSelectWatcher user_select(console, COLOR_GREEN);
458458
UpdateMenuWatcher update_menu(console, COLOR_PURPLE);
@@ -503,13 +503,16 @@ void start_game_from_home_with_inference(
503503
console.log("Detected black screen. Game started...");
504504
return;
505505
default:
506-
OperationFailedException::fire(
507-
ErrorReport::SEND_ERROR_REPORT,
508-
"start_game_from_home_with_inference(): No recognizable state after 30 seconds.",
509-
console
510-
);
506+
console.log("start_game_from_home_with_inference(): No recognizable state after 30 seconds.", COLOR_RED);
507+
pbf_press_button(context, BUTTON_HOME, 160ms, 840ms);
511508
}
512509
}
510+
511+
OperationFailedException::fire(
512+
ErrorReport::SEND_ERROR_REPORT,
513+
"start_game_from_home_with_inference(): Failed to start game after 20 actions.",
514+
console
515+
);
513516
}
514517
void start_game_from_home_with_inference(
515518
ConsoleHandle& console, JoyconContext& context,

0 commit comments

Comments
 (0)