From 30f6d2b31fe0eecd844a2d257896df2bf00884c9 Mon Sep 17 00:00:00 2001 From: Berbe <4251220+Berbe@users.noreply.github.com> Date: Tue, 28 Aug 2018 20:46:13 +0200 Subject: [PATCH 1/2] Correct client IP address not being propagated/stored --- src/openrct2/network/TcpSocket.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/openrct2/network/TcpSocket.cpp b/src/openrct2/network/TcpSocket.cpp index ff83234130..b3600f0a1d 100644 --- a/src/openrct2/network/TcpSocket.cpp +++ b/src/openrct2/network/TcpSocket.cpp @@ -210,10 +210,13 @@ public: (struct sockaddr*)&client_addr, client_len, hostName, sizeof(hostName), nullptr, 0, NI_NUMERICHOST | NI_NUMERICSERV); SetTCPNoDelay(socket, true); - tcpSocket = new TcpSocket(socket); if (rc == 0) { - _hostName = std::string(hostName); + tcpSocket = new TcpSocket(socket, hostName); + } + else + { + tcpSocket = new TcpSocket(socket, ""); } } } @@ -427,9 +430,10 @@ public: } private: - explicit TcpSocket(SOCKET socket) + explicit TcpSocket(SOCKET socket, const std::string& hostName) { _socket = socket; + _hostName = hostName; _status = SOCKET_STATUS_CONNECTED; } From 9ef4f99d5a621969caf161698a07cb49f2d86721 Mon Sep 17 00:00:00 2001 From: Ted John Date: Thu, 4 Oct 2018 12:47:51 +0100 Subject: [PATCH 2/2] [ci skip] Update changelog --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 4ba60a829d..c5b09a9684 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -7,6 +7,7 @@ - Feature: [#7980] Allow data path for RCT1 to be specified by a command line argument. - Fix: [#6191] OpenRCT2 fails to run when the path has an emoji in it. - Fix: [#7828] Copied entrances and exits stay when demolishing ride. +- Fix: [#7945] Client IP address is logged as `(null)` in server logs. - Fix: [#7954] Key validation fails on Windows due to non-ASCII user / player name. - Fix: [#7975] Inspection flag not cleared for rides which are set to never be inspected (Original bug). - Fix: [#8034] Vanilla sprites are broken when making screenshots from command line.