Skip to content

Commit

Permalink
fix: linux now builds !
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamashi committed Feb 4, 2022
1 parent 6d340a0 commit 46f85be
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Code/components/es_loader/ESLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bool ESLoader::LoadLoadOrder()
{
std::ifstream loadOrderFile;
String loadOrderPath = m_directory + "loadorder.txt";
loadOrderFile.open(loadOrderPath);
loadOrderFile.open(loadOrderPath.c_str());
if (loadOrderFile.fail())
{
spdlog::error("Failed to open loadorder.txt");
Expand Down
1 change: 1 addition & 0 deletions Code/components/es_loader/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#endif

#include <cstdint>
#include <optional>

#include <TiltedCore/Filesystem.hpp>
#include <TiltedCore/Stl.hpp>
Expand Down
11 changes: 5 additions & 6 deletions Code/server/GameServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <AdminMessages/ClientAdminMessageFactory.h>
#include <Messages/AuthenticationResponse.h>
#include <Messages/ClientMessageFactory.h>
#include <Scripts/Player.h>

#include <console/Command.h>
#include <console/Setting.h>
Expand Down Expand Up @@ -334,7 +333,7 @@ GameServer* GameServer::Get() noexcept
}

void GameServer::HandleAuthenticationRequest(const ConnectionId_t aConnectionId,
const UniquePtr<AuthenticationRequest>& acRequest) noexcept
const UniquePtr<AuthenticationRequest>& acRequest)
{
const auto info = GetConnectionInfo(aConnectionId);

Expand Down Expand Up @@ -363,7 +362,7 @@ void GameServer::HandleAuthenticationRequest(const ConnectionId_t aConnectionId,
// Note: to lower traffic we only send the mod ids the user can fix in order as other ids will lead to a null
// form id anyway
std::ostringstream oss;
oss << "New player {:x} connected with mods\n\t Standard: ";
oss << fmt::format("New player {:x} connected with mods\n\t Standard: ", aConnectionId);

Vector<String> playerMods;
Vector<uint16_t> playerModsIds;
Expand Down Expand Up @@ -416,7 +415,7 @@ void GameServer::HandleAuthenticationRequest(const ConnectionId_t aConnectionId,
return;
}*/

spdlog::info(oss.str(), aConnectionId);
spdlog::info("{}", oss.str().c_str());

serverResponse.ServerScripts = std::move(scripts.SerializeScripts());
serverResponse.ReplicatedObjects = std::move(scripts.GenerateFull());
Expand Down Expand Up @@ -446,8 +445,8 @@ void GameServer::UpdateTitle() const
const auto name = m_info.name.empty() ? "Private server" : m_info.name;
const char* playerText = GetClientCount() <= 1 ? " player" : " players";

constexpr char kFormatText[] = "{} - {} {} - {} Ticks - " BUILD_BRANCH "@" BUILD_COMMIT;
auto title = fmt::format(kFormatText, name, GetClientCount(), playerText, GetTickRate());
const auto title = fmt::format("{} - {} {} - {} Ticks - " BUILD_BRANCH "@" BUILD_COMMIT, name.c_str(), GetClientCount(),
playerText, GetTickRate());

#if TP_PLATFORM_WINDOWS
SetConsoleTitleA(title.c_str());
Expand Down
2 changes: 1 addition & 1 deletion Code/server/GameServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct GameServer final : Server

protected:

void HandleAuthenticationRequest(ConnectionId_t aConnectionId, const UniquePtr<AuthenticationRequest>& acRequest) noexcept;
void HandleAuthenticationRequest(ConnectionId_t aConnectionId, const UniquePtr<AuthenticationRequest>& acRequest);

private:

Expand Down

0 comments on commit 46f85be

Please sign in to comment.