Phase 1 Offline Trading

Cleanup and testing
Zone updated builds ok
World updated builds ok

Update guild_base.h
This commit is contained in:
Mitch Freeman
2025-03-22 08:39:53 -03:00
parent a81ec11ea3
commit cf3b9638c9
50 changed files with 1777 additions and 229 deletions
@@ -39,6 +39,7 @@ public:
uint8_t rulesflag;
time_t suspendeduntil;
uint32_t time_creation;
uint8_t offline;
std::string ban_reason;
std::string suspend_reason;
std::string crc_eqgame;
@@ -74,6 +75,7 @@ public:
"rulesflag",
"suspendeduntil",
"time_creation",
"offline",
"ban_reason",
"suspend_reason",
"crc_eqgame",
@@ -105,6 +107,7 @@ public:
"rulesflag",
"UNIX_TIMESTAMP(suspendeduntil)",
"time_creation",
"offline",
"ban_reason",
"suspend_reason",
"crc_eqgame",
@@ -170,6 +173,7 @@ public:
e.rulesflag = 0;
e.suspendeduntil = 0;
e.time_creation = 0;
e.offline = 0;
e.ban_reason = "";
e.suspend_reason = "";
e.crc_eqgame = "";
@@ -231,11 +235,12 @@ public:
e.rulesflag = row[17] ? static_cast<uint8_t>(strtoul(row[17], nullptr, 10)) : 0;
e.suspendeduntil = strtoll(row[18] ? row[18] : "-1", nullptr, 10);
e.time_creation = row[19] ? static_cast<uint32_t>(strtoul(row[19], nullptr, 10)) : 0;
e.ban_reason = row[20] ? row[20] : "";
e.suspend_reason = row[21] ? row[21] : "";
e.crc_eqgame = row[22] ? row[22] : "";
e.crc_skillcaps = row[23] ? row[23] : "";
e.crc_basedata = row[24] ? row[24] : "";
e.offline = row[20] ? static_cast<uint8_t>(strtoul(row[20], nullptr, 10)) : 0;
e.ban_reason = row[21] ? row[21] : "";
e.suspend_reason = row[22] ? row[22] : "";
e.crc_eqgame = row[23] ? row[23] : "";
e.crc_skillcaps = row[24] ? row[24] : "";
e.crc_basedata = row[25] ? row[25] : "";
return e;
}
@@ -288,11 +293,12 @@ public:
v.push_back(columns[17] + " = " + std::to_string(e.rulesflag));
v.push_back(columns[18] + " = FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
v.push_back(columns[19] + " = " + std::to_string(e.time_creation));
v.push_back(columns[20] + " = '" + Strings::Escape(e.ban_reason) + "'");
v.push_back(columns[21] + " = '" + Strings::Escape(e.suspend_reason) + "'");
v.push_back(columns[22] + " = '" + Strings::Escape(e.crc_eqgame) + "'");
v.push_back(columns[23] + " = '" + Strings::Escape(e.crc_skillcaps) + "'");
v.push_back(columns[24] + " = '" + Strings::Escape(e.crc_basedata) + "'");
v.push_back(columns[20] + " = " + std::to_string(e.offline));
v.push_back(columns[21] + " = '" + Strings::Escape(e.ban_reason) + "'");
v.push_back(columns[22] + " = '" + Strings::Escape(e.suspend_reason) + "'");
v.push_back(columns[23] + " = '" + Strings::Escape(e.crc_eqgame) + "'");
v.push_back(columns[24] + " = '" + Strings::Escape(e.crc_skillcaps) + "'");
v.push_back(columns[25] + " = '" + Strings::Escape(e.crc_basedata) + "'");
auto results = db.QueryDatabase(
fmt::format(
@@ -334,6 +340,7 @@ public:
v.push_back(std::to_string(e.rulesflag));
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
v.push_back(std::to_string(e.time_creation));
v.push_back(std::to_string(e.offline));
v.push_back("'" + Strings::Escape(e.ban_reason) + "'");
v.push_back("'" + Strings::Escape(e.suspend_reason) + "'");
v.push_back("'" + Strings::Escape(e.crc_eqgame) + "'");
@@ -388,6 +395,7 @@ public:
v.push_back(std::to_string(e.rulesflag));
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
v.push_back(std::to_string(e.time_creation));
v.push_back(std::to_string(e.offline));
v.push_back("'" + Strings::Escape(e.ban_reason) + "'");
v.push_back("'" + Strings::Escape(e.suspend_reason) + "'");
v.push_back("'" + Strings::Escape(e.crc_eqgame) + "'");
@@ -446,11 +454,12 @@ public:
e.rulesflag = row[17] ? static_cast<uint8_t>(strtoul(row[17], nullptr, 10)) : 0;
e.suspendeduntil = strtoll(row[18] ? row[18] : "-1", nullptr, 10);
e.time_creation = row[19] ? static_cast<uint32_t>(strtoul(row[19], nullptr, 10)) : 0;
e.ban_reason = row[20] ? row[20] : "";
e.suspend_reason = row[21] ? row[21] : "";
e.crc_eqgame = row[22] ? row[22] : "";
e.crc_skillcaps = row[23] ? row[23] : "";
e.crc_basedata = row[24] ? row[24] : "";
e.offline = row[20] ? static_cast<uint8_t>(strtoul(row[20], nullptr, 10)) : 0;
e.ban_reason = row[21] ? row[21] : "";
e.suspend_reason = row[22] ? row[22] : "";
e.crc_eqgame = row[23] ? row[23] : "";
e.crc_skillcaps = row[24] ? row[24] : "";
e.crc_basedata = row[25] ? row[25] : "";
all_entries.push_back(e);
}
@@ -495,11 +504,12 @@ public:
e.rulesflag = row[17] ? static_cast<uint8_t>(strtoul(row[17], nullptr, 10)) : 0;
e.suspendeduntil = strtoll(row[18] ? row[18] : "-1", nullptr, 10);
e.time_creation = row[19] ? static_cast<uint32_t>(strtoul(row[19], nullptr, 10)) : 0;
e.ban_reason = row[20] ? row[20] : "";
e.suspend_reason = row[21] ? row[21] : "";
e.crc_eqgame = row[22] ? row[22] : "";
e.crc_skillcaps = row[23] ? row[23] : "";
e.crc_basedata = row[24] ? row[24] : "";
e.offline = row[20] ? static_cast<uint8_t>(strtoul(row[20], nullptr, 10)) : 0;
e.ban_reason = row[21] ? row[21] : "";
e.suspend_reason = row[22] ? row[22] : "";
e.crc_eqgame = row[23] ? row[23] : "";
e.crc_skillcaps = row[24] ? row[24] : "";
e.crc_basedata = row[25] ? row[25] : "";
all_entries.push_back(e);
}
@@ -594,6 +604,7 @@ public:
v.push_back(std::to_string(e.rulesflag));
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
v.push_back(std::to_string(e.time_creation));
v.push_back(std::to_string(e.offline));
v.push_back("'" + Strings::Escape(e.ban_reason) + "'");
v.push_back("'" + Strings::Escape(e.suspend_reason) + "'");
v.push_back("'" + Strings::Escape(e.crc_eqgame) + "'");
@@ -641,6 +652,7 @@ public:
v.push_back(std::to_string(e.rulesflag));
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
v.push_back(std::to_string(e.time_creation));
v.push_back(std::to_string(e.offline));
v.push_back("'" + Strings::Escape(e.ban_reason) + "'");
v.push_back("'" + Strings::Escape(e.suspend_reason) + "'");
v.push_back("'" + Strings::Escape(e.crc_eqgame) + "'");