From 3944d81cfc713a867612d6f0d6f3c71bad8f31b7 Mon Sep 17 00:00:00 2001 From: Benau Date: Sat, 28 Dec 2019 12:45:56 +0800 Subject: [PATCH] Fix writing of server id file for unicode folder --- src/network/protocols/server_lobby.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/network/protocols/server_lobby.cpp b/src/network/protocols/server_lobby.cpp index f25aa0a4e..e60b068ce 100644 --- a/src/network/protocols/server_lobby.cpp +++ b/src/network/protocols/server_lobby.cpp @@ -839,8 +839,9 @@ void ServerLobby::createServerIdFile() std::fstream fs; sid += StringUtils::toString(m_server_id_online.load()) + "_" + StringUtils::toString(STKHost::get()->getPrivatePort()); - fs.open(sid, std::ios::out); - fs.close(); + io::IWriteFile* file = irr::io::createWriteFile(sid.c_str(), false); + if (file) + file->drop(); m_has_created_server_id_file = true; } } // createServerIdFile