Skip to content

Commit

Permalink
Merge 3.3.5 to npcbots_3.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Actions committed Apr 26, 2024
2 parents 8dd58da + 4380924 commit 3838ae1
Show file tree
Hide file tree
Showing 10 changed files with 747 additions and 15 deletions.
2 changes: 1 addition & 1 deletion dep/boost/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (WIN32)
# On windows the requirements are higher according to the wiki.
set(BOOST_REQUIRED_VERSION 1.78)
else()
set(BOOST_REQUIRED_VERSION 1.71)
set(BOOST_REQUIRED_VERSION 1.74)
endif()

find_package(Boost ${BOOST_REQUIRED_VERSION} REQUIRED system filesystem program_options iostreams regex locale)
Expand Down
719 changes: 719 additions & 0 deletions sql/updates/world/3.3.5/2024_04_21_00_world.sql

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/common/Configuration/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "Config.h"
#include "Log.h"
#include "StringConvert.h"
#include <boost/filesystem/directory.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/property_tree/ini_parser.hpp>
#include <algorithm>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_SEL_ACCOUNT_INSTANCELOCKTIMES, "SELECT instanceId, releaseTime FROM account_instance_times WHERE accountId = ?", CONNECTION_ASYNC);

PrepareStatement(CHAR_SEL_CHARACTER_ACTIONS_SPEC, "SELECT button, action, type FROM character_action WHERE guid = ? AND spec = ? ORDER BY button", CONNECTION_ASYNC);
PrepareStatement(CHAR_SEL_MAILITEMS, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, item_guid, itemEntry, ii.owner_guid, m.id FROM mail_items mi INNER JOIN mail m ON mi.mail_id = m.id LEFT JOIN item_instance ii ON mi.item_guid = ii.guid WHERE m.receiver = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_SEL_MAILITEMS, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, item_guid, itemEntry, ii.owner_guid, m.id FROM mail_items mi INNER JOIN mail m ON mi.mail_id = m.id LEFT JOIN item_instance ii ON mi.item_guid = ii.guid WHERE m.receiver = ?", CONNECTION_BOTH);
PrepareStatement(CHAR_SEL_AUCTION_ITEMS, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, ii.flags, enchantments, randomPropertyId, durability, playedTime, text, itemguid, itemEntry FROM auctionhouse ah JOIN item_instance ii ON ah.itemguid = ii.guid", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_AUCTIONS, "SELECT id, houseid, itemguid, itemEntry, count, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit, ah.Flags FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid", CONNECTION_SYNCH);
PrepareStatement(CHAR_INS_AUCTION, "INSERT INTO auctionhouse (id, houseid, itemguid, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit, Flags) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
Expand Down
4 changes: 2 additions & 2 deletions src/server/database/Updater/UpdateFetcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
*/

#include "UpdateFetcher.h"
#include "Common.h"
#include "CryptoHash.h"
#include "DBUpdater.h"
#include "Field.h"
#include "CryptoHash.h"
#include "Log.h"
#include "QueryResult.h"
#include "Util.h"
#include <boost/filesystem/directory.hpp>
#include <boost/filesystem/operations.hpp>
#include <fstream>
#include <sstream>
Expand Down
21 changes: 16 additions & 5 deletions src/server/game/Movement/Spline/MoveSpline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,25 @@ bool MoveSplineInitArgs::Validate(Unit* unit) const
// each vertex offset packed into 11 bytes
bool MoveSplineInitArgs::_checkPathBounds() const
{
constexpr float MIN_XY_OFFSET = -(1 << 11) / 4.0f;
constexpr float MIN_Z_OFFSET = -(1 << 10) / 4.0f;

// positive values have 1 less bit limit (if the highest bit was set, value would be sign extended into negative when decompressing)
constexpr float MAX_XY_OFFSET = (1 << 10) / 4.0f;
constexpr float MAX_Z_OFFSET = (1 << 9) / 4.0f;

auto isValidPackedXYOffset = [](float coord) -> bool { return coord > MIN_XY_OFFSET && coord < MAX_XY_OFFSET; };
auto isValidPackedZOffset = [](float coord) -> bool { return coord > MIN_Z_OFFSET && coord < MAX_Z_OFFSET; };

if (!(flags & MoveSplineFlag::Mask_CatmullRom) && path.size() > 2)
{
constexpr float MAX_OFFSET = float((1 << 11) / 2);
Vector3 middle = (path.front()+path.back()) / 2;
for (uint32 i = 1; i < path.size()-1; ++i)
Vector3 middle = (path.front() + path.back()) / 2;
for (uint32 i = 1; i < path.size() - 1; ++i)
{
Vector3 offset = path[i] - middle;
if (std::fabs(offset.x) >= MAX_OFFSET || std::fabs(offset.y) >= MAX_OFFSET || std::fabs(offset.z) >= MAX_OFFSET)
// when compression is enabled, each point coord is packed into 11 bits (10 for Z)
if (!isValidPackedXYOffset(middle.x - path[i].x)
|| !isValidPackedXYOffset(middle.y - path[i].y)
|| !isValidPackedZOffset(middle.z - path[i].z))
{
TC_LOG_ERROR("misc", "MoveSplineInitArgs::_checkPathBounds check failed");
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Scripting/ScriptReloadMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ class HotSwapScriptReloadMgr final

{
boost::system::error_code code;
fs::copy_file(path, cache_path, fs::copy_option::fail_if_exists, code);
fs::copy_file(path, cache_path, code);
if (code)
{
TC_LOG_FATAL("scripts.hotswap", ">> Failed to create cache entry for module "
Expand Down
5 changes: 2 additions & 3 deletions src/server/scripts/Commands/cs_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@ EndScriptData */
#include "VMapManager2.h"
#include "World.h"
#include "WorldSession.h"

#include <numeric>

#include <boost/filesystem/directory.hpp>
#include <boost/filesystem/operations.hpp>
#include <openssl/crypto.h>
#include <openssl/opensslv.h>
#include <numeric>

#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
Expand Down
5 changes: 3 additions & 2 deletions src/tools/map_extractor/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@

#include "adt.h"
#include "wdt.h"
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/directory.hpp>
#include <boost/filesystem/operations.hpp>
#include <cstdio>
#include <boost/filesystem/path.hpp>
#include <deque>
#include <fstream>
#include <set>
#include <unordered_map>
#include <cstdio>
#include <cstdlib>
#include <cstring>

Expand Down
1 change: 1 addition & 0 deletions src/tools/vmap4_extractor/vmapexport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "wdtfile.h"
#include "wmo.h"
#include "mpq_libmpq04.h"
#include <boost/filesystem/directory.hpp>
#include <boost/filesystem/operations.hpp>
#include <fstream>
#include <iostream>
Expand Down

0 comments on commit 3838ae1

Please sign in to comment.