Merge commit '6c1e4bc20d68d9fb548eb4896bd8b84a4c3ec4ff' into 4.3.4

Conflicts:
	README.md
	sql/updates/world/2015_04_04_00_world.sql
	sql/updates/world/2015_04_04_01_world.sql
	sql/updates/world/2015_04_05_06_world_335.sql
	src/server/game/Battlegrounds/Battleground.cpp
	src/server/game/DataStores/DBCStores.cpp
	src/server/game/DataStores/DBCStructure.h
	src/server/game/DataStores/DBCfmt.h
	src/server/game/Entities/Object/Object.cpp
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Player/Player.h
	src/server/game/Entities/Unit/Unit.cpp
	src/server/game/Handlers/CharacterHandler.cpp
	src/server/game/Server/WorldSession.cpp
	src/server/game/Server/WorldSocket.cpp
	src/server/game/Spells/Spell.cpp
	src/server/game/Spells/SpellInfo.cpp
	src/server/game/World/World.cpp
	src/server/scripts/Commands/cs_account.cpp
	src/tools/map_extractor/System.cpp
	src/tools/vmap4_extractor/adtfile.cpp
This commit is contained in:
Carbenium committed 2015-07-22 00:54:34 +02:00
commit 224c7dc6ae
181 files changed
+707 -1014

No files matched your search

