Skip to content

Commit

Permalink
using c_ctr to fix linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
Salvatore-Als committed Nov 21, 2023
1 parent 63982d6 commit c2d24b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion configs/core.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"Core"
{
"rank_reference" "ffa"
"rank_reference" "default"

"enable_ffa" "false"

Expand Down
28 changes: 14 additions & 14 deletions src/mysql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ void CMysql::CreateDatabaseIfNotExist()

char szQuery[MAX_QUERY_SIZES];

V_snprintf(szQuery, sizeof(szQuery), SELECT_REFERENCE, this->EscapeRankReference());
V_snprintf(szQuery, sizeof(szQuery), SELECT_REFERENCE, this->EscapeRankReference().c_str());
g_pConnection->Query(szQuery, [this](IMySQLQuery *cb)
{ this->Query_GetRankReference(cb); });


Debug("Select Reference : %s", szQuery);

V_snprintf(szQuery, sizeof(szQuery), SELECT_MAP, g_pConnection->Escape(g_pGlobals->mapname.ToCStr()));
V_snprintf(szQuery, sizeof(szQuery), SELECT_MAP, g_pConnection->Escape(g_pGlobals->mapname.ToCStr()).c_str());

g_pConnection->Query(szQuery, [this](IMySQLQuery *cb)
{ this->Query_GetMapId(cb); });
Expand All @@ -89,7 +89,7 @@ void CMysql::Query_GetRankReference(IMySQLQuery *cb)
return;

char szQuery[MAX_QUERY_SIZES];
V_snprintf(szQuery, sizeof(szQuery), INSERT_REFERENCE, this->EscapeRankReference());
V_snprintf(szQuery, sizeof(szQuery), INSERT_REFERENCE, this->EscapeRankReference().c_str());

Debug("InsertReference request : %s", szQuery);

Expand All @@ -114,7 +114,7 @@ void CMysql::Query_GetMapId(IMySQLQuery *cb)
}

char szQuery[MAX_QUERY_SIZES];
V_snprintf(szQuery, sizeof(szQuery), INSERT_MAP, g_pConnection->Escape(g_pGlobals->mapname.ToCStr()));
V_snprintf(szQuery, sizeof(szQuery), INSERT_MAP, g_pConnection->Escape(g_pGlobals->mapname.ToCStr()).c_str());

Debug("InsertReference request : %s", szQuery);

Expand All @@ -135,11 +135,11 @@ void CMysql::GetUser(CRankPlayer *pPlayer)

char szQuery[MAX_QUERY_SIZES];

V_snprintf(szQuery, sizeof(szQuery), SELECT_USER_MAP, steamId64, this->EscapeRankReference(), this->g_iMapId);
V_snprintf(szQuery, sizeof(szQuery), SELECT_USER_MAP, steamId64, this->EscapeRankReference().c_str(), this->g_iMapId);
g_pConnection->Query(szQuery, [pPlayer, this](IMySQLQuery *cb)
{ this->Query_GetUserMap(cb, pPlayer); });

V_snprintf(szQuery, sizeof(szQuery), SELECT_USER_GLOBAL, steamId64, this->EscapeRankReference());
V_snprintf(szQuery, sizeof(szQuery), SELECT_USER_GLOBAL, steamId64, this->EscapeRankReference().c_str());
g_pConnection->Query(szQuery, [pPlayer, this](IMySQLQuery *cb)
{ this->Query_GetUserGlobal(cb, pPlayer); });

Expand All @@ -165,7 +165,7 @@ void CMysql::Query_GetUserMap(IMySQLQuery *cb, CRankPlayer *pPlayer)
// NOTE : Only set the authid and name, because the other data have a default value set on the database schema

char szQuery[MAX_QUERY_SIZES];
V_snprintf(szQuery, sizeof(szQuery), INSERT_USER, steamId64, g_pConnection->Escape(name), this->EscapeRankReference(), this->g_iMapId);
V_snprintf(szQuery, sizeof(szQuery), INSERT_USER, steamId64, g_pConnection->Escape(name).c_str(), this->EscapeRankReference().c_str(), this->g_iMapId);

Debug("InsertUser request : %s", szQuery);

