Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add C++20 support for Client #3636

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
4d49b80
Main
Moris-Onz Aug 9, 2024
1f10a85
Fixed part 1
Moris-Onz Aug 9, 2024
79b76ef
Fixed part 2
Moris-Onz Aug 9, 2024
d59efc1
Fix crash
Moris-Onz Aug 9, 2024
5cd6fc3
Fast fix by TracerDS
Moris-Onz Aug 9, 2024
1d8c1d7
Fixed by Tederis
Moris-Onz Aug 10, 2024
6a86788
Fast 666
Moris-Onz Aug 10, 2024
87a30e2
Merge branch 'master' into client_c20
G-Moris Aug 12, 2024
bd8e747
Merge branch 'master' into client_c20
G-Moris Aug 14, 2024
d64cd42
Merge branch 'master' into client_c20
G-Moris Aug 15, 2024
649cc85
Merge branch 'master' into client_c20
G-Moris Aug 15, 2024
41a6ccb
Merge branch 'master' into client_c20
G-Moris Aug 17, 2024
c55ed03
Merge branch 'master' into client_c20
G-Moris Aug 18, 2024
876e654
Merge branch 'master' into client_c20
G-Moris Aug 19, 2024
8c58a63
Merge branch 'master' into client_c20
G-Moris Aug 19, 2024
17f9dae
Merge branch 'master' into client_c20
G-Moris Aug 20, 2024
9fbe17f
Merge branch 'master' into client_c20
G-Moris Aug 22, 2024
3e8779b
Merge branch 'master' into client_c20
G-Moris Aug 25, 2024
160909f
Fixed by Botder
Moris-Onz Aug 25, 2024
9f3ebd3
Merge branch 'client_c20' of https://github.com/G-Moris/mtasa-blue in…
Moris-Onz Aug 25, 2024
fb1b6f7
Merge branch 'master' into client_c20
G-Moris Aug 28, 2024
9b171c2
Mini refactor
Moris-Onz Aug 28, 2024
6383ddf
Merge branch 'client_c20' of https://github.com/G-Moris/mtasa-blue in…
Moris-Onz Aug 28, 2024
4f0f087
Merge branch 'master' into client_c20
G-Moris Aug 31, 2024
65644c4
Merge branch 'master' into client_c20
G-Moris Sep 3, 2024
e964cb2
Merge branch 'master' into client_c20
G-Moris Sep 6, 2024
30c42e7
Update CEGUI
Moris-Onz Sep 6, 2024
01f3de7
Merge branch 'client_c20' of https://github.com/G-Moris/mtasa-blue in…
Moris-Onz Sep 6, 2024
33981ff
Update CEGUI (Full)
Moris-Onz Sep 6, 2024
055752b
Update Discord RPC and Tinygettext
Moris-Onz Sep 6, 2024
e7f3a86
Update Lunasvg
Moris-Onz Sep 6, 2024
7a11241
Test Fix multiplayer_sa
Moris-Onz Sep 6, 2024
903f812
Test fix game_sa
Moris-Onz Sep 6, 2024
50b0ac8
Merge branch 'master' into client_c20
G-Moris Sep 17, 2024
a9ff24c
Merge branch 'master' into client_c20
G-Moris Sep 22, 2024
0e16f15
Merge branch 'master' into client_c20
G-Moris Sep 26, 2024
ec3c7de
Merge branch 'master' into client_c20
G-Moris Sep 28, 2024
56990d5
Merge branch 'master' into client_c20
G-Moris Oct 5, 2024
5c137e2
Merge branch 'master' into client_c20
G-Moris Oct 11, 2024
c589f0b
Merge branch 'master' into client_c20
G-Moris Oct 14, 2024
10af729
std::string from CCommands
Moris-Onz Oct 14, 2024
b98217d
Merge branch 'client_c20' of https://github.com/G-Moris/mtasa-blue in…
Moris-Onz Oct 14, 2024
062cdff
Refactoring changes
Moris-Onz Oct 14, 2024
034fbf0
a fix for the minimalism of changes #1
Moris-Onz Oct 14, 2024
22f98f7
adjustments
Moris-Onz Oct 14, 2024
7daf065
Merge branch 'master' into client_c20
G-Moris Oct 16, 2024
8b44e2a
Merge branch 'master' into client_c20
G-Moris Oct 19, 2024
1face51
Merge branch 'master' into client_c20
G-Moris Nov 7, 2024
249aadf
Merge branch 'master' into client_c20
G-Moris Nov 16, 2024
7ae7194
Merge branch 'master' into client_c20
G-Moris Nov 20, 2024
440b169
Merge branch 'master' into client_c20
G-Moris Nov 21, 2024
021fda4
Merge branch 'master' into client_c20
G-Moris Nov 27, 2024
0b9a97b
Merge branch 'master' into client_c20
G-Moris Nov 30, 2024
60865bb
Merge branch 'master' into client_c20
G-Moris Dec 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Client/ceflauncher/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ project "CEFLauncher"
targetname "CEFLauncher"
targetdir(buildpath("mta/cef"))

