diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 620c364caa..184ae69bbf 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -477,7 +477,6 @@ namespace OpenRCT2 gGameSoundsOff = !gConfigSound.master_sound_enabled; } - network_set_env(_env); chat_init(); CopyOriginalUserFilesOver(); diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index f028427c9d..7422b9ebcb 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -147,11 +147,6 @@ NetworkBase::NetworkBase(OpenRCT2::IContext& context) _server_log_fs << std::unitbuf; } -void NetworkBase::SetEnvironment(const std::shared_ptr& env) -{ - _env = env; -} - bool NetworkBase::Init() { status = NETWORK_STATUS_READY; @@ -1101,7 +1096,8 @@ void NetworkBase::AppendLog(std::ostream& fs, const std::string& s) void NetworkBase::BeginChatLog() { - auto directory = _env->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_CHAT); + auto env = _context.GetPlatformEnvironment(); + auto directory = env->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_CHAT); _chatLogPath = BeginLog(directory, "", _chatLogFilenameFormat); # if defined(_WIN32) && !defined(__MINGW32__) @@ -1127,7 +1123,8 @@ void NetworkBase::CloseChatLog() void NetworkBase::BeginServerLog() { - auto directory = _env->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_SERVER); + auto env = _context.GetPlatformEnvironment(); + auto directory = env->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_SERVER); _serverLogPath = BeginLog(directory, ServerName, _serverLogFilenameFormat); # if defined(_WIN32) && !defined(__MINGW32__) @@ -3217,11 +3214,6 @@ void NetworkBase::Client_Handle_GAMEINFO([[maybe_unused]] NetworkConnection& con network_chat_show_server_greeting(); } -void network_set_env(const std::shared_ptr& env) -{ - OpenRCT2::GetContext()->GetNetwork().SetEnvironment(env); -} - void network_close() { OpenRCT2::GetContext()->GetNetwork().Close(); @@ -4237,9 +4229,6 @@ void network_close() void network_reconnect() { } -void network_set_env(const std::shared_ptr&) -{ -} void network_shutdown_client() { } diff --git a/src/openrct2/network/NetworkBase.h b/src/openrct2/network/NetworkBase.h index 7d98f6d1ab..2a67c203d9 100644 --- a/src/openrct2/network/NetworkBase.h +++ b/src/openrct2/network/NetworkBase.h @@ -29,7 +29,6 @@ public: // Uncategorized bool BeginClient(const std::string& host, uint16_t port); public: // Common - void SetEnvironment(const std::shared_ptr& env); bool Init(); void Close(); uint32_t GetServerTick(); @@ -180,7 +179,6 @@ public: // Public common private: // Common Data using CommandHandler = void (NetworkBase::*)(NetworkConnection& connection, NetworkPacket& packet); - std::shared_ptr _env; std::vector chunk_buffer; std::ofstream _chat_log_fs; uint32_t _lastUpdateTime = 0; diff --git a/src/openrct2/network/network.h b/src/openrct2/network/network.h index 2876339f21..716f7bb72a 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -35,12 +35,6 @@ enum class ModifyGroupType : uint8_t; enum class PermissionState : uint8_t; enum class NetworkPermission : uint32_t; -namespace OpenRCT2 -{ - struct IPlatformEnvironment; -} - -void network_set_env(const std::shared_ptr& env); void network_close(); void network_reconnect(); void network_shutdown_client();