Compare commits

..

5 Commits

Author SHA1 Message Date
manstfu
d1fcca82a0
Merge 2596661866af78f8a58eac0dfcd77667d0cdc1e5 into b80da061523e9b730a84c0776a4706d043abe785 2025-02-19 00:02:19 +01:00
55Honey
b80da06152
fix(Core/Auth): prevent expansion overflow in SendAuthResponse (#21503) 2025-02-18 20:41:11 +01:00
github-actions[bot]
86ee1a994c chore(DB): import pending files
Referenced commit(s): fca4ee32cde06aa42b4120e2540b16b52c165278
2025-02-18 17:50:05 +00:00
Rocco Silipo
fca4ee32cd
fix (DB/Creature) Alarmed Blightguards now spawn as they should. (#21489) 2025-02-18 18:49:00 +01:00
Takenbacon
854ebc8025
fix(Core/Server): Add bytebuffer exception handling to addoninfo read (#21500) 2025-02-18 12:15:59 +01:00
3 changed files with 75 additions and 42 deletions

View File

@ -0,0 +1,21 @@
-- DB update 2025_02_16_03 -> 2025_02_18_00
-- Remove Wrong Spawns
DELETE FROM `creature` WHERE `id1` = 28745;
-- Blight Cauldron Bunny 00 SmartAI
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28739;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28739);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(28739, 0, 0, 1, 8, 0, 100, 0, 52227, 0, 0, 0, 0, 0, 11, 52228, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Cauldron Bunny 00 - On Spellhit \'Dilute Blight Cauldron\' - Cast \'Kill Credit\''),
(28739, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 52231, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Cauldron Bunny 00 - On Spellhit \'Dilute Blight Cauldron\' - Cast \'Cauldron Diluted Effect\''),
(28739, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 12, 28745, 4, 30000, 0, 0, 0, 202, 20, 3, 1, 0, 0, 0, 0, 0, 'Blight Cauldron Bunny 00 - On Spellhit \'Dilute Blight Cauldron\' - Summon Creature \'Alarmed Blightguard\''),
(28739, 0, 3, 0, 1, 0, 100, 512, 30000, 30000, 30000, 30000, 0, 0, 28, 52231, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Cauldron Bunny 00 - Out of Combat - Remove Aura \'Cauldron Diluted Effect\'');
-- Set Random Movement for Alarmed Blightguard
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28745;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28745);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(28745, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 0, 0, 89, 10, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Alarmed Blightguard - On Reset - Start Random Movement');

View File

@ -26,7 +26,12 @@ void WorldSession::SendAuthResponse(uint8 code, bool shortForm, uint32 queuePos)
packet << uint32(0); // BillingTimeRemaining
packet << uint8(0); // BillingPlanFlags
packet << uint32(0); // BillingTimeRested
packet << uint8(Expansion()); // 0 - normal, 1 - TBC, 2 - WOTLK, must be set in database manually for each account
uint8 exp = Expansion(); // 0 - normal, 1 - TBC, 2 - WOTLK, must be set in database manually for each account
if (exp >= MAX_EXPANSIONS)
exp = MAX_EXPANSIONS - 1;
packet << uint8(exp);
if (!shortForm)
{

View File

@ -1148,57 +1148,64 @@ void WorldSession::ReadAddonsInfo(ByteBuffer& data)
if (uncompress(addonInfo.contents(), &uSize, data.contents() + pos, data.size() - pos) == Z_OK)
{
uint32 addonsCount;
addonInfo >> addonsCount; // addons count
for (uint32 i = 0; i < addonsCount; ++i)
try
{
std::string addonName;
uint8 enabled;
uint32 crc, unk1;
uint32 addonsCount;
addonInfo >> addonsCount; // addons count
// check next addon data format correctness
if (addonInfo.rpos() + 1 > addonInfo.size())
return;
addonInfo >> addonName;
addonInfo >> enabled >> crc >> unk1;
LOG_DEBUG("network", "ADDON: Name: {}, Enabled: 0x{:x}, CRC: 0x{:x}, Unknown2: 0x{:x}", addonName, enabled, crc, unk1);
AddonInfo addon(addonName, enabled, crc, 2, true);
SavedAddon const* savedAddon = AddonMgr::GetAddonInfo(addonName);
if (savedAddon)
for (uint32 i = 0; i < addonsCount; ++i)
{
bool match = true;
std::string addonName;
uint8 enabled;
uint32 crc, unk1;
if (addon.CRC != savedAddon->CRC)
match = false;
// check next addon data format correctness
if (addonInfo.rpos() + 1 > addonInfo.size())
return;
if (!match)
LOG_DEBUG("network", "ADDON: {} was known, but didn't match known CRC (0x{:x})!", addon.Name, savedAddon->CRC);
addonInfo >> addonName;
addonInfo >> enabled >> crc >> unk1;
LOG_DEBUG("network", "ADDON: Name: {}, Enabled: 0x{:x}, CRC: 0x{:x}, Unknown2: 0x{:x}", addonName, enabled, crc, unk1);
AddonInfo addon(addonName, enabled, crc, 2, true);
SavedAddon const* savedAddon = AddonMgr::GetAddonInfo(addonName);
if (savedAddon)
{
bool match = true;
if (addon.CRC != savedAddon->CRC)
match = false;
if (!match)
LOG_DEBUG("network", "ADDON: {} was known, but didn't match known CRC (0x{:x})!", addon.Name, savedAddon->CRC);
else
LOG_DEBUG("network", "ADDON: {} was known, CRC is correct (0x{:x})", addon.Name, savedAddon->CRC);
}
else
LOG_DEBUG("network", "ADDON: {} was known, CRC is correct (0x{:x})", addon.Name, savedAddon->CRC);
}
else
{
AddonMgr::SaveAddon(addon);
{
AddonMgr::SaveAddon(addon);
LOG_DEBUG("network", "ADDON: {} (0x{:x}) was not known, saving...", addon.Name, addon.CRC);
LOG_DEBUG("network", "ADDON: {} (0x{:x}) was not known, saving...", addon.Name, addon.CRC);
}
/// @todo: Find out when to not use CRC/pubkey, and other possible states.
m_addonsList.push_back(addon);
}
/// @todo: Find out when to not use CRC/pubkey, and other possible states.
m_addonsList.push_back(addon);
uint32 currentTime;
addonInfo >> currentTime;
LOG_DEBUG("network", "ADDON: CurrentTime: {}", currentTime);
if (addonInfo.rpos() != addonInfo.size())
LOG_DEBUG("network", "packet under-read!");
}
catch (ByteBufferException const& e)
{
LOG_ERROR("network", "Addon packet read error! {}", e.what());
}
uint32 currentTime;
addonInfo >> currentTime;
LOG_DEBUG("network", "ADDON: CurrentTime: {}", currentTime);
if (addonInfo.rpos() != addonInfo.size())
LOG_DEBUG("network", "packet under-read!");
}
else
LOG_ERROR("network", "Addon packet uncompress error!");