feat(server): save economy hardening and CH5 continuation work

This commit is contained in:
shen
2026-10-22 06:22:23 -07:00
parent c979b53762
commit 5b7442ea37
142 changed files with 5850 additions and 1682 deletions
+16 -3
View File
@@ -4,6 +4,7 @@
#include "../libthecore/include/stdafx.h"
#include "../libthecore/include/log.h"
#include <atomic>
#include <string>
#include <queue>
#include <vector>
@@ -32,10 +33,20 @@ typedef struct _SQLResult
}
}
// mysql_affected_rows uses all 64 bits for its error sentinel.
static constexpr uint64_t AFFECTED_ROWS_ERROR = UINT64_MAX;
bool GetInsertID32(uint32_t& destination) const
{
if (!uiInsertID || uiInsertID > UINT32_MAX) return false;
destination = static_cast<uint32_t>(uiInsertID);
return true;
}
bool HasAffectedRows() const { return uiAffectedRows != 0 && uiAffectedRows != AFFECTED_ROWS_ERROR; }
MYSQL_RES * pSQLResult;
uint32_t uiNumRows;
uint32_t uiAffectedRows;
uint32_t uiInsertID;
uint64_t uiNumRows;
uint64_t uiAffectedRows;
uint64_t uiInsertID;
} SQLResult;
typedef struct _SQLMsg
@@ -135,6 +146,7 @@ class CAsyncSQL
bool PopResult(SQLMsg ** pp);
void ChildLoop();
uint64_t FailureEpoch()const { return m_failureEpoch.load(); }
MYSQL * GetSQLHandle();
@@ -162,6 +174,7 @@ class CAsyncSQL
//private:
protected:
std::atomic<uint64_t> m_failureEpoch{0};
MYSQL m_hDB;
std::string m_stHost;