cppdialect "C++20"

includedirs { "../sdk" }

links { "CEFLauncher DLL"}
Expand Down
2 changes: 2 additions & 0 deletions Client/ceflauncher_DLL/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ project "CEFLauncher DLL"
targetname "CEFLauncher_DLL"
targetdir(buildpath("mta/cef"))

cppdialect "C++20"

includedirs { "../../vendor/cef3/cef" }
libdirs { "../../vendor/cef3/cef/Release" }

Expand Down
2 changes: 2 additions & 0 deletions Client/cefweb/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ project "Client Webbrowser"
targetname "cefweb"
targetdir(buildpath("mta"))

cppdialect "C++20"

filter "system:windows"
includedirs { "../../vendor/sparsehash/src/windows" }
linkoptions { "/SAFESEH:NO" }
Expand Down
4 changes: 2 additions & 2 deletions Client/core/CAdditionalVertexStreamManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,13 +466,13 @@ SAdditionalStreamInfo* CAdditionalVertexStreamManager::CreateAdditionalStreamInf
declNew->Usage = D3DDECLUSAGE_NORMAL;
declNew->UsageIndex = 0;
if (FAILED(m_pDevice->CreateVertexDeclaration(elements, &info.pVertexDeclaration)))
return false;
return nullptr;

// Create new stream
info.Stride = sizeof(float) * 3;
UINT Size2 = ConvertPTSize(state.decl.VertexBufferDesc1.Size);
if (FAILED(m_pDevice->CreateVertexBuffer(Size2, D3DUSAGE_WRITEONLY, 0, D3DPOOL_MANAGED, &info.pStreamData, NULL)))
return false;
return nullptr;

