Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2025-02-19 22:29:36 +08:00
parent d1032678ff
commit 7d431dc796
277 changed files with 7092 additions and 5050 deletions

View File

@@ -212,7 +212,7 @@ T Field::GetData() const
if (data.raw)
result = *reinterpret_cast<T const*>(data.value);
else
result = Acore::StringTo<T>(data.value);
result = Acore::StringTo<T>(std::string_view(data.value, data.length));
// Correct double fields... this undefined behavior :/
if constexpr (std::is_same_v<T, double>)
@@ -220,7 +220,7 @@ T Field::GetData() const
if (data.raw && !IsType(DatabaseFieldTypes::Decimal))
result = *reinterpret_cast<double const*>(data.value);
else
result = Acore::StringTo<float>(data.value);
result = Acore::StringTo<float>(std::string_view(data.value, data.length));
}
// Check -1 for *_dbc db tables
@@ -230,7 +230,7 @@ T Field::GetData() const
if (!tableName.empty() && tableName.size() > 4)
{
auto signedResult = Acore::StringTo<int32>(data.value);
auto signedResult = Acore::StringTo<int32>(std::string_view(data.value, data.length));
if (signedResult && !result && tableName.substr(tableName.length() - 4) == "_dbc")
{

View File

@@ -157,9 +157,7 @@ UpdateFetcher::DirectoryStorage UpdateFetcher::ReceiveIncludedDirectories() cons
std::vector<std::string> moduleList;
for (auto const& itr : Acore::Tokenize(_modulesList, ',', true))
{
moduleList.emplace_back(itr);
}
// data/sql
for (auto const& itr : moduleList)
@@ -168,9 +166,7 @@ UpdateFetcher::DirectoryStorage UpdateFetcher::ReceiveIncludedDirectories() cons
Path const p(path);
if (!is_directory(p))
{
continue;
}
DirectoryEntry const entry = { p, AppliedFileEntry::StateConvert("MODULE") };
directories.push_back(entry);
@@ -386,14 +382,14 @@ UpdateResult UpdateFetcher::Update(bool const redundancyChecks,
// Apply default updates
for (auto const& availableQuery : available)
{
if (availableQuery.second != CUSTOM && availableQuery.second != MODULE)
if (availableQuery.second != PENDING && availableQuery.second != CUSTOM && availableQuery.second != MODULE)
ApplyUpdateFile(availableQuery);
}
// Apply only custom/module updates
// Apply only pending/custom/module updates
for (auto const& availableQuery : available)
{
if (availableQuery.second == CUSTOM || availableQuery.second == MODULE)
if (availableQuery.second == PENDING || availableQuery.second == CUSTOM || availableQuery.second == MODULE)
ApplyUpdateFile(availableQuery);
}

View File

@@ -72,6 +72,7 @@ private:
{
RELEASED,
CUSTOM,
PENDING,
MODULE,
ARCHIVED
};
@@ -92,6 +93,8 @@ private:
return RELEASED;
else if (state == "CUSTOM")
return CUSTOM;
else if (state == "PENDING")
return PENDING;
else if (state == "MODULE")
return MODULE;
@@ -106,6 +109,8 @@ private:
return "RELEASED";
case CUSTOM:
return "CUSTOM";
case PENDING:
return "PENDING";
case MODULE:
return "MODULE";
case ARCHIVED: