From 5f412962cb9a3b150dfe676024ad3c893e6fe5c4 Mon Sep 17 00:00:00 2001 From: Maschell Date: Fri, 12 Jul 2024 13:23:21 +0200 Subject: [PATCH 1/3] Don't add logs to the message queue on wii u because they never get cleared --- source/log.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/log.cpp b/source/log.cpp index 8de4827..c6effd8 100644 --- a/source/log.cpp +++ b/source/log.cpp @@ -41,7 +41,7 @@ namespace constexpr auto MAX_LOGS = 250; #else /// \brief Maximum number of log messages to keep -constexpr auto MAX_LOGS = 10000; +constexpr auto MAX_LOGS = 100; #endif #ifdef CLASSIC @@ -97,9 +97,7 @@ void drawLog () #endif auto const maxLogs = -#ifdef __WIIU__ - 1000; -#elif defined(CLASSIC) +#if defined(CLASSIC) && !defined(__WIIU__) g_logConsole.windowHeight; #else MAX_LOGS; @@ -247,6 +245,10 @@ void response (char const *const fmt_, ...) void addLog (LogLevel const level_, char const *const fmt_, va_list ap_) { +#ifdef __WIIU__ + // the plugin is currently never calling drawLogs + return; +#endif #ifdef NDEBUG if (level_ == DEBUGLOG) return; @@ -277,6 +279,10 @@ void addLog (LogLevel const level_, char const *const fmt_, va_list ap_) void addLog (LogLevel const level_, std::string_view const message_) { +#ifdef __WIIU__ + // the plugin is currently never calling drawLogs + return; +#endif #ifdef NDEBUG if (level_ == DEBUGLOG) return; From f5ccc11b80ee4f50f4d4d229844befc783b84b95 Mon Sep 17 00:00:00 2001 From: Maschell Date: Fri, 12 Jul 2024 13:23:50 +0200 Subject: [PATCH 2/3] Sleep for 5 seconds when creating a socket failed --- source/socket.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/socket.cpp b/source/socket.cpp index b16acb8..ed237d4 100644 --- a/source/socket.cpp +++ b/source/socket.cpp @@ -19,9 +19,10 @@ // along with this program. If not, see . #include "socket.h" - #include "log.h" +#include "platform.h" +#include #include #include #include @@ -31,6 +32,8 @@ #include #include +using namespace std::chrono_literals; + /////////////////////////////////////////////////////////////////////////// Socket::~Socket () { @@ -100,6 +103,7 @@ bool Socket::bind (SockAddr const &addr_) case AF_INET: if (::bind (m_fd, addr_, sizeof (struct sockaddr_in)) != 0) { + platform::Thread::sleep (5000ms); error ("bind: %s\n", std::strerror (errno)); return false; } @@ -110,6 +114,7 @@ bool Socket::bind (SockAddr const &addr_) if (::bind (m_fd, addr_, sizeof (struct sockaddr_in6)) != 0) { error ("bind: %s\n", std::strerror (errno)); + platform::Thread::sleep (5000ms); return false; } break; From 23abbd8088aa818a87a3aefbc6c76059eb7489d1 Mon Sep 17 00:00:00 2001 From: Maschell Date: Fri, 12 Jul 2024 13:24:00 +0200 Subject: [PATCH 3/3] Bump version to 0.4.3 --- source/wiiu/platform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/wiiu/platform.cpp b/source/wiiu/platform.cpp index 765a4b3..856cad8 100644 --- a/source/wiiu/platform.cpp +++ b/source/wiiu/platform.cpp @@ -42,7 +42,7 @@ #ifndef CLASSIC #error "Wii U must be built in classic mode" #endif -#define VERSION "v0.4.2" +#define VERSION "v0.4.3" #define VERSION_FULL VERSION VERSION_EXTRA WUPS_PLUGIN_NAME ("ftpiiu");