Expand Down Expand Up @@ -244,15 +244,15 @@ void CMysql::UpdateUser(CRankPlayer *pPlayer)

char szQuery[MAX_QUERY_SIZES];
V_snprintf(szQuery, sizeof(szQuery), UPDATE_USER,
g_pConnection->Escape(name), pPlayer->IsIgnoringAnnouce(),
g_pConnection->Escape(name).c_str(), pPlayer->IsIgnoringAnnouce(),
pPlayer->m_Points.Get(RequestType::Map), pPlayer->m_DeathSuicide.Get(RequestType::Map),
pPlayer->m_DeathT.Get(RequestType::Map), pPlayer->m_DeathCT.Get(RequestType::Map),
pPlayer->m_BombPlanted.Get(RequestType::Map), pPlayer->m_BombExploded.Get(RequestType::Map),
pPlayer->m_BombDefused.Get(RequestType::Map), pPlayer->m_KillKnife.Get(RequestType::Map),
pPlayer->m_KillHeadshot.Get(RequestType::Map), pPlayer->m_KillT.Get(RequestType::Map),
pPlayer->m_KillCT.Get(RequestType::Map), pPlayer->m_TeamKillT.Get(RequestType::Map),
pPlayer->m_TeamKillCT.Get(RequestType::Map),
std::time(0), steamId64, this->EscapeRankReference(), this->g_iMapId);
std::time(0), steamId64, this->EscapeRankReference().c_str(), this->g_iMapId);

Debug("UpdateUser Request : %s", szQuery);

Expand All @@ -271,7 +271,7 @@ void CMysql::RemoveFromOtherMap(CRankPlayer *pPlayer)
uint64 steamId64 = pPlayer->GetSteamId64();

char szQuery[MAX_QUERY_SIZES];
V_snprintf(szQuery, sizeof(szQuery), REMOVE_USER_FROM_OTHERMAPS, steamId64, this->EscapeRankReference(), this->g_iMapId);
V_snprintf(szQuery, sizeof(szQuery), REMOVE_USER_FROM_OTHERMAPS, steamId64, this->EscapeRankReference().c_str(), this->g_iMapId);

Debug("UpdateUser Request : %s", szQuery);

Expand All @@ -286,9 +286,9 @@ void CMysql::GetTopPlayers(bool global, std::function<void(std::map<std::string,
char szQuery[MAX_QUERY_SIZES];

if (global)
V_snprintf(szQuery, sizeof(szQuery), TOP, g_CConfig->GetMinimumPoints(), this->EscapeRankReference());
V_snprintf(szQuery, sizeof(szQuery), TOP, g_CConfig->GetMinimumPoints(), this->EscapeRankReference().c_str());
else
V_snprintf(szQuery, sizeof(szQuery), TOP_MAP, g_CConfig->GetMinimumPoints(), this->EscapeRankReference(), this->g_iMapId);
V_snprintf(szQuery, sizeof(szQuery), TOP_MAP, g_CConfig->GetMinimumPoints(), this->EscapeRankReference().c_str(), this->g_iMapId);

g_pConnection->Query(szQuery, [callback, this](IMySQLQuery *cb)
{ this->Query_TopPlayers(cb, callback); });
Expand Down Expand Up @@ -317,9 +317,9 @@ void CMysql::GetRank(bool global, CRankPlayer *pPlayer, std::function<void(int)>
char szQuery[MAX_QUERY_SIZES];

if (global)
V_snprintf(szQuery, sizeof(szQuery), RANK, this->EscapeRankReference(), pPlayer->m_Points.Get(RequestType::Global));
V_snprintf(szQuery, sizeof(szQuery), RANK, this->EscapeRankReference().c_str(), pPlayer->m_Points.Get(RequestType::Global));
else
V_snprintf(szQuery, sizeof(szQuery), RANK_MAP, pPlayer->m_Points.Get(RequestType::Map), this->EscapeRankReference(), this->g_iMapId);
V_snprintf(szQuery, sizeof(szQuery), RANK_MAP, pPlayer->m_Points.Get(RequestType::Map), this->EscapeRankReference().c_str(), this->g_iMapId);

Debug(szQuery);

Expand Down

0 comments on commit c2d24b5

Please sign in to comment.