From 0e6a5e4efb4fbe6215034f9e65e6cf3bf78ffb56 Mon Sep 17 00:00:00 2001 From: Alwin Arrasyid Date: Wed, 1 Oct 2025 09:50:34 +0700 Subject: [PATCH 1/6] fix(Scripts/Commands): escape string before query on go creature command (#23036) --- src/server/scripts/Commands/cs_go.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index 0e6bca422..5f2e5a51d 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -137,10 +137,7 @@ public: // Make sure we don't pass double quotes into the SQL query. Otherwise it causes a MySQL error std::string str = name.data(); // Making subtractions to the last character does not with in string_view - if (str.front() == '"') - str = str.substr(1); - if (str.back() == '"') - str = str.substr(0, str.size() - 1); + WorldDatabase.EscapeString(str); QueryResult result = WorldDatabase.Query("SELECT entry FROM creature_template WHERE name = \"{}\" LIMIT 1", str); if (!result) From e93d3ffd273b8abca56889638c49ce0470e2eb29 Mon Sep 17 00:00:00 2001 From: sudlud Date: Wed, 1 Oct 2025 09:33:13 +0200 Subject: [PATCH 2/6] fix(DB/Gameobject): Sniffed Values for '186957' spawns (#22953) --- .../sql/updates/pending_db_world/rev_1758137104606834700.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1758137104606834700.sql diff --git a/data/sql/updates/pending_db_world/rev_1758137104606834700.sql b/data/sql/updates/pending_db_world/rev_1758137104606834700.sql new file mode 100644 index 000000000..439da7809 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1758137104606834700.sql @@ -0,0 +1,5 @@ +-- Update gameobject '186957' with sniffed values +-- updated spawns +DELETE FROM `gameobject` WHERE (`id` IN (186957)) AND (`guid` IN (65654)); +INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `ScriptName`, `VerifiedBuild`, `Comment`) VALUES +(65654, 186957, 571, 0, 0, 1, 1, 514.50347900390625, -5936.9287109375, 313.857574462890625, 3.141527414321899414, -0.02631568908691406, 0.036975860595703125, 0.998969078063964843, 0.001006617560051381, 120, 255, 0, "", 48632, NULL); From 4987a8b2c1dc656492214f17a55d51db5332fe44 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 1 Oct 2025 07:37:02 +0000 Subject: [PATCH 3/6] chore(DB): import pending files Referenced commit(s): e93d3ffd273b8abca56889638c49ce0470e2eb29 --- .../rev_1758137104606834700.sql => db_world/2025_10_01_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1758137104606834700.sql => db_world/2025_10_01_00.sql} (93%) diff --git a/data/sql/updates/pending_db_world/rev_1758137104606834700.sql b/data/sql/updates/db_world/2025_10_01_00.sql similarity index 93% rename from data/sql/updates/pending_db_world/rev_1758137104606834700.sql rename to data/sql/updates/db_world/2025_10_01_00.sql index 439da7809..b3ff20f89 100644 --- a/data/sql/updates/pending_db_world/rev_1758137104606834700.sql +++ b/data/sql/updates/db_world/2025_10_01_00.sql @@ -1,3 +1,4 @@ +-- DB update 2025_09_30_02 -> 2025_10_01_00 -- Update gameobject '186957' with sniffed values -- updated spawns DELETE FROM `gameobject` WHERE (`id` IN (186957)) AND (`guid` IN (65654)); From ddc9397413854374ea33f2cab518c24b23347d6d Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Wed, 1 Oct 2025 02:42:02 -0500 Subject: [PATCH 4/6] fix(DB/gameobject): Adjust Quetz'lun's Corpse Spell Focus location (#22944) --- data/sql/updates/pending_db_world/rev_1758041289461617900.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 data/sql/updates/pending_db_world/rev_1758041289461617900.sql diff --git a/data/sql/updates/pending_db_world/rev_1758041289461617900.sql b/data/sql/updates/pending_db_world/rev_1758041289461617900.sql new file mode 100644 index 000000000..545a4a56c --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1758041289461617900.sql @@ -0,0 +1 @@ +UPDATE `gameobject` SET `position_x` = 5716.26, `position_y` = -4369.34, `position_z` = 385.885 WHERE `guid` = 99747 AND `id` = 190739; From a0a8187ea468d26b0ce800157ebd526b50ab4141 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 1 Oct 2025 07:43:05 +0000 Subject: [PATCH 5/6] chore(DB): import pending files Referenced commit(s): ddc9397413854374ea33f2cab518c24b23347d6d --- .../rev_1758041289461617900.sql => db_world/2025_10_01_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1758041289461617900.sql => db_world/2025_10_01_01.sql} (75%) diff --git a/data/sql/updates/pending_db_world/rev_1758041289461617900.sql b/data/sql/updates/db_world/2025_10_01_01.sql similarity index 75% rename from data/sql/updates/pending_db_world/rev_1758041289461617900.sql rename to data/sql/updates/db_world/2025_10_01_01.sql index 545a4a56c..b1f4556d3 100644 --- a/data/sql/updates/pending_db_world/rev_1758041289461617900.sql +++ b/data/sql/updates/db_world/2025_10_01_01.sql @@ -1 +1,2 @@ +-- DB update 2025_10_01_00 -> 2025_10_01_01 UPDATE `gameobject` SET `position_x` = 5716.26, `position_y` = -4369.34, `position_z` = 385.885 WHERE `guid` = 99747 AND `id` = 190739; From dbd4aaf0655ac2742e7fc6c08bd688fd8d4edef8 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Wed, 1 Oct 2025 07:16:32 -0300 Subject: [PATCH 6/6] feat(Core/Updater): Add configurable shutdown delay on update exceptions (#23042) --- src/server/apps/worldserver/worldserver.conf.dist | 8 ++++++++ src/server/database/Updater/DBUpdater.cpp | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/src/server/apps/worldserver/worldserver.conf.dist b/src/server/apps/worldserver/worldserver.conf.dist index 8f54e0dd0..89863ac4f 100644 --- a/src/server/apps/worldserver/worldserver.conf.dist +++ b/src/server/apps/worldserver/worldserver.conf.dist @@ -343,6 +343,14 @@ Updates.AllowRehash = 1 Updates.CleanDeadRefMaxCount = 3 +# +# Updates.ExceptionShutdownDelay +# Description: Time (in milliseconds) to wait before shutting down after a fatal exception (e.g. failed SQL update). +# Default: 10000 - 10 seconds +# 0 - Disabled (immediate shutdown) + +Updates.ExceptionShutdownDelay = 10000 + # ################################################################################################### diff --git a/src/server/database/Updater/DBUpdater.cpp b/src/server/database/Updater/DBUpdater.cpp index eecce68a1..442b48bcb 100644 --- a/src/server/database/Updater/DBUpdater.cpp +++ b/src/server/database/Updater/DBUpdater.cpp @@ -518,7 +518,12 @@ void DBUpdater::ApplyFile(DatabaseWorkerPool& pool, std::string const& hos path.generic_string(), pool.GetConnectionInfo()->database); if (!sConfigMgr->isDryRun()) + { + if (uint32 delay = sConfigMgr->GetOption("Updates.ExceptionShutdownDelay", 10000)) + std::this_thread::sleep_for(Milliseconds(delay)); + throw UpdateException("update failed"); + } } }