diff options
-rw-r--r-- | data/sql/updates/db_world/2025_10_01_00.sql | 6 | ||||
-rw-r--r-- | data/sql/updates/db_world/2025_10_01_01.sql | 2 | ||||
-rw-r--r-- | data/sql/updates/db_world/2025_10_01_02.sql | 3 | ||||
-rw-r--r-- | src/server/apps/worldserver/worldserver.conf.dist | 8 | ||||
-rw-r--r-- | src/server/database/Updater/DBUpdater.cpp | 5 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_go.cpp | 5 |
6 files changed, 25 insertions, 4 deletions
diff --git a/data/sql/updates/db_world/2025_10_01_00.sql b/data/sql/updates/db_world/2025_10_01_00.sql new file mode 100644 index 0000000000..b3ff20f890 --- /dev/null +++ b/data/sql/updates/db_world/2025_10_01_00.sql @@ -0,0 +1,6 @@ +-- 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)); +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); diff --git a/data/sql/updates/db_world/2025_10_01_01.sql b/data/sql/updates/db_world/2025_10_01_01.sql new file mode 100644 index 0000000000..b1f4556d39 --- /dev/null +++ b/data/sql/updates/db_world/2025_10_01_01.sql @@ -0,0 +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; diff --git a/data/sql/updates/db_world/2025_10_01_02.sql b/data/sql/updates/db_world/2025_10_01_02.sql new file mode 100644 index 0000000000..748f761d5c --- /dev/null +++ b/data/sql/updates/db_world/2025_10_01_02.sql @@ -0,0 +1,3 @@ +-- DB update 2025_10_01_01 -> 2025_10_01_02 +UPDATE `creature_template_model` SET `VerifiedBuild` = 51831 WHERE `CreatureID` IN (33666, 33669); +UPDATE `creature_template_model` SET `Probability` = 0 WHERE `CreatureID` = 33669 AND `CreatureDisplayID` = 27343; diff --git a/src/server/apps/worldserver/worldserver.conf.dist b/src/server/apps/worldserver/worldserver.conf.dist index 8f54e0dd0e..89863ac4f9 100644 --- a/src/server/apps/worldserver/worldserver.conf.dist +++ b/src/server/apps/worldserver/worldserver.conf.dist @@ -344,6 +344,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 eecce68a12..442b48bcb8 100644 --- a/src/server/database/Updater/DBUpdater.cpp +++ b/src/server/database/Updater/DBUpdater.cpp @@ -518,7 +518,12 @@ void DBUpdater<T>::ApplyFile(DatabaseWorkerPool<T>& pool, std::string const& hos path.generic_string(), pool.GetConnectionInfo()->database); if (!sConfigMgr->isDryRun()) + { + if (uint32 delay = sConfigMgr->GetOption<uint32>("Updates.ExceptionShutdownDelay", 10000)) + std::this_thread::sleep_for(Milliseconds(delay)); + throw UpdateException("update failed"); + } } } diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index 0e6bca4220..5f2e5a51d4 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) |