Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Commit

Permalink
Add a check if the server is down
Browse files Browse the repository at this point in the history
  • Loading branch information
KcrPL committed Feb 2, 2021
1 parent 2bbfee1 commit 9962771
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
18 changes: 11 additions & 7 deletions source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int main(int argc, char** argv) {

char version_major = 1;
char version_minor = 3;
char version_patch = 1;
char version_patch = 2;

printf("\n:---------------------------------------------------------:\n");
printf(" RiiConnect24 Mail Patcher - (C) RiiConnect24 ");
Expand All @@ -50,19 +50,19 @@ int main(int argc, char** argv) {
printf(" Compiled on %s at %s\n", __DATE__ , __TIME__);
printf(":---------------------------------------------------------:\n\n");

printf("Running...\n\n");
printf("Running...\n");

if (isDolphin()) {
printf(":---------------------------------------------------------------:\n"
printf("\n:---------------------------------------------------------------:\n"
": Dolphin is not supported! :\n"
": This tool can only run on a real Wii Console. :\n"
": :\n"
": Exiting in 5 seconds... :\n"
": Exiting in 10 seconds... :\n"
":---------------------------------------------------------------:\n");
sleep(5);
sleep(10);
exit(0);
} else if (CheckvWii()){
printf(":---------------------------------------------------------------:\n"
printf("\n:---------------------------------------------------------------:\n"
": vWii Detected :\n"
": This tool will still patch your nwc24msg.cfg, but you will be :\n"
": unable to fully utilize Wii Mail. :\n"
Expand All @@ -78,7 +78,11 @@ int main(int argc, char** argv) {
printf("If your previous registration failed or if you're repatching, please contact us using:\n- Discord: https://discord.gg/b4Y7jfD\n Wait time: Short, send a Direct Message to a developer.\n- E-Mail: [email protected]\n Wait time: up to 24 hours, sometimes longer\n");
printf("\nAlso, please send us your Wii Number: w");
printf("%016llu\n", friendCode);
} else if (error != 0) {
} else if (error == -128) {
printf("We're probably performing maintenance or having some issues. Hang tight!\n\nMake sure to check the status page that is linked above for more info.\n\n");
printf("\nContact info:\n- Discord: https://discord.gg/b4Y7jfD\n Wait time: Short, send a Direct Message to a developer.\n- E-Mail: [email protected]\n Wait time: up to 24 hours, sometimes longer\n");
printf("\nPress the HOME Button to exit.");
} else if (error != 0) {
printf("There was an error while patching.\nPlease make a screenshot of this error message and send it\nto a developer.\n");
printf("\nPlease contact us using:\n- Discord: https://discord.gg/b4Y7jfD\n Wait time: Short, send a Direct Message to a developer.\n- E-Mail: [email protected]\n Wait time: up to 24 hours, sometimes longer\n");
printf("\nAlso, please send us your Wii Number: w");
Expand Down
13 changes: 12 additions & 1 deletion source/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,18 @@ Cache-Control: no-cache\r\n\r\n%s",
ssl_shutdown(sslContext);
} else {
error = net_send(sock, request, sizeof(request), 0);
if (error < 0) {

if (error == -128) {
printf(":--------------------------------------------------------:");
printf("\n: RiiConnect24 Servers are currently offline. :");
printf("\n: Please check back later! :");
printf("\n: :");
printf("\n: Visit https://status.rc24.xyz for more info. :");
printf("\n:--------------------------------------------------------:\n\n");
return error;
}

if (error < 0) {
printf("net_send: error %i\n", error);
net_close(sock);
return error;
Expand Down

0 comments on commit 9962771

Please sign in to comment.