+2
View File
@@ -50,6 +50,8 @@ endif()
include(CheckPlatform)
include(GroupSources)
# basic packagesearching and setup (further support will be needed, this is a preliminary release!)
set(OPENSSL_EXPECTED_VERSION 1.0.0)
+46
View File
@@ -0,0 +1,46 @@
# Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
macro(GroupSources dir)
# Skip this if WITH_SOURCE_TREE is not set (empty string).
if (NOT ${_WITH_SOURCE_TREE} STREQUAL "")
# Include all header and c files
file(GLOB_RECURSE elements RELATIVE ${dir} *.h *.hpp *.c *.cpp *.cc)
foreach(element ${elements})
# Extract filename and directory
get_filename_component(element_name ${element} NAME)
get_filename_component(element_dir ${element} DIRECTORY)
if (NOT ${element_dir} STREQUAL "")
# If the file is in a subdirectory use it as source group.
if (${_WITH_SOURCE_TREE} STREQUAL "flat")
# Build flat structure by using only the first subdirectory.
string(FIND ${element_dir} "/" delemiter_pos)
if (NOT ${delemiter_pos} EQUAL -1)
string(SUBSTRING ${element_dir} 0 ${delemiter_pos} group_name)
source_group("${group_name}" FILES ${dir}/${element})
else()
# Build hierarchical structure.
# File is in root directory.
source_group("${element_dir}" FILES ${dir}/${element})
endif()
else()
# Use the full hierarchical structure to build source_groups.
string(REPLACE "/" "\\" group_name ${element_dir})
source_group("${group_name}" FILES ${dir}/${element})
endif()
else()
# If the file is in the root directory, place it in the root source_group.
source_group("\\" FILES ${dir}/${element})
endif()
endforeach()
endif()
endmacro()
+2
View File
@@ -15,4 +15,6 @@ option(USE_SCRIPTPCH "Use precompiled headers when compiling scripts"
option(USE_COREPCH "Use precompiled headers when compiling servers" 1)
option(WITH_WARNINGS "Show all warnings during compile" 0)
option(WITH_COREDEBUG "Include additional debug-code in core" 0)
set(WITH_SOURCE_TREE "no" CACHE STRING "Build the source tree for IDE's.")
set_property(CACHE WITH_SOURCE_TREE PROPERTY STRINGS no flat hierarchical)
option(WITHOUT_GIT "Disable the GIT testing routines" 0)
+23
View File
@@ -62,6 +62,29 @@ else()
message("* Use coreside debug : No (default)")
endif()
if( WITH_SOURCE_TREE STREQUAL "flat" OR WITH_SOURCE_TREE STREQUAL "hierarchical" )
# TODO: Remove this after Debian 8 is released and set general required version to 2.8.12
# Debian 7 is shipped with CMake 2.8.9 . But DIRECTORY flag of get_filename_component requires 2.8.12 .
if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
message("* Show source tree : Yes - ${WITH_SOURCE_TREE}")
set(_WITH_SOURCE_TREE ${WITH_SOURCE_TREE} CACHE INTERNAL "WITH_SOURCE_TREE support enabled.")
else()
message("* Show source tree : No (default)")
message("")
message(" *** WITH_SOURCE_TREE - WARNING!")
message(" *** This functionality is ONLY supported on CMake 2.8.12 or higher.")
message(" *** You are running ${CMAKE_VERSION}, which does not have the functions needed")
message(" *** to create a sourcetree - this option is thus forced to disabled!")
message("")
set(_WITH_SOURCE_TREE "" CACHE INTERNAL "WITH_SOURCE_TREE support disabled.")
endif()
else()
message("* Show source tree : No (default)")
set(_WITH_SOURCE_TREE "" CACHE INTERNAL "WITH_SOURCE_TREE support disabled.")
endif()
if ( WITHOUT_GIT )
message("* Use GIT revision hash : No")
message("")
+1 -1
View File
@@ -14,7 +14,7 @@ bzip2 (a freely available, patent free, high-quality data compressor)
cppformat (type safe format library)
https://github.com/cppformat/cppformat
Version: 1.1.0 bf8636c9596fbfddded3d0f5879abc7579c9f4dd
Version: 1.1.0 fd53bb6fb88a23e38ec4fe331bfe95d7372d49c9
G3D (a commercial-grade C++ 3D engine available as Open Source (BSD License)
http://g3d.sourceforge.net/
+11 -28
View File
@@ -67,25 +67,7 @@ using fmt::internal::Arg;
# if FMT_EXCEPTIONS
# define FMT_THROW(x) throw x
# else
# ifndef NDEBUG
# define FMT_THROW(x) assert(false && #x)
# elif defined _MSC_VER
# define FMT_THROW(x) __assume(0)
# elif defined __clang__ || FMT_GCC_VERSION >= 405
# define FMT_THROW(x) __builtin_unreachable()
# else
# define FMT_THROW(x) std::abort()
# endif
# endif
#endif
#ifndef FMT_NORETURN
# if defined __GNUC__ || defined __clang__
# define FMT_NORETURN __attribute__((__noreturn__))
# elif defined _MSC_VER
# define FMT_NORETURN __declspec(noreturn)
# else
# define FMT_NORETURN
# define FMT_THROW(x) assert(false)
# endif
#endif
@@ -176,6 +158,9 @@ int safe_strerror(
char *&buffer_;
std::size_t buffer_size_;
// A noop assignment operator to avoid bogus warnings.
void operator=(const StrError &) {}
// Handle the result of XSI-compliant version of strerror_r.
int handle(int result) {
// glibc versions before 2.13 return result in errno.
@@ -226,14 +211,14 @@ void format_error_code(fmt::Writer &out, int error_code,
// bad_alloc.
out.clear();
static const char SEP[] = ": ";
static const char _ERR[] = "error ";
static const char ERROR_STR[] = "error ";
fmt::internal::IntTraits<int>::MainType ec_value = error_code;
// Subtract 2 to account for terminating null characters in SEP and _ERR.
std::size_t error_code_size =
sizeof(SEP) + sizeof(_ERR) + fmt::internal::count_digits(ec_value) - 2;
// Subtract 2 to account for terminating null characters in SEP and ERROR_STR.
std::size_t error_code_size = sizeof(SEP) + sizeof(ERROR_STR) - 2;
error_code_size += fmt::internal::count_digits(ec_value);
if (message.size() <= fmt::internal::INLINE_BUFFER_SIZE - error_code_size)
out << message << SEP;
out << _ERR << error_code;
out << ERROR_STR << error_code;
assert(out.size() <= fmt::internal::INLINE_BUFFER_SIZE);
}
@@ -304,8 +289,7 @@ class WidthHandler : public fmt::internal::ArgVisitor<WidthHandler, unsigned> {
public:
explicit WidthHandler(fmt::FormatSpec &spec) : spec_(spec) {}
FMT_NORETURN
unsigned visit_unhandled_arg() {
void report_unhandled_arg() {
FMT_THROW(fmt::FormatError("width is not integer"));
}
@@ -326,8 +310,7 @@ class WidthHandler : public fmt::internal::ArgVisitor<WidthHandler, unsigned> {
class PrecisionHandler :
public fmt::internal::ArgVisitor<PrecisionHandler, int> {
public:
FMT_NORETURN
unsigned visit_unhandled_arg() {
void report_unhandled_arg() {
FMT_THROW(fmt::FormatError("precision is not integer"));
}
+126 -69
View File
@@ -100,6 +100,7 @@ inline uint32_t clzll(uint64_t x) {
#endif
#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdocumentation"
#endif
@@ -282,7 +283,6 @@ class FormatError : public std::runtime_error {
};
namespace internal {
// The number of characters to store in the MemoryBuffer object itself
// to avoid dynamic memory allocation.
enum { INLINE_BUFFER_SIZE = 500 };
@@ -297,8 +297,9 @@ inline stdext::checked_array_iterator<T*> make_ptr(T *ptr, std::size_t size) {
template <typename T>
inline T *make_ptr(T *ptr, std::size_t) { return ptr; }
#endif
} // namespace internal
// A buffer for POD types. It supports a subset of std::vector's operations.
/** A buffer supporting a subset of ``std::vector``'s operations. */
template <typename T>
class Buffer {
private:
@@ -312,25 +313,31 @@ class Buffer {
Buffer(T *ptr = 0, std::size_t capacity = 0)
: ptr_(ptr), size_(0), capacity_(capacity) {}
/**
Increases the buffer capacity to hold at least *size* elements updating
``ptr_`` and ``capacity_``.
*/
virtual void grow(std::size_t size) = 0;
public:
virtual ~Buffer() {}
// Returns the size of this buffer.
/** Returns the size of this buffer. */
std::size_t size() const { return size_; }
// Returns the capacity of this buffer.
/** Returns the capacity of this buffer. */
std::size_t capacity() const { return capacity_; }
// Resizes the buffer. If T is a POD type new elements are not initialized.
/**
Resizes the buffer. If T is a POD type new elements may not be initialized.
*/
void resize(std::size_t new_size) {
if (new_size > capacity_)
grow(new_size);
size_ = new_size;
}
// Reserves space to store at least capacity elements.
/** Reserves space to store at least *capacity* elements. */
void reserve(std::size_t capacity) {
if (capacity > capacity_)
grow(capacity);
@@ -344,7 +351,7 @@ class Buffer {
ptr_[size_++] = value;
}
// Appends data to the end of the buffer.
/** Appends data to the end of the buffer. */
void append(const T *begin, const T *end);
T &operator[](std::size_t index) { return ptr_[index]; }
@@ -356,10 +363,12 @@ void Buffer<T>::append(const T *begin, const T *end) {
std::ptrdiff_t num_elements = end - begin;
if (size_ + num_elements > capacity_)
grow(size_ + num_elements);
std::copy(begin, end, make_ptr(ptr_, capacity_) + size_);
std::copy(begin, end, internal::make_ptr(ptr_, capacity_) + size_);
size_ += num_elements;
}
namespace internal {
// A memory buffer for POD types with the first SIZE elements stored in
// the object itself.
template <typename T, std::size_t SIZE, typename Allocator = std::allocator<T> >
@@ -438,10 +447,9 @@ void MemoryBuffer<T, SIZE, Allocator>::grow(std::size_t size) {
// A fixed-size buffer.
template <typename Char>
class FixedBuffer : public fmt::internal::Buffer<Char> {
class FixedBuffer : public fmt::Buffer<Char> {
public:
FixedBuffer(Char *array, std::size_t size)
: fmt::internal::Buffer<Char>(array, size) {}
FixedBuffer(Char *array, std::size_t size) : fmt::Buffer<Char>(array, size) {}
protected:
void grow(std::size_t size);
@@ -692,21 +700,16 @@ void format_windows_error(fmt::Writer &out, int error_code,
fmt::StringRef message) FMT_NOEXCEPT;
#endif
// Computes max(Arg, 1) at compile time. It is used to avoid errors about
// Computes max(N, 1) at compile time. It is used to avoid errors about
// allocating an array of 0 size.
template <unsigned Arg>
template <unsigned N>
struct NonZero {
enum { VALUE = Arg };
enum { VALUE = N > 0 ? N : 1 };
};
template <>
struct NonZero<0> {
enum { VALUE = 1 };
};
// The value of a formatting argument. It is a POD type to allow storage in
// A formatting argument. It is a POD type to allow storage in
// internal::MemoryBuffer.
struct Value {
struct Arg {
template <typename Char>
struct StringValue {
const Char *value;
@@ -735,9 +738,7 @@ struct Value {
StringValue<wchar_t> wstring;
CustomValue custom;
};
};
struct Arg : Value {
enum Type {
NONE,
// Integer types should go first,
@@ -781,15 +782,31 @@ class IsConvertibleToInt {
enum { value = (sizeof(check(get())) == sizeof(yes)) };
};
#define FMT_CONVERTIBLE_TO_INT(Type) \
template <> \
class IsConvertibleToInt<Type> { \
public: \
enum { value = 1 }; \
}
// Silence warnings about convering float to int.
FMT_CONVERTIBLE_TO_INT(float);
FMT_CONVERTIBLE_TO_INT(double);
FMT_CONVERTIBLE_TO_INT(long double);
template<bool B, class T = void>
struct EnableIf {};
template<class T>
struct EnableIf<true, T> { typedef T type; };
// Makes a Value object from any type.
// A helper function to suppress bogus "conditional expression is constant"
// warnings.
inline bool check(bool value) { return value; }
// Makes an Arg object from any type.
template <typename Char>
class MakeValue : public Value {
class MakeValue : public Arg {
private:
// The following two methods are private to disallow formatting of
// arbitrary pointers. If you want to output a pointer cast it to
@@ -846,7 +863,7 @@ class MakeValue : public Value {
MakeValue(long value) {
// To minimize the number of types we need to deal with, long is
// translated either to int or to long long depending on its size.
if (sizeof(long) == sizeof(int))
if (check(sizeof(long) == sizeof(int)))
int_value = static_cast<int>(value);
else
long_long_value = value;
@@ -856,7 +873,7 @@ class MakeValue : public Value {
}
MakeValue(unsigned long value) {
if (sizeof(unsigned long) == sizeof(unsigned))
if (check(sizeof(unsigned long) == sizeof(unsigned)))
uint_value = static_cast<unsigned>(value);
else
ulong_long_value = value;
@@ -949,7 +966,12 @@ class MakeValue : public Value {
template <typename Impl, typename Result>
class ArgVisitor {
public:
Result visit_unhandled_arg() { return Result(); }
void report_unhandled_arg() {}
Result visit_unhandled_arg() {
FMT_DISPATCH(report_unhandled_arg());
return Result();
}
Result visit_int(int value) {
return FMT_DISPATCH(visit_any_int(value));
@@ -1015,7 +1037,7 @@ class ArgVisitor {
case Arg::CHAR:
return FMT_DISPATCH(visit_char(arg.int_value));
case Arg::CSTRING: {
Value::StringValue<char> str = arg.string;
Arg::StringValue<char> str = arg.string;
str.size = 0;
return FMT_DISPATCH(visit_string(str));
}
@@ -1040,42 +1062,49 @@ template <typename Char>
class ArgFormatter;
} // namespace internal
/**
An argument list.
*/
/** An argument list. */
class ArgList {
private:
// To reduce compiled code size per formatting function call, types of first
// MAX_PACKED_ARGS arguments are passed in the types_ field.
uint64_t types_;
const internal::Value *values_;
const internal::Arg *args_;
internal::Arg::Type type(unsigned index) const {
unsigned shift = index * 4;
uint64_t mask = 0xf;
return static_cast<internal::Arg::Type>(
(types_ & (mask << shift)) >> shift);
}
public:
// Maximum number of arguments that can be passed in ArgList.
enum { MAX_ARGS = 16 };
// Maximum number of arguments with packed types.
enum { MAX_PACKED_ARGS = 16 };
ArgList() : types_(0) {}
ArgList(ULongLong types, const internal::Value *values)
: types_(types), values_(values) {}
ArgList(ULongLong types, const internal::Arg *args)
: types_(types), args_(args) {}
/**
Returns the argument at specified index.
*/
/** Returns the argument at specified index. */
internal::Arg operator[](unsigned index) const {
using internal::Arg;
Arg arg;
if (index >= MAX_ARGS) {
if (index < MAX_PACKED_ARGS) {
Arg::Type arg_type = type(index);
if (arg_type != Arg::NONE)
arg = args_[index];
arg.type = arg_type;
return arg;
}
if (type(MAX_PACKED_ARGS - 1) == Arg::NONE) {
arg.type = Arg::NONE;
return arg;
}
unsigned shift = index * 4;
uint64_t mask = 0xf;
Arg::Type type =
static_cast<Arg::Type>((types_ & (mask << shift)) >> shift);
arg.type = type;
if (type != Arg::NONE) {
internal::Value &value = arg;
value = values_[index];
for (unsigned i = MAX_PACKED_ARGS; i <= index; ++i) {
if (args_[i].type == Arg::NONE)
return args_[i];
}
return arg;
return args_[index];
}
};
@@ -1434,11 +1463,11 @@ inline uint64_t make_type(FMT_GEN15(FMT_ARG_TYPE_DEFAULT)) {
# define FMT_VARIADIC_VOID(func, arg_type) \
template <typename... Args> \
void func(arg_type arg1, const Args & ... args) { \
const fmt::internal::Value values[ \
const fmt::internal::Arg array[ \
fmt::internal::NonZero<sizeof...(Args)>::VALUE] = { \
fmt::internal::MakeValue<Char>(args)... \
}; \
func(arg1, ArgList(fmt::internal::make_type(args...), values)); \
func(arg1, ArgList(fmt::internal::make_type(args...), array)); \
}
// Defines a variadic constructor.
@@ -1446,11 +1475,11 @@ inline uint64_t make_type(FMT_GEN15(FMT_ARG_TYPE_DEFAULT)) {
template <typename... Args> \
ctor(arg0_type arg0, arg1_type arg1, const Args & ... args) { \
using fmt::internal::MakeValue; \
const fmt::internal::Value values[ \
const fmt::internal::Arg array[ \
fmt::internal::NonZero<sizeof...(Args)>::VALUE] = { \
MakeValue<Char>(args)... \
}; \
func(arg0, arg1, ArgList(fmt::internal::make_type(args...), values)); \
func(arg0, arg1, ArgList(fmt::internal::make_type(args...), array)); \
}
#else
@@ -1463,9 +1492,9 @@ inline uint64_t make_type(FMT_GEN15(FMT_ARG_TYPE_DEFAULT)) {
# define FMT_WRAP1(func, arg_type, n) \
template <FMT_GEN(n, FMT_MAKE_TEMPLATE_ARG)> \
inline void func(arg_type arg1, FMT_GEN(n, FMT_MAKE_ARG)) { \
const fmt::internal::Value vals[] = {FMT_GEN(n, FMT_MAKE_REF)}; \
const fmt::internal::Arg args[] = {FMT_GEN(n, FMT_MAKE_REF)}; \
func(arg1, fmt::ArgList( \
fmt::internal::make_type(FMT_GEN(n, FMT_MAKE_REF2)), vals)); \
fmt::internal::make_type(FMT_GEN(n, FMT_MAKE_REF2)), args)); \
}
// Emulates a variadic function returning void on a pre-C++11 compiler.
@@ -1480,9 +1509,9 @@ inline uint64_t make_type(FMT_GEN15(FMT_ARG_TYPE_DEFAULT)) {
# define FMT_CTOR(ctor, func, arg0_type, arg1_type, n) \
template <FMT_GEN(n, FMT_MAKE_TEMPLATE_ARG)> \
ctor(arg0_type arg0, arg1_type arg1, FMT_GEN(n, FMT_MAKE_ARG)) { \
const fmt::internal::Value vals[] = {FMT_GEN(n, FMT_MAKE_REF)}; \
const fmt::internal::Arg args[] = {FMT_GEN(n, FMT_MAKE_REF)}; \
func(arg0, arg1, fmt::ArgList( \
fmt::internal::make_type(FMT_GEN(n, FMT_MAKE_REF2)), vals)); \
fmt::internal::make_type(FMT_GEN(n, FMT_MAKE_REF2)), args)); \
}
// Emulates a variadic constructor on a pre-C++11 compiler.
@@ -1592,7 +1621,7 @@ template <typename Char>
class BasicWriter {
private:
// Output buffer.
internal::Buffer<Char> &buffer_;
Buffer<Char> &buffer_;
FMT_DISALLOW_COPY_AND_ASSIGN(BasicWriter);
@@ -1672,7 +1701,7 @@ class BasicWriter {
/**
Constructs a ``BasicWriter`` object.
*/
explicit BasicWriter(internal::Buffer<Char> &b) : buffer_(b) {}
explicit BasicWriter(Buffer<Char> &b) : buffer_(b) {}
public:
/**
@@ -2275,10 +2304,8 @@ template <typename Char, typename T>
void format(BasicFormatter<Char> &f, const Char *&format_str, const T &value) {
std::basic_ostringstream<Char> os;
os << value;
internal::Arg arg;
internal::Value &arg_value = arg;
std::basic_string<Char> str = os.str();
arg_value = internal::MakeValue<Char>(str);
internal::Arg arg = internal::MakeValue<Char>(str);
arg.type = static_cast<internal::Arg::Type>(
internal::MakeValue<Char>::type(str));
format_str = f.format(format_str, arg);
@@ -2575,16 +2602,46 @@ inline void format_decimal(char *&buffer, T value) {
#define FMT_GET_ARG_NAME(type, index) arg##index
#if FMT_USE_VARIADIC_TEMPLATES
namespace fmt {
namespace internal {
inline void do_set_types(Arg *) {}
template <typename T, typename... Args>
inline void do_set_types(Arg *args, const T &arg, const Args & ... tail) {
args->type = static_cast<Arg::Type>(MakeValue<T>::type(arg));
do_set_types(args + 1, tail...);
}
template <typename... Args>
inline void set_types(Arg *array, const Args & ... args) {
do_set_types(array, args...);
array[sizeof...(Args)].type = Arg::NONE;
}
// Computes the argument array size by adding 1 to N, which is the number of
// arguments, if N is zero, because array of zero size is invalid, or if N
// is greater than ArgList::MAX_PACKED_ARGS to accommodate for an extra
// argument that marks the end of the list.
template <unsigned N>
struct ArgArraySize {
enum { VALUE = N + (N == 0 || N > ArgList::MAX_PACKED_ARGS ? 1 : 0) };
};
}
}
# define FMT_VARIADIC_(Char, ReturnType, func, call, ...) \
template <typename... Args> \
ReturnType func(FMT_FOR_EACH(FMT_ADD_ARG_NAME, __VA_ARGS__), \
const Args & ... args) { \
using fmt::internal::Value; \
const Value values[fmt::internal::NonZero<sizeof...(Args)>::VALUE] = { \
using fmt::internal::Arg; \
Arg array[fmt::internal::ArgArraySize<sizeof...(Args)>::VALUE] = { \
fmt::internal::MakeValue<Char>(args)... \
}; \
call(FMT_FOR_EACH(FMT_GET_ARG_NAME, __VA_ARGS__), fmt::ArgList( \
fmt::internal::make_type(args...), values)); \
if (fmt::internal::check((sizeof...(Args) > fmt::ArgList::MAX_PACKED_ARGS))) \
set_types(array, args...); \
call(FMT_FOR_EACH(FMT_GET_ARG_NAME, __VA_ARGS__), \
fmt::ArgList(fmt::internal::make_type(args...), array)); \
}
#else
// Defines a wrapper for a function taking __VA_ARGS__ arguments
@@ -2593,9 +2650,9 @@ inline void format_decimal(char *&buffer, T value) {
template <FMT_GEN(n, FMT_MAKE_TEMPLATE_ARG)> \
inline ReturnType func(FMT_FOR_EACH(FMT_ADD_ARG_NAME, __VA_ARGS__), \
FMT_GEN(n, FMT_MAKE_ARG)) { \
const fmt::internal::Value vals[] = {FMT_GEN(n, FMT_MAKE_REF_##Char)}; \
const fmt::internal::Arg args[] = {FMT_GEN(n, FMT_MAKE_REF_##Char)}; \
call(FMT_FOR_EACH(FMT_GET_ARG_NAME, __VA_ARGS__), fmt::ArgList( \
fmt::internal::make_type(FMT_GEN(n, FMT_MAKE_REF2)), vals)); \
fmt::internal::make_type(FMT_GEN(n, FMT_MAKE_REF2)), args)); \
}
# define FMT_VARIADIC_(Char, ReturnType, func, call, ...) \
+21
View File
@@ -0,0 +1,21 @@
SET @GUID := 69717; -- 4 creature guid Set by TC
SET @OGUID := 5510; -- 1 GOB guid set by TC
DELETE FROM `creature` WHERE `id`=23142;
INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`,`curhealth`) VALUES
(@GUID+0, 23142, 530, 1, 1, -5121.06, 598.424, 84.7603, 0.0581088, 600, 6542),
(@GUID+1, 23142, 530, 1, 1, -5119.60, 601.834, 84.8180, 5.1726200, 600, 6542),
(@GUID+2, 23142, 530, 1, 1, -5115.02, 601.537, 85.0292, 4.0204400, 600, 6542),
(@GUID+3, 23142, 530, 1, 1, -5114.25, 597.062, 85.1574, 2.7049000, 600, 6542);
DELETE FROM `gameobject` WHERE `guid` IN (@OGUID);
INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
(@OGUID,50983,530,1,1, -5116.788574, 631.188660, 85.055522,0.949811,0,0,0.457254, 0.889336, 300, 0, 1);
DELETE FROM `creature_equip_template` WHERE `entry`=23146;
INSERT INTO `creature_equip_template` (`entry`, `id`, `itemEntry1`, `itemEntry2`, `itemEntry3`, `VerifiedBuild`) VALUES (23146, 1, 31603, 0, 0, 0);
UPDATE `creature` SET `position_x`= -5158.237305, `position_y`= 584.302612, `position_z`= 81.074142, `orientation`= 5.954358 WHERE `guid`= 78136;
UPDATE `creature` SET `position_x`= -5156.172363, `position_y`= 590.695251, `position_z`= 80.769630, `orientation`= 5.502757 WHERE `guid`= 78135;
UPDATE `creature` SET `position_x`= -5152.365723, `position_y`= 592.303040, `position_z`= 81.361931, `orientation`= 4.705578 WHERE `guid`= 78137;
UPDATE `creature` SET `position_x`= -5113.345703, `position_y`= 623.850159, `position_z`= 86.736343, `orientation`= 1.033840 WHERE `guid`= 78160;
UPDATE `creature` SET `position_x`= -5123.593750, `position_y`= 626.638916, `position_z`= 86.629669, `orientation`= 1.395123 WHERE `guid`= 78159;
UPDATE `creature` SET `position_x`= -5165.503418, `position_y`= 568.109131, `position_z`= 80.523895, `orientation`= 2.707489 WHERE `guid`= 52107;
+2
View File
@@ -66,6 +66,8 @@ include_directories(
${VALGRIND_INCLUDE_DIR}
)
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(authserver
${authserver_SRCS}
${authserver_PCH_SRC}
-2
View File
@@ -34,9 +34,7 @@
#include "RealmList.h"
#include "SystemConfig.h"
#include "Util.h"
#include <cstdlib>
#include <iostream>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/program_options.hpp>
#include <openssl/opensslv.h>
#include <openssl/crypto.h>
+2
View File
@@ -81,6 +81,8 @@ include_directories(
${VALGRIND_INCLUDE_DIR}
)
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
add_library(collision STATIC
${collision_STAT_SRCS}
${collision_STAT_PCH_SRC}
@@ -236,9 +236,11 @@ namespace VMAP
{
floor = info.ground_Z;
ASSERT(floor < std::numeric_limits<float>::max());
ASSERT(info.hitModel);
type = info.hitModel->GetLiquidType(); // entry from LiquidType.dbc
if (reqLiquidType && !(GetLiquidFlagsPtr(type) & reqLiquidType))
return false;
ASSERT(info.hitInstance);
if (info.hitInstance->GetLiquidLevel(pos, info, level))
return true;
}
@@ -24,7 +24,6 @@
#include <set>
#include <iomanip>
#include <sstream>
#include <iomanip>
using G3D::Vector3;
using G3D::AABox;
@@ -24,8 +24,6 @@
#include "GameObjectModel.h"
#include "Log.h"
#include "GameObject.h"
#include "Creature.h"
#include "TemporarySummon.h"
#include "Object.h"
#include "DBCStores.h"
#include "World.h"
@@ -19,7 +19,6 @@
#include "ModelInstance.h"
#include "WorldModel.h"
#include "MapTree.h"
#include "VMapDefinitions.h"
using G3D::Vector3;
using G3D::Ray;
@@ -17,7 +17,6 @@
*/
#include "WorldModel.h"
#include "ModelInstance.h"
#include "VMapDefinitions.h"
#include "MapTree.h"
-3
View File
@@ -19,9 +19,6 @@
#include "GuardAI.h"
#include "Errors.h"
#include "Player.h"
#include "ObjectAccessor.h"
#include "World.h"
#include "CreatureAIImpl.h"
int GuardAI::Permissible(Creature const* creature)
{
-1
View File
@@ -18,7 +18,6 @@
#include "PassiveAI.h"
#include "Creature.h"
#include "TemporarySummon.h"
PassiveAI::PassiveAI(Creature* c) : CreatureAI(c) { me->SetReactState(REACT_PASSIVE); }
PossessedAI::PossessedAI(Creature* c) : CreatureAI(c) { me->SetReactState(REACT_PASSIVE); }
-2
View File
@@ -20,12 +20,10 @@
#include "Errors.h"
#include "Pet.h"
#include "Player.h"
#include "DBCStores.h"
#include "Spell.h"
#include "ObjectAccessor.h"
#include "SpellMgr.h"
#include "Creature.h"
#include "World.h"
#include "Util.h"
#include "Group.h"
#include "SpellInfo.h"
-4
View File
@@ -18,10 +18,6 @@
#include "ByteBuffer.h"
#include "ReactorAI.h"
#include "Errors.h"
#include "Log.h"
#include "ObjectAccessor.h"
#include "CreatureAIImpl.h"
int ReactorAI::Permissible(const Creature* creature)
{
-2
View File
@@ -19,10 +19,8 @@
#include "TotemAI.h"
#include "Totem.h"
#include "Creature.h"
#include "DBCStores.h"
#include "ObjectAccessor.h"
#include "SpellMgr.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
@@ -21,7 +21,6 @@
#include "PassiveAI.h"
#include "MovementGenerator.h"
#include "Pet.h"
#include "TemporarySummon.h"
#include "CreatureAIFactory.h"
#include "ScriptMgr.h"
@@ -17,14 +17,12 @@
*/
#include "ScriptedCreature.h"
#include "Item.h"
#include "Spell.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "Cell.h"
#include "CellImpl.h"
#include "ObjectMgr.h"
#include "TemporarySummon.h"
// Spell summary for ScriptedAI::SelectSpell
struct TSpellSummary
@@ -21,11 +21,7 @@
#include "GridDefines.h"
#include "GridNotifiers.h"
#include "SpellMgr.h"
#include "GridNotifiersImpl.h"
#include "Cell.h"
#include "CellImpl.h"
#include "InstanceScript.h"
#include "ScriptedCreature.h"
#include "Group.h"
#include "SmartAI.h"
#include "ScriptMgr.h"
@@ -35,7 +35,6 @@
#include "SmartScript.h"
#include "SpellMgr.h"
#include "Vehicle.h"
#include "MoveSplineInit.h"
#include "GameEventMgr.h"
SmartScript::SmartScript()
@@ -17,18 +17,12 @@
#include "DatabaseEnv.h"
#include "ObjectMgr.h"
#include "ObjectDefines.h"
#include "GridDefines.h"
#include "GridNotifiers.h"
#include "SpellMgr.h"
#include "GridNotifiersImpl.h"
#include "Cell.h"
#include "CellImpl.h"
#include "InstanceScript.h"
#include "ScriptedCreature.h"
#include "GameEventMgr.h"
#include "CreatureTextMgr.h"
#include "SpellMgr.h"
#include "SpellInfo.h"
#include "SmartScriptMgr.h"
@@ -30,7 +30,6 @@
#include "Item.h"
#include "Language.h"
#include "Log.h"
#include <vector>
enum eAuctionHouse
{
@@ -21,7 +21,6 @@
#include "CellImpl.h"
#include "CreatureTextMgr.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
#include "GroupMgr.h"
#include "Map.h"
@@ -17,7 +17,6 @@
#include "BattlefieldMgr.h"
#include "BattlefieldWG.h"
#include "ObjectMgr.h"
#include "Player.h"
BattlefieldMgr::BattlefieldMgr()
@@ -28,12 +28,10 @@
#include "Group.h"
#include "GuildMgr.h"
#include "Guild.h"
#include "MapManager.h"
#include "Object.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ReputationMgr.h"
#include "SpellAuraEffects.h"
#include "SpellAuras.h"
#include "Util.h"
#include "WorldPacket.h"
@@ -22,7 +22,6 @@
#include "World.h"
#include "WorldPacket.h"
#include "ArenaTeam.h"
#include "BattlegroundMgr.h"
#include "BattlegroundAV.h"
#include "BattlegroundAB.h"
@@ -39,7 +38,6 @@
#include "BattlegroundBFG.h"
#include "Chat.h"
#include "Map.h"
#include "MapInstanced.h"
#include "MapManager.h"
#include "Player.h"
#include "GameEventMgr.h"
@@ -24,8 +24,8 @@
#include "Group.h"
#include "Log.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ObjectAccessor.h"
/*********************************************************/
/*** BATTLEGROUND QUEUE SYSTEM ***/
@@ -17,9 +17,7 @@
*/
#include "BattlegroundAB.h"
#include "World.h"
#include "WorldPacket.h"
#include "ObjectMgr.h"
#include "BattlegroundMgr.h"
#include "Creature.h"
#include "Language.h"
@@ -26,7 +26,6 @@
#include "Language.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellAuras.h"
#include "WorldSession.h"
BattlegroundAV::BattlegroundAV()
@@ -18,7 +18,6 @@
#include "BattlegroundEY.h"
#include "ObjectMgr.h"
#include "World.h"
#include "WorldPacket.h"
#include "BattlegroundMgr.h"
#include "Creature.h"
@@ -25,7 +25,6 @@
#include "ObjectMgr.h"
#include "Vehicle.h"
#include "Transport.h"
#include "WorldSession.h"
#include "ScriptedCreature.h"
BattlegroundIC::BattlegroundIC()
@@ -23,7 +23,6 @@
#include "Player.h"
#include "ScriptedCreature.h"
#include "WorldPacket.h"
#include "WorldSession.h"
BattlegroundSA::BattlegroundSA()
{
@@ -17,14 +17,12 @@
*/
#include "BattlegroundWS.h"
#include "Creature.h"
#include "GameObject.h"
#include "Language.h"
#include "Object.h"
#include "ObjectMgr.h"
#include "BattlegroundMgr.h"
#include "Player.h"
#include "World.h"
#include "WorldPacket.h"
// these variables aren't used outside of this file, so declare them only here
+2
View File
@@ -212,6 +212,8 @@ include_directories(
${ZMQ_INCLUDE_DIR}
)
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
add_library(game STATIC
${game_STAT_SRCS}
${game_STAT_PCH_SRC}
-1
View File
@@ -32,7 +32,6 @@
#include "Opcodes.h"
#include "Player.h"
#include "UpdateMask.h"
#include "SpellMgr.h"
#include "ScriptMgr.h"
#include "ChatLink.h"
@@ -20,7 +20,6 @@
#include "ThreatManager.h"
#include "Unit.h"
#include "DBCStructure.h"
#include "SpellMgr.h"
#include "SpellInfo.h"
HostileRefManager::~HostileRefManager()
-2
View File
@@ -19,8 +19,6 @@
#include "ThreatManager.h"
#include "Unit.h"
#include "Creature.h"
#include "CreatureAI.h"
#include "Map.h"
#include "Player.h"
#include "ObjectAccessor.h"
#include "UnitEvents.h"
+21
View File
@@ -49,6 +49,7 @@ struct WMOAreaTableTripple
};
typedef std::map<WMOAreaTableTripple, WMOAreaTableEntry const*> WMOAreaInfoByTripple;
typedef std::multimap<uint32, CharSectionsEntry const*> CharSectionsMap;
DBCStorage <AreaTableEntry> sAreaStore(AreaTableEntryfmt);
DBCStorage <AreaGroupEntry> sAreaGroupStore(AreaGroupEntryfmt);
@@ -69,6 +70,8 @@ DBCStorage <BattlemasterListEntry> sBattlemasterListStore(BattlemasterListEntryf
DBCStorage <BarberShopStyleEntry> sBarberShopStyleStore(BarberShopStyleEntryfmt);
DBCStorage <CharStartOutfitEntry> sCharStartOutfitStore(CharStartOutfitEntryfmt);
std::map<uint32, CharStartOutfitEntry const*> sCharStartOutfitMap;
DBCStorage <CharSectionsEntry> sCharSectionsStore(CharSectionsEntryfmt);
CharSectionsMap sCharSectionMap;
DBCStorage <CharTitlesEntry> sCharTitlesStore(CharTitlesEntryfmt);
DBCStorage <ChatChannelsEntry> sChatChannelsStore(ChatChannelsEntryfmt);
DBCStorage <ChrClassesEntry> sChrClassesStore(ChrClassesEntryfmt);
@@ -360,6 +363,12 @@ void LoadDBCStores(const std::string& dataPath)
if (CharStartOutfitEntry const* outfit = sCharStartOutfitStore.LookupEntry(i))
sCharStartOutfitMap[outfit->Race | (outfit->Class << 8) | (outfit->Gender << 16)] = outfit;
LoadDBC(availableDbcLocales, bad_dbc_files, sCharSectionsStore, dbcPath, "CharSections.dbc");
for (uint32 i = 0; i < sCharSectionsStore.GetNumRows(); ++i)
if (CharSectionsEntry const* entry = sCharSectionsStore.LookupEntry(i))
if (entry->Race && ((1 << (entry->Race - 1)) & RACEMASK_ALL_PLAYABLE) != 0) //ignore Nonplayable races
sCharSectionMap.insert({ entry->GenType | (entry->Gender << 8) | (entry->Race << 16), entry });
LoadDBC(availableDbcLocales, bad_dbc_files, sCharTitlesStore, dbcPath, "CharTitles.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sChatChannelsStore, dbcPath, "ChatChannels.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sChrClassesStore, dbcPath, "ChrClasses.dbc");//15595
@@ -1132,6 +1141,18 @@ CharStartOutfitEntry const* GetCharStartOutfitEntry(uint8 race, uint8 class_, ui
return itr->second;
}
CharSectionsEntry const* GetCharSectionEntry(uint8 race, CharSectionType genType, uint8 gender, uint8 type, uint8 color)
{
std::pair<CharSectionsMap::const_iterator, CharSectionsMap::const_iterator> eqr = sCharSectionMap.equal_range(uint32(genType) | uint32(gender << 8) | uint32(race << 16));
for (CharSectionsMap::const_iterator itr = eqr.first; itr != eqr.second; ++itr)
{
if (itr->second->Type == type && itr->second->Color == color)
return itr->second;
}
return NULL;
}
uint32 GetPowerIndexByClass(uint32 powerType, uint32 classId)
{
return PowersByClass[classId][powerType];
+2
View File
@@ -77,6 +77,7 @@ PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 lev
PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id);
CharStartOutfitEntry const* GetCharStartOutfitEntry(uint8 race, uint8 class_, uint8 gender);
CharSectionsEntry const* GetCharSectionEntry(uint8 race, CharSectionType genType, uint8 gender, uint8 type, uint8 color);
uint32 GetPowerIndexByClass(uint32 powerType, uint32 classId);
LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty);
@@ -103,6 +104,7 @@ extern DBCStorage <BarberShopStyleEntry> sBarberShopStyleStore;
extern DBCStorage <BattlemasterListEntry> sBattlemasterListStore;
extern DBCStorage <ChatChannelsEntry> sChatChannelsStore;
extern DBCStorage <CharStartOutfitEntry> sCharStartOutfitStore;
extern DBCStorage <CharSectionsEntry> sCharSectionsStore;
extern DBCStorage <CharTitlesEntry> sCharTitlesStore;
extern DBCStorage <ChrClassesEntry> sChrClassesStore;
extern DBCStorage <ChrRacesEntry> sChrRacesStore;
+27
View File
@@ -684,6 +684,33 @@ struct CharStartOutfitEntry
uint32 PetFamilyEntry; // 78 Pet Family Entry for starting pet
};
enum CharSectionFlags
{
SECTION_FLAG_PLAYER = 0x01,
SECTION_FLAG_DEATH_KNIGHT = 0x04
};
enum CharSectionType
{
SECTION_TYPE_SKIN = 0,
SECTION_TYPE_FACE = 1,
SECTION_TYPE_FACIAL_HAIR = 2,
SECTION_TYPE_HAIR = 3,
SECTION_TYPE_UNDERWEAR = 4
};
struct CharSectionsEntry
{
//uint32 Id;
uint32 Race;
uint32 Gender;
uint32 GenType;
//char* TexturePath[3];
uint32 Flags;
uint32 Type;
uint32 Color;
};
struct CharTitlesEntry
{
uint32 ID; // 0, title ids, for example in Quest::GetCharTitleId()
+1
View File
@@ -37,6 +37,7 @@ char const BannedAddOnsfmt[] = "nxxxxxxxxxx";
char const BarberShopStyleEntryfmt[] = "nixxxiii";
char const BattlemasterListEntryfmt[] = "niiiiiiiiixsiiiixxxx";
char const CharStartOutfitEntryfmt[] = "dbbbXiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxii";
char const CharSectionsEntryfmt[] = "diiixxxiii";
char const CharTitlesEntryfmt[] = "nxssix";
char const ChatChannelsEntryfmt[] = "nixsx";
char const ChrClassesEntryfmt[] = "nixsxxxixiiiii";
+8 -1
View File
@@ -21,7 +21,6 @@
#include "DisableMgr.h"
#include "ObjectMgr.h"
#include "SocialMgr.h"
#include "Language.h"
#include "LFGMgr.h"
#include "LFGScripts.h"
#include "LFGGroupData.h"
@@ -1269,6 +1268,14 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
if (player->GetMapId() == uint32(dungeon->map))
player->TeleportToBGEntryPoint();
// in the case were we are the last in lfggroup then we must disband when porting out of the instance
if (group->GetMembersCount() == 1)
{
group->Disband();
TC_LOG_DEBUG("lfg.teleport", "Player %s is last in lfggroup so we disband the group.",
player->GetName().c_str());
}
return;
}
@@ -23,9 +23,6 @@
#include "LFGQueue.h"
#include "LFGMgr.h"
#include "Log.h"
#include "ObjectMgr.h"
#include "World.h"
#include "GroupMgr.h"
namespace lfg
{
@@ -22,9 +22,6 @@
#include "UpdateMask.h"
#include "ObjectAccessor.h"
#include "DatabaseEnv.h"
#include "Opcodes.h"
#include "GossipDef.h"
#include "World.h"
Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES), m_type(type)
{
+1 -11
View File
@@ -34,12 +34,9 @@
#include "InstanceScript.h"
#include "Log.h"
#include "LootMgr.h"
#include "MapManager.h"
#include "MoveSpline.h"
#include "MoveSplineInit.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "OutdoorPvPMgr.h"
#include "Player.h"
#include "PoolMgr.h"
#include "QuestDef.h"
@@ -48,10 +45,8 @@
#include "TemporarySummon.h"
#include "Util.h"
#include "Vehicle.h"
#include "WaypointMovementGenerator.h"
#include "World.h"
#include "WorldPacket.h"
#include "Transport.h"
TrainerSpell const* TrainerSpellData::Find(uint32 spell_id) const
@@ -2231,12 +2226,7 @@ void Creature::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs
continue;
uint32 unSpellId = m_spells[i];
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(unSpellId);
if (!spellInfo)
{
ASSERT(spellInfo);
continue;
}
SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(unSpellId);
// Not send cooldown for this spells
if (spellInfo->IsCooldownStartedOnEvent())
@@ -19,7 +19,6 @@
#include "Log.h"
#include "ObjectAccessor.h"
#include "CreatureAI.h"
#include "ObjectMgr.h"
#include "TemporarySummon.h"
#include "Pet.h"
#include "Player.h"
@@ -18,12 +18,10 @@
#include "Common.h"
#include "UpdateMask.h"
#include "Opcodes.h"
#include "World.h"
#include "ObjectAccessor.h"
#include "DatabaseEnv.h"
#include "GridNotifiers.h"
#include "CellImpl.h"
#include "GridNotifiersImpl.h"
#include "ScriptMgr.h"
#include "Transport.h"
@@ -20,7 +20,6 @@
#include "Battleground.h"
#include "CellImpl.h"
#include "CreatureAISelector.h"
#include "DynamicTree.h"
#include "GameObjectModel.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
@@ -33,7 +32,6 @@
#include "UpdateFieldFlags.h"
#include "World.h"
#include "Transport.h"
#include <G3D/Quat.h>
GameObject::GameObject() : WorldObject(false), MapObject(),
m_model(NULL), m_goValue(), m_AI(NULL)
@@ -675,6 +675,7 @@ void Object::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* targe
uint32* flags = NULL;
uint32 visibleFlag = GetUpdateFieldData(target, flags);
ASSERT(flags);
for (uint16 index = 0; index < m_valuesCount; ++index)
{
@@ -18,7 +18,6 @@
#include "ObjectGuid.h"
#include "World.h"
#include "ObjectMgr.h"
#include <sstream>
#include <iomanip>
-1
View File
@@ -26,7 +26,6 @@
#include "Formulas.h"
#include "SpellAuras.h"
#include "SpellAuraEffects.h"
#include "CreatureAI.h"
#include "Unit.h"
#include "Util.h"
#include "Group.h"
+100 -13
View File
@@ -978,8 +978,6 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo)
{
//FIXME: outfitId not used in player creating
/// @todo need more checks against packet modifications
// should check that skin, face, hair* are valid via DBC per race/class
// also do it in Player::BuildEnumData, Player::LoadFromDB
Object::_Create(guidlow, 0, HIGHGUID_PLAYER);
@@ -1021,6 +1019,13 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo)
return false;
}
if (!ValidateAppearance(createInfo->Race, createInfo->Class, createInfo->Gender, createInfo->HairStyle, createInfo->HairColor, createInfo->Face, createInfo->FacialHair, createInfo->Skin, true))
{
TC_LOG_ERROR("entities.player", "Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with invalid appearance attributes - refusing to do so",
GetSession()->GetAccountId(), m_name.c_str());
return false;
}
uint32 RaceClassGender = (createInfo->Race) | (createInfo->Class << 8) | (createInfo->Gender << 16);
SetUInt32Value(UNIT_FIELD_BYTES_0, (RaceClassGender | (powertype << 24)));
@@ -1987,6 +1992,24 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* dataBuffer, B
uint32 atLoginFlags = fields[15].GetUInt16();
Tokenizer equipment(fields[19].GetString(), ' ');
uint8 slot = fields[21].GetUInt8();
uint32 playerBytes2 = fields[6].GetUInt32();
uint16 atLoginFlags = fields[15].GetUInt16();
if (!ValidateAppearance(uint8(plrRace), uint8(plrClass), gender, uint8(playerBytes >> 16), uint8(playerBytes >> 24), uint8(playerBytes >> 8), uint8(playerBytes2), uint8(playerBytes)))
{
TC_LOG_ERROR("entities.player.loading", "Player %u has wrong Appearance values (Hair/Skin/Color), forcing recustomize", guid);
if (!(atLoginFlags & AT_LOGIN_CUSTOMIZE))
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_CUSTOMIZE));
stmt->setUInt32(1, guid);
CharacterDatabase.Execute(stmt);
atLoginFlags |= AT_LOGIN_CUSTOMIZE;
}
}
uint32 charFlags = 0;
if (playerFlags & PLAYER_FLAGS_HIDE_HELM)
@@ -9968,7 +9991,7 @@ uint32 Player::GetXPRestBonus(uint32 xp)
SetRestBonus(GetRestBonus() - rested_bonus);
TC_LOG_DEBUG("entities.player", "Player gain %u xp (+ %u Rested Bonus). Rested points=%f", xp+rested_bonus, rested_bonus, GetRestBonus());
TC_LOG_DEBUG("entities.player", "GetXPRestBonus: Player %s (%u) gain %u xp (+%u Rested Bonus). Rested points=%f", GetName().c_str(), GetGUIDLow(), xp+rested_bonus, rested_bonus, GetRestBonus());
return rested_bonus;
}
@@ -17374,6 +17397,20 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
SetUInt32Value(PLAYER_BYTES_2, fields[10].GetUInt32());
SetByteValue(PLAYER_BYTES_3, 0, fields[5].GetUInt8());
SetByteValue(PLAYER_BYTES_3, 1, fields[45].GetUInt8());
if (!ValidateAppearance(
fields[3].GetUInt8(), // race
fields[4].GetUInt8(), // class
gender, GetByteValue(PLAYER_BYTES, 2), // hair type
GetByteValue(PLAYER_BYTES, 3), //hair color
uint8(fields[9].GetUInt32() >> 8), // face
GetByteValue(PLAYER_BYTES_2, 0), // facial hair
GetByteValue(PLAYER_BYTES, 0))) // skin color
{
TC_LOG_ERROR("entities.player", "Player %s has wrong Appearance values (Hair/Skin/Color), can't be loaded.", guid.ToString().c_str());
return false;
}
SetUInt32Value(PLAYER_FLAGS, fields[11].GetUInt32());
SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[44].GetUInt32());
@@ -21849,12 +21886,7 @@ void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs)
if (itr->second->state == PLAYERSPELL_REMOVED)
continue;
uint32 unSpellId = itr->first;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(unSpellId);
if (!spellInfo)
{
ASSERT(spellInfo);
continue;
}
SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(unSpellId);
// Not send cooldown for this spells
if (spellInfo->IsCooldownStartedOnEvent())
@@ -22498,9 +22530,9 @@ void Player::SetPvP(bool state)
(*itr)->SetPvP(state);
}
void Player::UpdatePvP(bool state, bool override)
void Player::UpdatePvP(bool state, bool _override)
{
if (!state || override)
if (!state || _override)
{
SetPvP(state);
pvpInfo.EndTimer = 0;
@@ -25655,11 +25687,11 @@ uint32 Player::CalculateTalentsPoints() const
return uint32(talentPointsForLevel * sWorld->getRate(RATE_TALENT));
}
bool Player::IsKnowHowFlyIn(uint32 mapid, uint32 zone) const
bool Player::canFlyInZone(uint32 mapid, uint32 zone) const
{
// continent checked in SpellInfo::CheckLocation at cast and area update
uint32 v_map = GetVirtualMapForMapAndZone(mapid, zone);
return v_map != 571 || HasSpell(54197); // Cold Weather Flying
return v_map != 571 || HasSpell(54197); // 54197 = Cold Weather Flying
}
void Player::LearnSpellHighestRank(uint32 spellid)
@@ -28066,3 +28098,58 @@ void Player::SendSupercededSpell(uint32 oldSpell, uint32 newSpell)
data << uint32(newSpell) << uint32(oldSpell);
GetSession()->SendPacket(&data);
}
bool Player::ValidateAppearance(uint8 race, uint8 class_, uint8 gender, uint8 hairID, uint8 hairColor, uint8 faceID, uint8 facialHair, uint8 skinColor, bool create /*=false*/)
{
// Check skin color
// For Skin type is always 0
if (CharSectionsEntry const* entry = GetCharSectionEntry(race, SECTION_TYPE_SKIN, gender, 0, skinColor))
{ // Skin Color defined as Face color, too, we check skin & face in one pass
if (CharSectionsEntry const* entry2 = GetCharSectionEntry(race, SECTION_TYPE_FACE, gender, faceID, skinColor))
{
// Check DeathKnight exclusive
if (((entry->Flags & SECTION_FLAG_DEATH_KNIGHT) || (entry2->Flags & SECTION_FLAG_DEATH_KNIGHT)) && class_ != CLASS_DEATH_KNIGHT)
return false;
if (create && !((entry->Flags & SECTION_FLAG_PLAYER) && (entry2->Flags & SECTION_FLAG_PLAYER)))
return false;
}
else
return false;
}
else
return false;
// These combinations don't have an entry of Type SECTION_TYPE_FACIAL_HAIR, exclude them from that check
bool excludeCheck = (race == RACE_TAUREN) || (race == RACE_DRAENEI) || (gender == GENDER_FEMALE && race != RACE_NIGHTELF && race != RACE_UNDEAD_PLAYER);
// Check Hair
if (CharSectionsEntry const* entry = GetCharSectionEntry(race, SECTION_TYPE_HAIR, gender, hairID, hairColor))
{
if ((entry->Flags & SECTION_FLAG_DEATH_KNIGHT) && class_ != CLASS_DEATH_KNIGHT)
return false;
if (create && !(entry->Flags & SECTION_FLAG_PLAYER))
return false;
if (!excludeCheck)
{
if (CharSectionsEntry const* entry2 = GetCharSectionEntry(race, SECTION_TYPE_FACIAL_HAIR, gender, facialHair, hairColor))
{
if ((entry2->Flags & SECTION_FLAG_DEATH_KNIGHT) && class_ != CLASS_DEATH_KNIGHT)
return false;
if (create && !(entry2->Flags & SECTION_FLAG_PLAYER))
return false;
}
else
return false;
}
else
{
// @TODO: Bound checking for facialHair ID (used clientside for markings, tauren beard, etc.)
// Not present in DBC
}
}
else
return false;
return true;
}
+2 -1
View File
@@ -1683,6 +1683,7 @@ class Player : public Unit, public GridObject<Player>
static bool LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, float& o, bool& in_flight, ObjectGuid guid);
static bool IsValidGender(uint8 Gender) { return Gender <= GENDER_FEMALE; }
static bool ValidateAppearance(uint8 race, uint8 class_, uint8 gender, uint8 hairID, uint8 hairColor, uint8 faceID, uint8 facialHair, uint8 skinColor, bool create = false);
static bool IsValidClass(uint8 Class) { return ((1 << (Class - 1)) & CLASSMASK_ALL_PLAYABLE) != 0; }
static bool IsValidRace(uint8 Race) { return ((1 << (Race - 1)) & RACEMASK_ALL_PLAYABLE) != 0; }
@@ -2347,7 +2348,7 @@ class Player : public Unit, public GridObject<Player>
void SetFallInformation(uint32 time, float z);
void HandleFall(MovementInfo const& movementInfo);
bool IsKnowHowFlyIn(uint32 mapid, uint32 zone) const;
bool canFlyInZone(uint32 mapid, uint32 zone) const;
void SetClientControl(Unit* target, bool allowMove);
-2
View File
@@ -17,9 +17,7 @@
*/
#include "Totem.h"
#include "Log.h"
#include "Group.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "Player.h"
#include "SpellMgr.h"
@@ -20,14 +20,10 @@
#include "Transport.h"
#include "MapManager.h"
#include "ObjectMgr.h"
#include "Path.h"
#include "ScriptMgr.h"
#include "WorldPacket.h"
#include "DBCStores.h"
#include "World.h"
#include "GameObjectAI.h"
#include "Vehicle.h"
#include "MapReference.h"
#include "Player.h"
#include "Cell.h"
#include "CellImpl.h"
@@ -340,6 +336,8 @@ GameObject* Transport::CreateGOPassenger(uint32 guid, GameObjectData const* data
return NULL;
}
ASSERT(data);
float x = data->posX;
float y = data->posY;
float z = data->posZ;
+3 -3
View File
@@ -35,7 +35,6 @@
#include "InstanceSaveMgr.h"
#include "InstanceScript.h"
#include "Log.h"
#include "MapManager.h"
#include "MoveSpline.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
@@ -5384,7 +5383,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
if (RandomSpells.empty()) // shouldn't happen
return false;
uint8 rand_spell = irand(0, (RandomSpells.size() - 1));
uint8 rand_spell = urand(0, (RandomSpells.size() - 1));
CastSpell(target, RandomSpells[rand_spell], true, castItem, triggeredByAura, originalCaster);
for (std::vector<uint32>::iterator itr = RandomSpells.begin(); itr != RandomSpells.end(); ++itr)
{
@@ -5430,7 +5429,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
if (RandomSpells.empty()) // shouldn't happen
return false;
uint8 rand_spell = irand(0, (RandomSpells.size() - 1));
uint8 rand_spell = urand(0, (RandomSpells.size() - 1));
CastSpell(target, RandomSpells[rand_spell], true, castItem, triggeredByAura, originalCaster);
for (std::vector<uint32>::iterator itr = RandomSpells.begin(); itr != RandomSpells.end(); ++itr)
{
@@ -12544,6 +12543,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
uint32 Id = i->aura->GetId();
AuraApplication* aurApp = i->aura->GetApplicationOfTarget(GetGUID());
ASSERT(aurApp);
bool prepare = i->aura->CallScriptPrepareProcHandlers(aurApp, eventInfo);
@@ -22,12 +22,8 @@
#include "Vehicle.h"
#include "Unit.h"
#include "Util.h"
#include "WorldPacket.h"
#include "ScriptMgr.h"
#include "CreatureAI.h"
#include "ZoneScript.h"
#include "SpellMgr.h"
#include "SpellInfo.h"
#include "MoveSplineInit.h"
#include "TemporarySummon.h"
#include "EventProcessor.h"
-1
View File
@@ -24,7 +24,6 @@
#include "Language.h"
#include "Log.h"
#include "MapManager.h"
#include "GossipDef.h"
#include "Player.h"
#include "BattlegroundMgr.h"
#include "UnitAI.h"
@@ -20,28 +20,20 @@
#include <boost/thread/locks.hpp>
#include "ObjectAccessor.h"
#include "CellImpl.h"
#include "Corpse.h"
#include "Creature.h"
#include "DynamicObject.h"
#include "GameObject.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "Item.h"
#include "Map.h"
#include "MapInstanced.h"
#include "MapManager.h"
#include "ObjectDefines.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "Pet.h"
#include "Player.h"
#include "Vehicle.h"
#include "World.h"
#include "WorldPacket.h"
#include <cmath>
ObjectAccessor::ObjectAccessor() { }
ObjectAccessor::~ObjectAccessor() { }
@@ -21,12 +21,9 @@
#include "WorldPacket.h"
#include "WorldSession.h"
#include "UpdateData.h"
#include "Item.h"
#include "Map.h"
#include "Transport.h"
#include "ObjectAccessor.h"
#include "CellImpl.h"
#include "SpellInfo.h"
using namespace Trinity;
@@ -20,7 +20,6 @@
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Creature.h"
#include "Vehicle.h"
#include "GameObject.h"
#include "DynamicObject.h"
#include "Corpse.h"
-1
View File
@@ -31,7 +31,6 @@
#include "BattlegroundMgr.h"
#include "MapManager.h"
#include "InstanceSaveMgr.h"
#include "MapInstanced.h"
#include "Util.h"
#include "LFGMgr.h"
#include "UpdateFieldFlags.h"
@@ -18,7 +18,6 @@
#include "zlib.h"
#include "AddonHandler.h"
#include "DatabaseEnv.h"
#include "Opcodes.h"
#include "Log.h"
@@ -15,8 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "Player.h"
#include "WorldPacket.h"
+27 -2
View File
@@ -1354,6 +1354,9 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData)
if (bs_skinColor && (bs_skinColor->type != 3 || bs_skinColor->race != _player->getRace() || bs_skinColor->gender != _player->getGender()))
return;
if (!Player::ValidateAppearance(_player->getRace(), _player->getClass(), _player->getGender(), bs_hair->hair_id, Color, uint8(_player->GetUInt32Value(PLAYER_FLAGS) >> 8), bs_facialHair->hair_id, bs_skinColor ? bs_skinColor->hair_id : 0))
return;
GameObject* go = _player->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_BARBER_CHAIR, 5.0f);
if (!go)
{
@@ -1438,9 +1441,8 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
>> customizeInfo.FacialHair
>> customizeInfo.Face;
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AT_LOGIN);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_DATA);
stmt->setUInt32(0, customizeInfo.Guid.GetCounter());
// TODO: Make async with callback
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
@@ -1450,6 +1452,29 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
}
Field* fields = result->Fetch();
uint8 plrRace = fields[0].GetUInt8();
uint8 plrClass = fields[1].GetUInt8();
uint8 plrGender = fields[2].GetUInt8();
if (!Player::ValidateAppearance(plrRace, plrClass, plrGender, customizeInfo.HairStyle, customizeInfo.HairColor, customizeInfo.Face, customizeInfo.FacialHair, customizeInfo.Skin, true))
{
SendCharCustomize(CHAR_CREATE_ERROR, customizeInfo);
return;
}
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AT_LOGIN);
stmt->setUInt32(0, customizeInfo.Guid.GetCounter());
// TODO: Make async with callback
result = CharacterDatabase.Query(stmt);
if (!result)
{
SendCharCustomize(CHAR_CREATE_ERROR, customizeInfo);
return;
}
fields = result->Fetch();
uint32 at_loginFlags = fields[0].GetUInt16();
if (!(at_loginFlags & AT_LOGIN_CUSTOMIZE))
-1
View File
@@ -34,7 +34,6 @@
#include "Log.h"
#include "Opcodes.h"
#include "Player.h"
#include "SpellAuras.h"
#include "SpellAuraEffects.h"
#include "Util.h"
#include "ScriptMgr.h"
@@ -22,9 +22,7 @@
#include "WorldSession.h"
#include "ObjectAccessor.h"
#include "CreatureAI.h"
#include "ObjectDefines.h"
#include "Vehicle.h"
#include "VehicleDefines.h"
#include "Player.h"
#include "Opcodes.h"
-2
View File
@@ -20,8 +20,6 @@
#include "WorldPacket.h"
#include "WorldSession.h"
#include "Log.h"
#include "Opcodes.h"
#include "UpdateData.h"
#include "Player.h"
void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
@@ -23,10 +23,7 @@
#include "ObjectMgr.h"
#include "GuildMgr.h"
#include "Log.h"
#include "Opcodes.h"
#include "Guild.h"
#include "GossipDef.h"
#include "SocialMgr.h"
void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket)
{
-2
View File
@@ -24,8 +24,6 @@
#include "ObjectMgr.h"
#include "Player.h"
#include "Item.h"
#include "UpdateData.h"
#include "ObjectAccessor.h"
#include "SpellInfo.h"
#include "DB2Stores.h"
#include <vector>
+2 -2
View File
@@ -634,10 +634,10 @@ void WorldSession::SendLfgJoinResult(lfg::LfgJoinResultData const& joinData)
void WorldSession::SendLfgQueueStatus(lfg::LfgQueueStatusData const& queueData)
{
TC_LOG_DEBUG("lfg", "SMSG_LFG_QUEUE_STATUS %s dungeon: %u, waitTime: %d, "
TC_LOG_DEBUG("lfg", "SMSG_LFG_QUEUE_STATUS %s state: %s, dungeon: %u, waitTime: %d, "
"avgWaitTime: %d, waitTimeTanks: %d, waitTimeHealer: %d, waitTimeDps: %d, "
"queuedTime: %u, tanks: %u, healers: %u, dps: %u",
GetPlayerInfo().c_str(), queueData.dungeonId, queueData.waitTime, queueData.waitTimeAvg,
GetPlayerInfo().c_str(), lfg::GetStateString(sLFGMgr->GetState(GetPlayer()->GetGUID())).c_str(), queueData.dungeonId, queueData.waitTime, queueData.waitTimeAvg,
queueData.waitTimeTank, queueData.waitTimeHealer, queueData.waitTimeDps,
queueData.queuedTime, queueData.tanks, queueData.healers, queueData.dps);
-8
View File
@@ -28,9 +28,6 @@
#include "ObjectMgr.h"
#include "GuildMgr.h"
#include "WorldSession.h"
#include "BigNumber.h"
#include "SHA1.h"
#include "UpdateData.h"
#include "LootMgr.h"
#include "Chat.h"
#include "zlib.h"
@@ -38,19 +35,14 @@
#include "Object.h"
#include "Battleground.h"
#include "OutdoorPvP.h"
#include "Pet.h"
#include "SocialMgr.h"
#include "CellImpl.h"
#include "AccountMgr.h"
#include "Vehicle.h"
#include "CreatureAI.h"
#include "DBCEnums.h"
#include "ScriptMgr.h"
#include "MapManager.h"
#include "InstanceScript.h"
#include "GameObjectAI.h"
#include "Group.h"
#include "AccountMgr.h"
#include "Spell.h"
#include "BattlegroundMgr.h"
#include "Battlefield.h"
@@ -23,7 +23,6 @@
#include "Log.h"
#include "Corpse.h"
#include "Player.h"
#include "SpellAuras.h"
#include "MapManager.h"
#include "Transport.h"
#include "Battleground.h"
-2
View File
@@ -27,8 +27,6 @@
#include "SpellMgr.h"
#include "Player.h"
#include "GossipDef.h"
#include "UpdateMask.h"
#include "ObjectAccessor.h"
#include "Creature.h"
#include "Pet.h"
#include "ReputationMgr.h"
@@ -28,8 +28,6 @@
#include "Opcodes.h"
#include "Guild.h"
#include "ArenaTeam.h"
#include "GossipDef.h"
#include "SocialMgr.h"
#define CHARTER_DISPLAY_ID 16161
@@ -17,7 +17,6 @@
*/
#include "Common.h"
#include "Language.h"
#include "DatabaseEnv.h"
#include "WorldPacket.h"
#include "WorldSession.h"
@@ -28,7 +27,6 @@
#include "Player.h"
#include "UpdateMask.h"
#include "NPCHandler.h"
#include "Pet.h"
#include "MapManager.h"
void WorldSession::SendNameQueryOpcode(ObjectGuid guid)
@@ -17,13 +17,11 @@
*/
#include "Common.h"
#include "DatabaseEnv.h"
#include "Log.h"
#include "ObjectAccessor.h"
#include "Opcodes.h"
#include "Player.h"
#include "Pet.h"
#include "UpdateMask.h"
#include "WorldPacket.h"
#include "WorldSession.h"
@@ -27,9 +27,6 @@
#include "Opcodes.h"
#include "Spell.h"
#include "Totem.h"
#include "TemporarySummon.h"
#include "SpellAuras.h"
#include "CreatureAI.h"
#include "ScriptMgr.h"
#include "GameObjectAI.h"
#include "SpellAuraEffects.h"
-1
View File
@@ -24,7 +24,6 @@
#include "Log.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "UpdateMask.h"
#include "Path.h"
#include "WaypointMovementGenerator.h"
@@ -19,7 +19,6 @@
#include "Common.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "Opcodes.h"
#include "Log.h"
void WorldSession::HandleVoiceSessionEnableOpcode(WorldPacket& recvData)
@@ -21,15 +21,12 @@
#include "GridNotifiers.h"
#include "Log.h"
#include "GridStates.h"
#include "CellImpl.h"
#include "Map.h"
#include "MapManager.h"
#include "MapInstanced.h"
#include "InstanceSaveMgr.h"
#include "Timer.h"
#include "GridNotifiersImpl.h"
#include "Config.h"
#include "Transport.h"
#include "ObjectMgr.h"
#include "World.h"
#include "Group.h"
-1
View File
@@ -28,7 +28,6 @@
#include "Group.h"
#include "InstanceScript.h"
#include "MapInstanced.h"
#include "MapManager.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Pet.h"
-1
View File
@@ -27,7 +27,6 @@
#include "InstanceScript.h"
#include "Config.h"
#include "World.h"
#include "CellImpl.h"
#include "Corpse.h"
#include "ObjectMgr.h"
#include "Language.h"
@@ -30,7 +30,6 @@
#include "RandomMovementGenerator.h"
#include "MoveSpline.h"
#include "MoveSplineInit.h"
#include <cassert>
inline bool isStatic(MovementGenerator *mv)
{
@@ -17,10 +17,8 @@
*/
#include "Creature.h"
#include "MapManager.h"
#include "ConfusedMovementGenerator.h"
#include "PathGenerator.h"
#include "VMapFactory.h"
#include "MoveSplineInit.h"
#include "MoveSpline.h"
#include "Player.h"
@@ -18,7 +18,6 @@
#include "Creature.h"
#include "CreatureAI.h"
#include "MapManager.h"
#include "FleeingMovementGenerator.h"
#include "PathGenerator.h"
#include "ObjectAccessor.h"
@@ -19,7 +19,6 @@
#include "HomeMovementGenerator.h"
#include "Creature.h"
#include "CreatureAI.h"
#include "WorldPacket.h"
#include "MoveSplineInit.h"
#include "MoveSpline.h"
@@ -17,9 +17,7 @@
*/
#include "Creature.h"
#include "MapManager.h"
#include "RandomMovementGenerator.h"
#include "ObjectAccessor.h"
#include "Map.h"
#include "Util.h"
#include "CreatureGroups.h"
@@ -19,7 +19,6 @@
#include "WaypointMovementGenerator.h"
//Extended headers
#include "ObjectMgr.h"
#include "World.h"
#include "Transport.h"
//Flightmaster grid preloading
#include "MapManager.h"
@@ -21,7 +21,6 @@
#include "MovementPacketBuilder.h"
#include "Unit.h"
#include "Transport.h"
#include "Vehicle.h"
#include "WorldPacket.h"
#include "Opcodes.h"
@@ -18,7 +18,6 @@
#include "MoveSplineFlag.h"
#include <cmath>
#include <string>
namespace Movement
{
+1 -2
View File
@@ -20,7 +20,6 @@
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Map.h"
#include "MapManager.h"
#include "Group.h"
#include "WorldPacket.h"
#include "GridNotifiers.h"
@@ -509,7 +508,7 @@ bool OPvPCapturePoint::HandleCustomSpell(Player* player, uint32 /*spellId*/, Gam
{
if (!player->IsOutdoorPvPActive())
return false;
return false;
return true;
}
bool OutdoorPvP::HandleOpenGo(Player* player, ObjectGuid guid)
+1 -1
View File
@@ -170,7 +170,7 @@ PoolObject* PoolGroup<T>::RollOne(ActivePoolData& spawns, uint32 triggerFrom)
}
if (!EqualChanced.empty())
{
int32 index = irand(0, EqualChanced.size()-1);
uint32 index = urand(0, EqualChanced.size()-1);
// Triggering object is marked as spawned at this time and can be also rolled (respawn case)
// so this need explicit check for this case
if (EqualChanced[index].guid == triggerFrom || !spawns.IsActiveObject<T>(EqualChanced[index].guid))
-2
View File
@@ -21,8 +21,6 @@
#include "GridNotifiersImpl.h"
#include "GossipDef.h"
#include "Map.h"
#include "MapManager.h"
#include "MapRefManager.h"
#include "ObjectMgr.h"
#include "Pet.h"
#include "ScriptedCreature.h"
+10 -10
View File
@@ -269,6 +269,7 @@ void WorldSession::SendPacket(WorldPacket* packet, bool forced /*= false*/)
sScriptMgr->OnPacketSend(this, *packet);
TC_LOG_TRACE("network.opcode", "S->C: %s %s", GetPlayerInfo().c_str(), GetOpcodeNameForLogging(packet->GetOpcode()).c_str());
m_Socket->SendPacket(*packet);
}
@@ -856,7 +857,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
if (size > 0xFFFFF)
{
TC_LOG_ERROR("misc", "WorldSession::ReadAddonsInfo addon info too big, size %u", size);
TC_LOG_DEBUG("addon", "WorldSession::ReadAddonsInfo: AddOnInfo too big, size %u", size);
return;
}
@@ -886,7 +887,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
addonInfo >> enabled >> crc >> unk1;
TC_LOG_DEBUG("misc", "ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk1);
TC_LOG_DEBUG("addon", "AddOn: %s (CRC: 0x%x) - enabled: 0x%x - Unknown2: 0x%x", addonName.c_str(), crc, enabled, unk1);
AddonInfo addon(addonName, enabled, crc, 2, true);
@@ -894,15 +895,14 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
if (savedAddon)
{
if (addon.CRC != savedAddon->CRC)
TC_LOG_ERROR("misc", "ADDON: %s was known, but didn't match known CRC (0x%x)!", addon.Name.c_str(), savedAddon->CRC);
TC_LOG_WARN("addon", " Addon: %s: modified (CRC: 0x%x) - accountID %d)", addon.Name.c_str(), savedAddon->CRC, GetAccountId());
else
TC_LOG_DEBUG("misc", "ADDON: %s was known, CRC is correct (0x%x)", addon.Name.c_str(), savedAddon->CRC);
TC_LOG_DEBUG("addon", "Addon: %s: validated (CRC: 0x%x) - accountID %d", addon.Name.c_str(), savedAddon->CRC, GetAccountId());
}
else
{
AddonMgr::SaveAddon(addon);
TC_LOG_DEBUG("misc", "ADDON: %s (0x%x) was not known, saving...", addon.Name.c_str(), addon.CRC);
TC_LOG_WARN("addon", "Addon: %s: unknown (CRC: 0x%x) - accountId %d (storing addon name and checksum to database)", addon.Name.c_str(), addon.CRC, GetAccountId());
}
/// @todo Find out when to not use CRC/pubkey, and other possible states.
@@ -911,10 +911,10 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
uint32 currentTime;
addonInfo >> currentTime;
TC_LOG_DEBUG("network", "ADDON: CurrentTime: %u", currentTime);
TC_LOG_DEBUG("addon", "AddOn: CurrentTime: %u", currentTime);
}
else
TC_LOG_ERROR("misc", "Addon packet uncompress error!");
TC_LOG_DEBUG("addon", "AddOn: Addon packet uncompress error!");
}
void WorldSession::SendAddonsInfo()
@@ -953,8 +953,8 @@ void WorldSession::SendAddonsInfo()
data << uint8(usepk);
if (usepk) // if CRC is wrong, add public key (client need it)
{
TC_LOG_DEBUG("misc", "ADDON: CRC (0x%x) for addon %s is wrong (does not match expected 0x%x), sending pubkey",
itr->CRC, itr->Name.c_str(), STANDARD_ADDON_CRC);
TC_LOG_DEBUG("addon", "AddOn: %s: CRC checksum mismatch: got 0x%x - expected 0x%x - sending pubkey to accountID %d",
itr->Name.c_str(), itr->CRC, STANDARD_ADDON_CRC, GetAccountId());
data.append(addonPublicKey, sizeof(addonPublicKey));
}
Loaded 100 of 181 files, more files were not shown because too many files have changed in this diff. Show more