// Save info
MapSet(m_AdditionalStreamInfoMap, state.stream1.pStreamData, info);
Expand Down
63 changes: 29 additions & 34 deletions Client/core/CCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,38 +84,34 @@ bool CCommands::Execute(const char* szCommandLine)
bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool bHandleRemotely, bool bIsScriptedBind)
{
// Copy szParametersIn so the contents can be changed
char* szParameters = NULL;
if (szParametersIn)
{
size_t sizeParameters = strlen(szParametersIn) + 1;
szParameters = static_cast<char*>(alloca(sizeParameters));
memcpy(szParameters, szParametersIn, sizeParameters);
}
std::string strParameters = szParametersIn ? std::string(szParametersIn, strlen(szParametersIn)) : "";

// HACK: if its a 'chatboxsay' command, use the next parameter
// Is the command "say" and the arguments start with /? (command comes from the chatbox)
if (!bIsScriptedBind && !stricmp(szCommand, "chatboxsay"))
{
if (szParameters)
if (!strParameters.empty())
{
// His line starts with '/'?
if (*szParameters == '/')
if (strParameters[0] == '/')
{
// Copy the characters after the slash to the 0 terminator to a seperate buffer
char szBuffer[256];
strncpy(szBuffer, szParameters + 1, 256);
szBuffer[255] = 0;
std::array<char, 256> szBuffer = {};
std::strncpy(szBuffer.data(), strParameters.c_str() + 1, szBuffer.size() - 1);
szBuffer.back() = '\0';

// Split it into command and arguments
szCommand = strtok(szBuffer, " ");
szParameters = strtok(NULL, "\0");
if (szCommand == NULL)
{
szCommand = std::strtok(szBuffer.data(), " ");
if (!szCommand)
return false;

if (char* szNewParameters = std::strtok(nullptr, "\0"))
{
strParameters = std::string(szNewParameters, strlen(szNewParameters));
}
if (szParameters == NULL)
else
{
szParameters = "";
strParameters.clear();
}
}
}
Expand All @@ -126,21 +122,19 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
// Grab the command
tagCOMMANDENTRY* pEntry = Get(szCommand);
bool wasHandled = false;
if (pEntry)

// If its a core command, or if its enabled
if (pEntry && (!pEntry->bModCommand || pEntry->bEnabled))
{
// If its a core command, or if its enabled
if (!pEntry->bModCommand || pEntry->bEnabled)
{
// Execute it
if (!bIsScriptedBind || pEntry->bAllowScriptedBind)
ExecuteHandler(pEntry->pfnCmdFunc, szParameters);
// Execute it
if (!bIsScriptedBind || pEntry->bAllowScriptedBind)
ExecuteHandler(pEntry->pfnCmdFunc, strParameters.c_str());

wasHandled = true;
}
wasHandled = true;
}

// Recompose the original command text
std::string val = std::string(szCommand) + " " + std::string(szParameters ? szParameters : "");
std::string val = std::string(szCommand) + " " + strParameters;

// Is it a cvar? (syntax: cvar[ = value])
if (!wasHandled)
Expand Down Expand Up @@ -191,15 +185,15 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool

// HACK: if its a 'nick' command, save it here
bool bIsNickCommand = !stricmp(szCommand, "nick");
if (!wasHandled && bIsNickCommand && szParameters && !bIsScriptedBind)
if (!wasHandled && bIsNickCommand && !strParameters.empty() && !bIsScriptedBind)
{
if (CCore::GetSingleton().IsValidNick(szParameters))
if (CCore::GetSingleton().IsValidNick(strParameters.c_str()))
{
CVARS_SET("nick", std::string(szParameters));
CVARS_SET("nick", strParameters);

if (!CCore::GetSingleton().IsConnected())
{
CCore::GetSingleton().GetConsole()->Printf("nick: You are now known as %s", szParameters);
CCore::GetSingleton().GetConsole()->Print(std::format("nick: You are now known as {}", strParameters).c_str());
}
}
else if (!CCore::GetSingleton().IsConnected())
Expand All @@ -212,7 +206,7 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
if (m_pfnExecuteHandler)
{
bool bAllowScriptedBind = (!pEntry || pEntry->bAllowScriptedBind);
if (m_pfnExecuteHandler(szCommand, szParameters, bHandleRemotely, wasHandled, bIsScriptedBind, bAllowScriptedBind))
if (m_pfnExecuteHandler(szCommand, strParameters.c_str(), bHandleRemotely, wasHandled, bIsScriptedBind, bAllowScriptedBind))
return true;
}

Expand All @@ -221,8 +215,9 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool

// Unknown command
val = _("Unknown command or cvar: ") + szCommand;
if (!bIsScriptedBind && !bIsNickCommand && pEntry == nullptr)
if (!bIsScriptedBind && !bIsNickCommand && !pEntry)
CCore::GetSingleton().GetConsole()->Print(val.c_str());

return false;
}

Expand Down
4 changes: 2 additions & 2 deletions Client/core/CCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ static HMODULE WINAPI SkipDirectPlay_LoadLibraryA(LPCSTR fileName)
const fs::path inLaunchDir = fs::path{FromUTF8(GetLaunchPath())} / "enbseries" / "enbhelper.dll";

if (fs::is_regular_file(inLaunchDir, ec))
return Win32LoadLibraryA(inLaunchDir.u8string().c_str());
return Win32LoadLibraryA(PathToUtf8(inLaunchDir).c_str());

// Try to load enbhelper.dll from the GTA install directory second.
const fs::path inGTADir = g_gtaDirectory / "enbseries" / "enbhelper.dll";

if (fs::is_regular_file(inGTADir, ec))
return Win32LoadLibraryA(inGTADir.u8string().c_str());
return Win32LoadLibraryA(PathToUtf8(inGTADir).c_str());

return nullptr;
}
Expand Down
2 changes: 1 addition & 1 deletion Client/core/CEntryHistory.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class CEntryHistory
// Return a specific entry from history
CEntryHistoryItem* Get(unsigned int index)
{
auto& iter = std::next(m_entries.begin(), index);
auto iter = std::next(m_entries.begin(), index);
G-Moris marked this conversation as resolved.
Show resolved Hide resolved
if (iter != m_entries.end())
return &(*iter);
return nullptr;
Expand Down
2 changes: 1 addition & 1 deletion Client/core/CFilePathTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void CFilePathTranslator::GetCurrentWorkingDirectory(std::string& WorkingDirecto

void CFilePathTranslator::GetGTARootDirectory(std::string& ModuleRootDirOut)
{
ModuleRootDirOut = g_gtaDirectory.u8string();
ModuleRootDirOut = PathToUtf8(g_gtaDirectory);
}

void CFilePathTranslator::GetMTASARootDirectory(std::string& InstallRootDirOut)
Expand Down
4 changes: 2 additions & 2 deletions Client/core/CKeyBinds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2301,7 +2301,7 @@ void CKeyBinds::BindCommand(const char* szCmdLine)
{
CConsoleInterface* pConsole = m_pCore->GetConsole();

char* szError = "* Syntax: bind <defaults/key> [<up/down>] <command> [<arguments>]";
const char* szError = "* Syntax: bind <defaults/key> [<up/down>] <command> [<arguments>]";
if (szCmdLine == NULL)
{
pConsole->Print(szError);
Expand Down Expand Up @@ -2384,7 +2384,7 @@ void CKeyBinds::UnbindCommand(const char* szCmdLine)
{
CConsoleInterface* pConsole = m_pCore->GetConsole();

char* szError = "* Syntax: unbind <all/key> [<up/down/both> <command>]";
const char* szError = "* Syntax: unbind <all/key> [<up/down/both> <command>]";
if (szCmdLine == NULL)
{
pConsole->Print(szError);
Expand Down
6 changes: 3 additions & 3 deletions Client/core/CModManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,18 +338,18 @@ void CModManager::InitializeModList(const char* szModFolderPath)
filePathTranslator.SetCurrentWorkingDirectory("mta");

// Create a search
hFind = FindFirstFileW(FromUTF8(strPathWildchars), &FindData);
hFind = FindFirstFileW(FromUTF8(strPathWildchars).c_str(), &FindData);

// If we found a first file ...
if (hFind != INVALID_HANDLE_VALUE)
{
// Add it to the list
VerifyAndAddEntry(szModFolderPath, ToUTF8(FindData.cFileName));
VerifyAndAddEntry(szModFolderPath, ToUTF8(FindData.cFileName).c_str());

// Search until there aren't any files left
while (FindNextFileW(hFind, &FindData) == TRUE)
{
VerifyAndAddEntry(szModFolderPath, ToUTF8(FindData.cFileName));
VerifyAndAddEntry(szModFolderPath, ToUTF8(FindData.cFileName).c_str());
}

// End the search
Expand Down
4 changes: 2 additions & 2 deletions Client/core/CVersionUpdater.Util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ namespace
SString GetAttribute(const SString& strName) const
{
const SString* pValue = MapFind(attributeMap, strName);
return pValue ? *pValue : "";
return pValue ? *pValue : SString();
}
void SetAttribute(const SString& strName, const SString& strValue) { MapSet(attributeMap, strName, strValue); }
};
Expand Down Expand Up @@ -606,7 +606,7 @@ namespace
SaveReportSettings();
}

SString GetFilter() const { return strFilter != "" ? strFilter : "+all"; }
SString GetFilter() const { return !strFilter.empty() ? strFilter : SStringX("+all"); }

int GetMinSize() const { return iMinSize; }

Expand Down
8 changes: 4 additions & 4 deletions Client/core/Graphics/CRenderItem.EffectTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace
SString m_strReport;
std::map<SString, SString> m_FileMD5Map;

CIncludeManager::CIncludeManager(const SString& strRootPath, const SString& strCurrentPath)
CIncludeManager(const SString& strRootPath, const SString& strCurrentPath)
{
m_strRootPath = strRootPath;
m_strCurrentPath = strCurrentPath;
Expand Down Expand Up @@ -228,15 +228,15 @@ void CEffectTemplate::CreateUnderlyingData(const SString& strFile, const SString
if (bDebug)
dwFlags |= D3DXSHADER_DEBUG;

SString strMetaPath = bIsRawData ? "" : strFile.Right(strFile.length() - strRootPath.length());
CIncludeManager IncludeManager(strRootPath, ExtractPath(strMetaPath));
const char* szMetaPath = bIsRawData ? "" : strFile.Right(strFile.length() - strRootPath.length()).c_str();
CIncludeManager IncludeManager(strRootPath, ExtractPath(szMetaPath));
LPD3DXBUFFER pBufferErrors = NULL;
if (bIsRawData)
m_CreateHResult =
MyD3DXCreateEffect(m_pDevice, strFile, strFile.length(), &macroList[0], &IncludeManager, dwFlags, NULL, &m_pD3DEffect, &pBufferErrors);
else
m_CreateHResult =
MyD3DXCreateEffectFromFile(m_pDevice, ExtractFilename(strMetaPath), &macroList[0], &IncludeManager, dwFlags, NULL, &m_pD3DEffect, &pBufferErrors);
MyD3DXCreateEffectFromFile(m_pDevice, ExtractFilename(szMetaPath), &macroList[0], &IncludeManager, dwFlags, NULL, &m_pD3DEffect, &pBufferErrors);

// Handle compile errors
strOutStatus = "";
Expand Down
26 changes: 13 additions & 13 deletions Client/core/ServerBrowser/CServerBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ void CServerBrowser::CreateHistoryList()
for (CServerListReverseIterator it = m_ServersHistory.ReverseIteratorBegin(); it != m_ServersHistory.ReverseIteratorEnd(); it++)
{
CServerListItem* pServer = *it;
if (pServer->strEndpoint)
if (!pServer->strEndpoint.empty())
{
bEmpty = false;
for (unsigned int i = 0; i < SERVER_BROWSER_TYPE_COUNT; i++)
Expand Down Expand Up @@ -1078,22 +1078,22 @@ void CServerBrowser::AddServerToList(CServerListItem* pServer, const ServerBrows
pServer->iRowIndex = iIndex;
}

const SString strVersion = !bIncludeOtherVersions ? "" : pServer->strVersion;
const SString strVersionSortKey = pServer->strVersionSortKey + pServer->strTieBreakSortKey;
const std::string strVersion = !bIncludeOtherVersions ? "" : pServer->strVersion;
const std::string strVersionSortKey = pServer->strVersionSortKey + pServer->strTieBreakSortKey;

const SString strVerified = pServer->isStatusVerified ? "" : "*";
const SString strPlayers = pServer->nMaxPlayers == 0 ? "" : SString("%d / %d %s", pServer->nPlayers, pServer->nMaxPlayers, *strVerified);
const SString strPlayersSortKey = SString("%04d-", pServer->nMaxPlayers ? pServer->nPlayers + 1 : 0) + pServer->strTieBreakSortKey;
const std::string strVerified = pServer->isStatusVerified ? "" : "*";
const std::string strPlayers = pServer->nMaxPlayers == 0 ? "" : std::format("{} / {} {}", pServer->nPlayers, pServer->nMaxPlayers, strVerified);
const std::string strPlayersSortKey = std::format("{:04d}-{}", pServer->nMaxPlayers ? pServer->nPlayers + 1 : 0, pServer->strTieBreakSortKey);

const SString strPing = pServer->nPing == 9999 ? "" : SString("%d", pServer->nPing);
const SString strPingSortKey = SString("%04d-", pServer->nPing) + pServer->strTieBreakSortKey;
const std::string strPing = pServer->nPing == 9999 ? "" : std::to_string(pServer->nPing);
const std::string strPingSortKey = std::format("{:04d}-{}", pServer->nPing, pServer->strTieBreakSortKey);

// The row index could change at any point here if list sorting is enabled
iIndex = m_pServerList[Type]->SetItemText(iIndex, m_hVersion[Type], strVersion, false, false, true, strVersionSortKey);
iIndex = m_pServerList[Type]->SetItemText(iIndex, m_hName[Type], pServer->strName, false, false, true, pServer->strNameSortKey);
iIndex = m_pServerList[Type]->SetItemText(iIndex, m_hGame[Type], pServer->strGameMode, false, false, true);
iIndex = m_pServerList[Type]->SetItemText(iIndex, m_hPlayers[Type], strPlayers, false, false, true, strPlayersSortKey);
iIndex = m_pServerList[Type]->SetItemText(iIndex, m_hPing[Type], strPing, false, false, true, strPingSortKey);
iIndex = m_pServerList[Type]->SetItemText(iIndex, m_hVersion[Type], strVersion.c_str(), false, false, true, strVersionSortKey.c_str());
iIndex = m_pServerList[Type]->SetItemText(iIndex, m_hName[Type], pServer->strName.c_str(), false, false, true, pServer->strNameSortKey);
iIndex = m_pServerList[Type]->SetItemText(iIndex, m_hGame[Type], pServer->strGameMode.c_str(), false, false, true);
iIndex = m_pServerList[Type]->SetItemText(iIndex, m_hPlayers[Type], strPlayers.c_str(), false, false, true, strPlayersSortKey.c_str());
iIndex = m_pServerList[Type]->SetItemText(iIndex, m_hPing[Type], strPing.c_str(), false, false, true, strPingSortKey.c_str());

// Locked icon
m_pServerList[Type]->SetItemImage(iIndex, m_hLocked[Type], pServer->bPassworded ? m_pLockedIcon : NULL);
Expand Down
30 changes: 15 additions & 15 deletions Client/core/ServerBrowser/CServerList.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,26 +198,26 @@ class CServerListItem
bool bKeepFlag;
int iRowIndex;

SString strGameName; // Game name. Always 'mta'
SString strVersion; // Game version
SString strName; // Server name
SString strSearchableName; // Server name to use for searches
SString strHost; // Server host as IP
SString strHostName; // Server host as name
SString strGameMode; // Gamemode
SString strMap; // Map name
SString strEndpoint; // IP:port as a string
std::string strGameName; // Game name. Always 'mta'
std::string strVersion; // Game version
std::string strName; // Server name
std::string strSearchableName; // Server name to use for searches
std::string strHost; // Server host as IP
std::string strHostName; // Server host as name
std::string strGameMode; // Gamemode
std::string strMap; // Map name
std::string strEndpoint; // IP:port as a string

int m_iBuildType; // 9=release
int m_iBuildNumber; // 00000 and up
ushort m_usHttpPort;
uchar m_ucSpecialFlags;

SString strNameSortKey; // Server name as a sortable string
SString strVersionSortKey; // Game version as a sortable string
SString strEndpointSortKey; // IP:port as a sortable string
uint uiTieBreakPosition;
SString strTieBreakSortKey;
SString strNameSortKey; // Server name as a sortable string
SString strVersionSortKey; // Game version as a sortable string
SString strEndpointSortKey; // IP:port as a sortable string
uint uiTieBreakPosition;
std::string strTieBreakSortKey;

CQueryReceiver queryReceiver;

Expand All @@ -236,7 +236,7 @@ class CServerListItem
void PostChange()
{
// Update tie break sort key
strTieBreakSortKey = SString("%04d", uiTieBreakPosition);
strTieBreakSortKey = std::format("{:04d}", uiTieBreakPosition);

// Update version sort key
strVersionSortKey = strVersion;
Expand Down
2 changes: 2 additions & 0 deletions Client/core/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ project "Client Core"
targetname "core"
targetdir(buildpath("mta"))

cppdialect "C++20"

filter "system:windows"
includedirs { "../../vendor/sparsehash/src/windows" }
linkoptions { "/SAFESEH:NO" }
Expand Down
Loading
Loading