refactor(Core): rename namespaces and macros to acore (#2454)
This commit is contained in:
parent
e19e95e5d0
commit
e22d78ecd6
278 changed files with 1292 additions and 1309 deletions
|
|
@ -0,0 +1,3 @@
|
|||
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1574110895514398814');
|
||||
|
||||
RENAME TABLE `trinity_string` TO `acore_string`;
|
||||
|
|
@ -60,7 +60,7 @@ endif()
|
|||
|
||||
if( WITH_COREDEBUG )
|
||||
message("* Use coreside debug : Yes")
|
||||
add_definitions(-DTRINITY_DEBUG)
|
||||
add_definitions(-DACORE_DEBUG)
|
||||
else()
|
||||
message("* Use coreside debug : No (default)")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef _TRINITY_AUTO_PTR_H
|
||||
#define _TRINITY_AUTO_PTR_H
|
||||
#ifndef _ACORE_AUTO_PTR_H
|
||||
#define _ACORE_AUTO_PTR_H
|
||||
|
||||
#include <ace/Bound_Ptr.h>
|
||||
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
|
||||
template <class Pointer, class Lock>
|
||||
|
|
@ -37,6 +37,6 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
} // namespace Trinity
|
||||
} // namespace acore
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ namespace MMAP
|
|||
|
||||
bool MMapManager::loadMap(uint32 mapId, int32 x, int32 y)
|
||||
{
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, MMapManagerLock);
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, MMapManagerLock);
|
||||
|
||||
// make sure the mmap is loaded and ready to load tiles
|
||||
if(!loadMapData(mapId))
|
||||
|
|
@ -161,7 +161,7 @@ namespace MMAP
|
|||
|
||||
dtStatus stat;
|
||||
{
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, GetMMapLock(mapId));
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, GetMMapLock(mapId));
|
||||
stat = mmap->navMesh->addTile(data, fileHeader.size, DT_TILE_FREE_DATA, 0, &tileRef);
|
||||
}
|
||||
|
||||
|
|
@ -188,7 +188,7 @@ namespace MMAP
|
|||
|
||||
bool MMapManager::unloadMap(uint32 mapId, int32 x, int32 y)
|
||||
{
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, MMapManagerLock);
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, MMapManagerLock);
|
||||
|
||||
// check if we have this map loaded
|
||||
if (loadedMMaps.find(mapId) == loadedMMaps.end())
|
||||
|
|
@ -217,7 +217,7 @@ namespace MMAP
|
|||
|
||||
dtStatus status;
|
||||
{
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, GetMMapLock(mapId));
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, GetMMapLock(mapId));
|
||||
status = mmap->navMesh->removeTile(tileRef, NULL, NULL);
|
||||
}
|
||||
|
||||
|
|
@ -245,7 +245,7 @@ namespace MMAP
|
|||
|
||||
bool MMapManager::unloadMap(uint32 mapId)
|
||||
{
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, MMapManagerLock);
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, MMapManagerLock);
|
||||
|
||||
if (loadedMMaps.find(mapId) == loadedMMaps.end())
|
||||
{
|
||||
|
|
@ -265,7 +265,7 @@ namespace MMAP
|
|||
|
||||
dtStatus status;
|
||||
{
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, GetMMapLock(mapId));
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, GetMMapLock(mapId));
|
||||
status = mmap->navMesh->removeTile(i->second, NULL, NULL);
|
||||
}
|
||||
|
||||
|
|
@ -291,7 +291,7 @@ namespace MMAP
|
|||
|
||||
bool MMapManager::unloadMapInstance(uint32 mapId, uint32 instanceId)
|
||||
{
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, MMapManagerLock);
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, MMapManagerLock);
|
||||
|
||||
// check if we have this map loaded
|
||||
if (loadedMMaps.find(mapId) == loadedMMaps.end())
|
||||
|
|
@ -326,7 +326,7 @@ namespace MMAP
|
|||
dtNavMesh const* MMapManager::GetNavMesh(uint32 mapId)
|
||||
{
|
||||
// pussywizard: moved to calling function
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, MMapManagerLock);
|
||||
//ACORE_READ_GUARD(ACE_RW_Thread_Mutex, MMapManagerLock);
|
||||
|
||||
if (loadedMMaps.find(mapId) == loadedMMaps.end())
|
||||
return NULL;
|
||||
|
|
@ -337,7 +337,7 @@ namespace MMAP
|
|||
dtNavMeshQuery const* MMapManager::GetNavMeshQuery(uint32 mapId, uint32 instanceId)
|
||||
{
|
||||
// pussywizard: moved to calling function
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, MMapManagerLock);
|
||||
//ACORE_READ_GUARD(ACE_RW_Thread_Mutex, MMapManagerLock);
|
||||
|
||||
if (loadedMMaps.find(mapId) == loadedMMaps.end())
|
||||
return NULL;
|
||||
|
|
@ -346,7 +346,7 @@ namespace MMAP
|
|||
if (mmap->navMeshQueries.find(instanceId) == mmap->navMeshQueries.end())
|
||||
{
|
||||
// pussywizard: different instances of the same map shouldn't access this simultaneously
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, GetMMapLock(mapId));
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, GetMMapLock(mapId));
|
||||
// check again after acquiring mutex
|
||||
if (mmap->navMeshQueries.find(instanceId) == mmap->navMeshQueries.end())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ namespace VMAP
|
|||
WorldModel* VMapManager2::acquireModelInstance(const std::string& basepath, const std::string& filename)
|
||||
{
|
||||
//! Critical section, thread safe access to iLoadedModelFiles
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, LoadedModelFilesLock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, LoadedModelFilesLock);
|
||||
|
||||
ModelFileMap::iterator model = iLoadedModelFiles.find(filename);
|
||||
if (model == iLoadedModelFiles.end())
|
||||
|
|
@ -287,7 +287,7 @@ namespace VMAP
|
|||
void VMapManager2::releaseModelInstance(const std::string &filename)
|
||||
{
|
||||
//! Critical section, thread safe access to iLoadedModelFiles
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, LoadedModelFilesLock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, LoadedModelFilesLock);
|
||||
ModelFileMap::iterator model = iLoadedModelFiles.find(filename);
|
||||
if (model == iLoadedModelFiles.end())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -193,23 +193,23 @@ typedef std::vector<std::string> StringVector;
|
|||
|
||||
#define MAX_QUERY_LEN 32*1024
|
||||
|
||||
#define TRINITY_GUARD(MUTEX, LOCK) \
|
||||
ACE_Guard< MUTEX > TRINITY_GUARD_OBJECT (LOCK); \
|
||||
if (TRINITY_GUARD_OBJECT.locked() == 0) ASSERT(false);
|
||||
#define ACORE_GUARD(MUTEX, LOCK) \
|
||||
ACE_Guard< MUTEX > ACORE_GUARD_OBJECT (LOCK); \
|
||||
if (ACORE_GUARD_OBJECT.locked() == 0) ASSERT(false);
|
||||
|
||||
//! For proper implementation of multiple-read, single-write pattern, use
|
||||
//! ACE_RW_Mutex as underlying @MUTEX
|
||||
# define TRINITY_WRITE_GUARD(MUTEX, LOCK) \
|
||||
ACE_Write_Guard< MUTEX > TRINITY_GUARD_OBJECT (LOCK); \
|
||||
if (TRINITY_GUARD_OBJECT.locked() == 0) ASSERT(false);
|
||||
# define ACORE_WRITE_GUARD(MUTEX, LOCK) \
|
||||
ACE_Write_Guard< MUTEX > ACORE_GUARD_OBJECT (LOCK); \
|
||||
if (ACORE_GUARD_OBJECT.locked() == 0) ASSERT(false);
|
||||
|
||||
//! For proper implementation of multiple-read, single-write pattern, use
|
||||
//! ACE_RW_Mutex as underlying @MUTEX
|
||||
# define TRINITY_READ_GUARD(MUTEX, LOCK) \
|
||||
ACE_Read_Guard< MUTEX > TRINITY_GUARD_OBJECT (LOCK); \
|
||||
if (TRINITY_GUARD_OBJECT.locked() == 0) ASSERT(false);
|
||||
# define ACORE_READ_GUARD(MUTEX, LOCK) \
|
||||
ACE_Read_Guard< MUTEX > ACORE_GUARD_OBJECT (LOCK); \
|
||||
if (ACORE_GUARD_OBJECT.locked() == 0) ASSERT(false);
|
||||
|
||||
namespace ACORE
|
||||
namespace acore
|
||||
{
|
||||
template<class ArgumentType, class ResultType>
|
||||
struct unary_function
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_COMPILERDEFS_H
|
||||
#define TRINITY_COMPILERDEFS_H
|
||||
#ifndef ACORE_COMPILERDEFS_H
|
||||
#define ACORE_COMPILERDEFS_H
|
||||
|
||||
#define AC_PLATFORM_WINDOWS 0
|
||||
#define AC_PLATFORM_UNIX 1
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#include <ace/Thread_Mutex.h>
|
||||
#include <AutoPtr.h>
|
||||
|
||||
typedef Trinity::AutoPtr<ACE_Configuration_Heap, ACE_Null_Mutex> Config;
|
||||
typedef acore::AutoPtr<ACE_Configuration_Heap, ACE_Null_Mutex> Config;
|
||||
|
||||
class ConfigMgr
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_CONTAINERS_H
|
||||
#define TRINITY_CONTAINERS_H
|
||||
#ifndef ACORE_CONTAINERS_H
|
||||
#define ACORE_CONTAINERS_H
|
||||
|
||||
#include "Define.h"
|
||||
#include <list>
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
//! Because circular includes are bad
|
||||
extern uint32 urand(uint32 min, uint32 max);
|
||||
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
namespace Containers
|
||||
{
|
||||
|
|
@ -56,6 +56,6 @@ namespace Trinity
|
|||
}
|
||||
//! namespace Containers
|
||||
}
|
||||
//! namespace Trinity
|
||||
//! namespace acore
|
||||
|
||||
#endif //! #ifdef TRINITY_CONTAINERS_H
|
||||
#endif //! #ifdef ACORE_CONTAINERS_H
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ SQLTransaction DatabaseWorkerPool<T>::BeginTransaction()
|
|||
template <class T>
|
||||
void DatabaseWorkerPool<T>::CommitTransaction(SQLTransaction transaction)
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
//! Only analyze transaction weaknesses in Debug mode.
|
||||
//! Ideally we catch the faults in Debug mode and then correct them,
|
||||
//! so there's no need to waste these CPU cycles in Release mode.
|
||||
|
|
@ -227,7 +227,7 @@ void DatabaseWorkerPool<T>::CommitTransaction(SQLTransaction transaction)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
#endif // TRINITY_DEBUG
|
||||
#endif // ACORE_DEBUG
|
||||
|
||||
Enqueue(new TransactionTask(transaction));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,10 +57,10 @@ class DatabaseWorkerPool
|
|||
template<typename Format, typename... Args>
|
||||
void PExecute(Format&& sql, Args&&... args)
|
||||
{
|
||||
if (ACORE::IsFormatEmptyOrNull(sql))
|
||||
if (acore::IsFormatEmptyOrNull(sql))
|
||||
return;
|
||||
|
||||
Execute(ACORE::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
Execute(acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
}
|
||||
|
||||
//! Enqueues a one-way SQL operation in prepared statement format that will be executed asynchronously.
|
||||
|
|
@ -80,10 +80,10 @@ class DatabaseWorkerPool
|
|||
template<typename Format, typename... Args>
|
||||
void DirectPExecute(Format&& sql, Args&&... args)
|
||||
{
|
||||
if (ACORE::IsFormatEmptyOrNull(sql))
|
||||
if (acore::IsFormatEmptyOrNull(sql))
|
||||
return;
|
||||
|
||||
DirectExecute(ACORE::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
DirectExecute(acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
}
|
||||
|
||||
//! Directly executes a one-way SQL operation in prepared statement format, that will block the calling thread until finished.
|
||||
|
|
@ -103,10 +103,10 @@ class DatabaseWorkerPool
|
|||
template<typename Format, typename... Args>
|
||||
QueryResult PQuery(Format&& sql, T* conn, Args&&... args)
|
||||
{
|
||||
if (ACORE::IsFormatEmptyOrNull(sql))
|
||||
if (acore::IsFormatEmptyOrNull(sql))
|
||||
return QueryResult(nullptr);
|
||||
|
||||
return Query(ACORE::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str(), conn);
|
||||
return Query(acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str(), conn);
|
||||
}
|
||||
|
||||
//! Directly executes an SQL query in string format -with variable args- that will block the calling thread until finished.
|
||||
|
|
@ -114,10 +114,10 @@ class DatabaseWorkerPool
|
|||
template<typename Format, typename... Args>
|
||||
QueryResult PQuery(Format&& sql, Args&&... args)
|
||||
{
|
||||
if (ACORE::IsFormatEmptyOrNull(sql))
|
||||
if (acore::IsFormatEmptyOrNull(sql))
|
||||
return QueryResult(nullptr);
|
||||
|
||||
return Query(ACORE::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
return Query(acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
}
|
||||
|
||||
//! Directly executes an SQL query in prepared format that will block the calling thread until finished.
|
||||
|
|
@ -138,10 +138,10 @@ class DatabaseWorkerPool
|
|||
template<typename Format, typename... Args>
|
||||
QueryResultFuture AsyncPQuery(Format&& sql, Args&&... args)
|
||||
{
|
||||
if (ACORE::IsFormatEmptyOrNull(sql))
|
||||
if (acore::IsFormatEmptyOrNull(sql))
|
||||
return QueryResult(nullptr);
|
||||
|
||||
return AsyncQuery(ACORE::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
return AsyncQuery(acore::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
|
||||
}
|
||||
|
||||
//! Enqueues a query in prepared format that will set the value of the PreparedQueryResultFuture return object as soon as the query is executed.
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class Field
|
|||
if (!data.value)
|
||||
return 0;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_TINY))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetUInt8() on non-tinyint field. Using type: %s.", FieldTypeToString(data.type));
|
||||
|
|
@ -47,7 +47,7 @@ class Field
|
|||
if (!data.value)
|
||||
return 0;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_TINY))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetInt8() on non-tinyint field. Using type: %s.", FieldTypeToString(data.type));
|
||||
|
|
@ -72,7 +72,7 @@ class Field
|
|||
if (!data.value)
|
||||
return 0;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_SHORT) && !IsType(MYSQL_TYPE_YEAR))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetUInt16() on non-smallint field. Using type: %s.", FieldTypeToString(data.type));
|
||||
|
|
@ -90,7 +90,7 @@ class Field
|
|||
if (!data.value)
|
||||
return 0;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_SHORT) && !IsType(MYSQL_TYPE_YEAR))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetInt16() on non-smallint field. Using type: %s.", FieldTypeToString(data.type));
|
||||
|
|
@ -108,7 +108,7 @@ class Field
|
|||
if (!data.value)
|
||||
return 0;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_INT24) && !IsType(MYSQL_TYPE_LONG))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetUInt32() on non-(medium)int field. Using type: %s.", FieldTypeToString(data.type));
|
||||
|
|
@ -126,7 +126,7 @@ class Field
|
|||
if (!data.value)
|
||||
return 0;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_INT24) && !IsType(MYSQL_TYPE_LONG))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetInt32() on non-(medium)int field. Using type: %s.", FieldTypeToString(data.type));
|
||||
|
|
@ -144,7 +144,7 @@ class Field
|
|||
if (!data.value)
|
||||
return 0;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_LONGLONG) && !IsType(MYSQL_TYPE_BIT))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetUInt64() on non-bigint field. Using type: %s.", FieldTypeToString(data.type));
|
||||
|
|
@ -162,7 +162,7 @@ class Field
|
|||
if (!data.value)
|
||||
return 0;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_LONGLONG) && !IsType(MYSQL_TYPE_BIT))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetInt64() on non-bigint field. Using type: %s.", FieldTypeToString(data.type));
|
||||
|
|
@ -180,7 +180,7 @@ class Field
|
|||
if (!data.value)
|
||||
return 0.0f;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_FLOAT))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetFloat() on non-float field. Using type: %s.", FieldTypeToString(data.type));
|
||||
|
|
@ -198,7 +198,7 @@ class Field
|
|||
if (!data.value)
|
||||
return 0.0f;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (!IsType(MYSQL_TYPE_DOUBLE))
|
||||
{
|
||||
sLog->outSQLDriver("Warning: GetDouble() on non-double field. Using type: %s.", FieldTypeToString(data.type));
|
||||
|
|
@ -216,7 +216,7 @@ class Field
|
|||
if (!data.value)
|
||||
return NULL;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
if (IsNumeric())
|
||||
{
|
||||
sLog->outSQLDriver("Error: GetCString() on numeric field. Using type: %s.", FieldTypeToString(data.type));
|
||||
|
|
@ -345,7 +345,7 @@ class Field
|
|||
}
|
||||
|
||||
private:
|
||||
#ifdef TRINITY_DEBUG
|
||||
#ifdef ACORE_DEBUG
|
||||
static char const* FieldTypeToString(enum_field_types type)
|
||||
{
|
||||
switch (type)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class ResultSet
|
|||
MYSQL_FIELD* _fields;
|
||||
};
|
||||
|
||||
typedef Trinity::AutoPtr<ResultSet, ACE_Thread_Mutex> QueryResult;
|
||||
typedef acore::AutoPtr<ResultSet, ACE_Thread_Mutex> QueryResult;
|
||||
|
||||
class PreparedResultSet
|
||||
{
|
||||
|
|
@ -93,7 +93,7 @@ class PreparedResultSet
|
|||
|
||||
};
|
||||
|
||||
typedef Trinity::AutoPtr<PreparedResultSet, ACE_Thread_Mutex> PreparedQueryResult;
|
||||
typedef acore::AutoPtr<PreparedResultSet, ACE_Thread_Mutex> PreparedQueryResult;
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class Transaction
|
|||
bool _cleanedUp;
|
||||
|
||||
};
|
||||
typedef Trinity::AutoPtr<Transaction, ACE_Thread_Mutex> SQLTransaction;
|
||||
typedef acore::AutoPtr<Transaction, ACE_Thread_Mutex> SQLTransaction;
|
||||
|
||||
/*! Low level class*/
|
||||
class TransactionTask : public SQLOperation
|
||||
|
|
|
|||
|
|
@ -54,12 +54,12 @@ namespace
|
|||
}
|
||||
}
|
||||
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
|
||||
void Assert(char const* file, int line, char const* function, std::string const& debugInfo, char const* message)
|
||||
{
|
||||
std::string formattedMessage = ACORE::StringFormat("\n%s:%i in %s ASSERTION FAILED:\n %s\n", file, line, function, message) + debugInfo + '\n';
|
||||
std::string formattedMessage = acore::StringFormat("\n%s:%i in %s ASSERTION FAILED:\n %s\n", file, line, function, message) + debugInfo + '\n';
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
fflush(stderr);
|
||||
Crash(formattedMessage.c_str());
|
||||
|
|
@ -70,7 +70,7 @@ void Assert(char const* file, int line, char const* function, std::string const&
|
|||
va_list args;
|
||||
va_start(args, format);
|
||||
|
||||
std::string formattedMessage = ACORE::StringFormat("\n%s:%i in %s ASSERTION FAILED:\n %s\n", file, line, function, message) + FormatAssertionMessage(format, args) + '\n' + debugInfo + '\n';
|
||||
std::string formattedMessage = acore::StringFormat("\n%s:%i in %s ASSERTION FAILED:\n %s\n", file, line, function, message) + FormatAssertionMessage(format, args) + '\n' + debugInfo + '\n';
|
||||
va_end(args);
|
||||
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
|
|
@ -84,7 +84,7 @@ void Fatal(char const* file, int line, char const* function, char const* message
|
|||
va_list args;
|
||||
va_start(args, message);
|
||||
|
||||
std::string formattedMessage = ACORE::StringFormat("\n%s:%i in %s FATAL ERROR:\n", file, line, function) + FormatAssertionMessage(message, args) + '\n';
|
||||
std::string formattedMessage = acore::StringFormat("\n%s:%i in %s FATAL ERROR:\n", file, line, function) + FormatAssertionMessage(message, args) + '\n';
|
||||
va_end(args);
|
||||
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
|
|
@ -96,7 +96,7 @@ void Fatal(char const* file, int line, char const* function, char const* message
|
|||
|
||||
void Error(char const* file, int line, char const* function, char const* message)
|
||||
{
|
||||
std::string formattedMessage = ACORE::StringFormat("\n%s:%i in %s ERROR:\n %s\n", file, line, function, message);
|
||||
std::string formattedMessage = acore::StringFormat("\n%s:%i in %s ERROR:\n %s\n", file, line, function, message);
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
fflush(stderr);
|
||||
Crash(formattedMessage.c_str());
|
||||
|
|
@ -110,7 +110,7 @@ void Warning(char const* file, int line, char const* function, char const* messa
|
|||
|
||||
void Abort(char const* file, int line, char const* function)
|
||||
{
|
||||
std::string formattedMessage = ACORE::StringFormat("\n%s:%i in %s ABORTED.\n", file, line, function);
|
||||
std::string formattedMessage = acore::StringFormat("\n%s:%i in %s ABORTED.\n", file, line, function);
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
fflush(stderr);
|
||||
Crash(formattedMessage.c_str());
|
||||
|
|
@ -119,13 +119,13 @@ void Abort(char const* file, int line, char const* function)
|
|||
void AbortHandler(int sigval)
|
||||
{
|
||||
// nothing useful to log here, no way to pass args
|
||||
std::string formattedMessage = ACORE::StringFormat("Caught signal %i\n", sigval);
|
||||
std::string formattedMessage = acore::StringFormat("Caught signal %i\n", sigval);
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
fflush(stderr);
|
||||
Crash(formattedMessage.c_str());
|
||||
}
|
||||
|
||||
} // namespace Trinity
|
||||
} // namespace acore
|
||||
|
||||
std::string GetDebugInfo()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include "Define.h"
|
||||
#include <string>
|
||||
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
DECLSPEC_NORETURN void Assert(char const* file, int line, char const* function, std::string const& debugInfo, char const* message) ATTR_NORETURN;
|
||||
DECLSPEC_NORETURN void Assert(char const* file, int line, char const* function, std::string const& debugInfo, char const* message, char const* format, ...) ATTR_NORETURN ATTR_PRINTF(6, 7);
|
||||
|
|
@ -25,7 +25,7 @@ namespace Trinity
|
|||
|
||||
DECLSPEC_NORETURN void AbortHandler(int sigval) ATTR_NORETURN;
|
||||
|
||||
} // namespace Trinity
|
||||
} // namespace acore
|
||||
|
||||
std::string GetDebugInfo();
|
||||
|
||||
|
|
@ -41,12 +41,12 @@ std::string GetDebugInfo();
|
|||
#define EXCEPTION_ASSERTION_FAILURE 0xC0000420L
|
||||
#endif
|
||||
|
||||
#define WPAssert(cond, ...) ASSERT_BEGIN do { if (!(cond)) Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, GetDebugInfo(), #cond, ##__VA_ARGS__); } while(0) ASSERT_END
|
||||
#define WPAssert_NODEBUGINFO(cond, ...) ASSERT_BEGIN do { if (!(cond)) Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, "", #cond, ##__VA_ARGS__); } while(0) ASSERT_END
|
||||
#define WPFatal(cond, ...) ASSERT_BEGIN do { if (!(cond)) Trinity::Fatal(__FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__); } while(0) ASSERT_END
|
||||
#define WPError(cond, msg) ASSERT_BEGIN do { if (!(cond)) Trinity::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
|
||||
#define WPWarning(cond, msg) ASSERT_BEGIN do { if (!(cond)) Trinity::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
|
||||
#define WPAbort() ASSERT_BEGIN do { Trinity::Abort(__FILE__, __LINE__, __FUNCTION__); } while(0) ASSERT_END
|
||||
#define WPAssert(cond, ...) ASSERT_BEGIN do { if (!(cond)) acore::Assert(__FILE__, __LINE__, __FUNCTION__, GetDebugInfo(), #cond, ##__VA_ARGS__); } while(0) ASSERT_END
|
||||
#define WPAssert_NODEBUGINFO(cond, ...) ASSERT_BEGIN do { if (!(cond)) acore::Assert(__FILE__, __LINE__, __FUNCTION__, "", #cond, ##__VA_ARGS__); } while(0) ASSERT_END
|
||||
#define WPFatal(cond, ...) ASSERT_BEGIN do { if (!(cond)) acore::Fatal(__FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__); } while(0) ASSERT_END
|
||||
#define WPError(cond, msg) ASSERT_BEGIN do { if (!(cond)) acore::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
|
||||
#define WPWarning(cond, msg) ASSERT_BEGIN do { if (!(cond)) acore::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
|
||||
#define WPAbort() ASSERT_BEGIN do { acore::Abort(__FILE__, __LINE__, __FUNCTION__); } while(0) ASSERT_END
|
||||
|
||||
#ifdef PERFORMANCE_PROFILING
|
||||
#define ASSERT(cond, ...) ((void)0)
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_DEFINE_H
|
||||
#define TRINITY_DEFINE_H
|
||||
#ifndef ACORE_DEFINE_H
|
||||
#define ACORE_DEFINE_H
|
||||
|
||||
#include <cstddef>
|
||||
#include <cinttypes>
|
||||
|
|
@ -17,19 +17,19 @@
|
|||
#define OS_WIN
|
||||
#endif
|
||||
|
||||
#define TRINITY_LITTLEENDIAN 0
|
||||
#define TRINITY_BIGENDIAN 1
|
||||
#define ACORE_LITTLEENDIAN 0
|
||||
#define ACORE_BIGENDIAN 1
|
||||
|
||||
#if !defined(TRINITY_ENDIAN)
|
||||
#if !defined(ACORE_ENDIAN)
|
||||
# if defined (ACE_BIG_ENDIAN)
|
||||
# define TRINITY_ENDIAN TRINITY_BIGENDIAN
|
||||
# define ACORE_ENDIAN ACORE_BIGENDIAN
|
||||
# else //ACE_BYTE_ORDER != ACE_BIG_ENDIAN
|
||||
# define TRINITY_ENDIAN TRINITY_LITTLEENDIAN
|
||||
# define ACORE_ENDIAN ACORE_LITTLEENDIAN
|
||||
# endif //ACE_BYTE_ORDER
|
||||
#endif //TRINITY_ENDIAN
|
||||
#endif //ACORE_ENDIAN
|
||||
|
||||
#if AC_PLATFORM == AC_PLATFORM_WINDOWS
|
||||
# define TRINITY_PATH_MAX MAX_PATH
|
||||
# define ACORE_PATH_MAX MAX_PATH
|
||||
# ifndef DECLSPEC_NORETURN
|
||||
# define DECLSPEC_NORETURN __declspec(noreturn)
|
||||
# endif //DECLSPEC_NORETURN
|
||||
|
|
@ -37,18 +37,18 @@
|
|||
# define DECLSPEC_DEPRECATED __declspec(deprecated)
|
||||
# endif //DECLSPEC_DEPRECATED
|
||||
#else //AC_PLATFORM != AC_PLATFORM_WINDOWS
|
||||
# define TRINITY_PATH_MAX PATH_MAX
|
||||
# define ACORE_PATH_MAX PATH_MAX
|
||||
# define DECLSPEC_NORETURN
|
||||
# define DECLSPEC_DEPRECATED
|
||||
#endif //AC_PLATFORM
|
||||
|
||||
#if !defined(COREDEBUG)
|
||||
# define TRINITY_INLINE inline
|
||||
# define ACORE_INLINE inline
|
||||
#else //COREDEBUG
|
||||
# if !defined(TRINITY_DEBUG)
|
||||
# define TRINITY_DEBUG
|
||||
# endif //TRINITY_DEBUG
|
||||
# define TRINITY_INLINE
|
||||
# if !defined(ACORE_DEBUG)
|
||||
# define ACORE_DEBUG
|
||||
# endif //ACORE_DEBUG
|
||||
# define ACORE_INLINE
|
||||
#endif //!COREDEBUG
|
||||
|
||||
#if AC_COMPILER == AC_COMPILER_GNU
|
||||
|
|
@ -80,4 +80,4 @@ typedef std::uint32_t uint32;
|
|||
typedef std::uint16_t uint16;
|
||||
typedef std::uint8_t uint8;
|
||||
|
||||
#endif //TRINITY_DEFINE_H
|
||||
#endif //ACORE_DEFINE_H
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_FACTORY_HOLDER
|
||||
#define TRINITY_FACTORY_HOLDER
|
||||
#ifndef ACORE_FACTORY_HOLDER
|
||||
#define ACORE_FACTORY_HOLDER
|
||||
|
||||
#include "Define.h"
|
||||
#include "Dynamic/TypeList.h"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_OBJECTREGISTRY_H
|
||||
#define TRINITY_OBJECTREGISTRY_H
|
||||
#ifndef ACORE_OBJECTREGISTRY_H
|
||||
#define ACORE_OBJECTREGISTRY_H
|
||||
|
||||
#include "Define.h"
|
||||
#include <ace/Singleton.h>
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_TYPECONTAINER_H
|
||||
#define TRINITY_TYPECONTAINER_H
|
||||
#ifndef ACORE_TYPECONTAINER_H
|
||||
#define ACORE_TYPECONTAINER_H
|
||||
|
||||
/*
|
||||
* Here, you'll find a series of containers that allow you to hold multiple
|
||||
|
|
@ -86,19 +86,19 @@ template<class OBJECT_TYPES>
|
|||
class TypeMapContainer
|
||||
{
|
||||
public:
|
||||
template<class SPECIFIC_TYPE> size_t Count() const { return Trinity::Count(i_elements, (SPECIFIC_TYPE*)NULL); }
|
||||
template<class SPECIFIC_TYPE> size_t Count() const { return acore::Count(i_elements, (SPECIFIC_TYPE*)NULL); }
|
||||
|
||||
/// inserts a specific object into the container
|
||||
template<class SPECIFIC_TYPE> bool insert(SPECIFIC_TYPE *obj)
|
||||
{
|
||||
SPECIFIC_TYPE* t = Trinity::Insert(i_elements, obj);
|
||||
SPECIFIC_TYPE* t = acore::Insert(i_elements, obj);
|
||||
return (t != NULL);
|
||||
}
|
||||
|
||||
/// Removes the object from the container, and returns the removed object
|
||||
//template<class SPECIFIC_TYPE> bool remove(SPECIFIC_TYPE* obj)
|
||||
//{
|
||||
// SPECIFIC_TYPE* t = Trinity::Remove(i_elements, obj);
|
||||
// SPECIFIC_TYPE* t = acore::Remove(i_elements, obj);
|
||||
// return (t != NULL);
|
||||
//}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#include "Dynamic/TypeList.h"
|
||||
#include <map>
|
||||
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
/* ContainerMapList Helpers */
|
||||
// count functions
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#include "Utilities/TypeList.h"
|
||||
#include <map>
|
||||
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
/* ContainerMapList Helpers */
|
||||
// count functions
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_TYPECONTAINERVISITOR_H
|
||||
#define TRINITY_TYPECONTAINERVISITOR_H
|
||||
#ifndef ACORE_TYPECONTAINERVISITOR_H
|
||||
#define ACORE_TYPECONTAINERVISITOR_H
|
||||
|
||||
/*
|
||||
* @class TypeContainerVisitor is implemented as a visitor pattern. It is
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_TYPELIST_H
|
||||
#define TRINITY_TYPELIST_H
|
||||
#ifndef ACORE_TYPELIST_H
|
||||
#define ACORE_TYPELIST_H
|
||||
|
||||
/*
|
||||
@struct TypeList
|
||||
|
|
|
|||
|
|
@ -199,8 +199,8 @@ FILE* Log::openGmlogPerAccount(uint32 account)
|
|||
if (m_gmlog_filename_format.empty())
|
||||
return NULL;
|
||||
|
||||
char namebuf[TRINITY_PATH_MAX];
|
||||
snprintf(namebuf, TRINITY_PATH_MAX, m_gmlog_filename_format.c_str(), account);
|
||||
char namebuf[ACORE_PATH_MAX];
|
||||
snprintf(namebuf, ACORE_PATH_MAX, m_gmlog_filename_format.c_str(), account);
|
||||
return fopen(namebuf, "a");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -80,8 +80,8 @@ int DelayExecutor::start(int num_threads, ACE_Method_Request* pre_svc_hook, ACE_
|
|||
queue_.queue()->activate();
|
||||
|
||||
// pussywizard:
|
||||
//ACORE::ThreadPriority tp;
|
||||
//int _priority = tp.getPriority(ACORE::Priority_Highest);
|
||||
//acore::ThreadPriority tp;
|
||||
//int _priority = tp.getPriority(acore::Priority_Highest);
|
||||
//if (ACE_Task_Base::activate(THR_NEW_LWP | THR_JOINABLE, num_threads, 0, _priority) == -1)
|
||||
// return -1;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include <chrono>
|
||||
#include <system_error>
|
||||
|
||||
using namespace ACORE;
|
||||
using namespace acore;
|
||||
|
||||
Thread::Thread() : m_task(nullptr), m_iThreadId(), m_ThreadImp()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#include <thread>
|
||||
#include <atomic>
|
||||
|
||||
namespace ACORE
|
||||
namespace acore
|
||||
{
|
||||
class Runnable
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_BYTECONVERTER_H
|
||||
#define TRINITY_BYTECONVERTER_H
|
||||
#ifndef ACORE_BYTECONVERTER_H
|
||||
#define ACORE_BYTECONVERTER_H
|
||||
|
||||
/** ByteConverter reverse your byte order. This is use
|
||||
for cross platform where they have different endians.
|
||||
|
|
@ -32,7 +32,7 @@ namespace ByteConverter
|
|||
}
|
||||
}
|
||||
|
||||
#if TRINITY_ENDIAN == TRINITY_BIGENDIAN
|
||||
#if ACORE_ENDIAN == ACORE_BIGENDIAN
|
||||
template<typename T> inline void EndianConvert(T& val) { ByteConverter::apply<T>(&val); }
|
||||
template<typename T> inline void EndianConvertReverse(T&) { }
|
||||
template<typename T> inline void EndianConvertPtr(void* val) { ByteConverter::apply<T>(val); }
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include <ace/Event_Handler.h>
|
||||
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
|
||||
/// Handle termination signals
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "fmt/printf.h"
|
||||
|
||||
namespace ACORE
|
||||
namespace acore
|
||||
{
|
||||
/// Default AC string format function.
|
||||
template<typename Format, typename... Args>
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_TIMER_H
|
||||
#define TRINITY_TIMER_H
|
||||
#ifndef ACORE_TIMER_H
|
||||
#define ACORE_TIMER_H
|
||||
|
||||
#include "ace/OS_NS_sys_time.h"
|
||||
#include "Common.h"
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ add_dependencies(authserver revision.h)
|
|||
|
||||
if(NOT WIN32)
|
||||
set_target_properties(authserver PROPERTIES
|
||||
COMPILE_DEFINITIONS _TRINITY_REALM_CONFIG="${CONF_DIR}/authserver.conf")
|
||||
COMPILE_DEFINITIONS _ACORE_REALM_CONFIG="${CONF_DIR}/authserver.conf")
|
||||
endif()
|
||||
|
||||
target_link_libraries(authserver
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@
|
|||
#define PROCESS_HIGH_PRIORITY -15 // [-20, 19], default is 0
|
||||
#endif
|
||||
|
||||
#ifndef _TRINITY_REALM_CONFIG
|
||||
# define _TRINITY_REALM_CONFIG "authserver.conf"
|
||||
#ifndef _ACORE_REALM_CONFIG
|
||||
# define _ACORE_REALM_CONFIG "authserver.conf"
|
||||
#endif
|
||||
|
||||
bool StartDB();
|
||||
|
|
@ -47,7 +47,7 @@ bool stopEvent = false; // Setting it to tru
|
|||
LoginDatabaseWorkerPool LoginDatabase; // Accessor to the authserver database
|
||||
|
||||
/// Handle authserver's termination signals
|
||||
class AuthServerSignalHandler : public Trinity::SignalHandler
|
||||
class AuthServerSignalHandler : public acore::SignalHandler
|
||||
{
|
||||
public:
|
||||
virtual void HandleSignal(int sigNum)
|
||||
|
|
@ -74,7 +74,7 @@ void usage(const char* prog)
|
|||
extern int main(int argc, char** argv)
|
||||
{
|
||||
// Command line parsing to get the configuration file name
|
||||
char const* configFile = _TRINITY_REALM_CONFIG;
|
||||
char const* configFile = _ACORE_REALM_CONFIG;
|
||||
int count = 1;
|
||||
while (count < argc)
|
||||
{
|
||||
|
|
@ -92,7 +92,7 @@ extern int main(int argc, char** argv)
|
|||
++count;
|
||||
}
|
||||
|
||||
std::string cfg_def_file=_TRINITY_REALM_CONFIG;
|
||||
std::string cfg_def_file=_ACORE_REALM_CONFIG;
|
||||
cfg_def_file += ".dist";
|
||||
|
||||
if (!sConfigMgr->LoadInitial(cfg_def_file.c_str())) {
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ typedef struct AuthHandler
|
|||
#endif
|
||||
|
||||
// Launch a thread to transfer a patch to the client
|
||||
class PatcherRunnable: public ACORE::Runnable
|
||||
class PatcherRunnable: public acore::Runnable
|
||||
{
|
||||
public:
|
||||
PatcherRunnable(class AuthSocket*);
|
||||
|
|
@ -329,7 +329,7 @@ bool AuthSocket::_HandleLogonChallenge()
|
|||
|
||||
// pussywizard: logon flood protection:
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, LastLoginAttemptMutex);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, LastLoginAttemptMutex);
|
||||
std::string ipaddr = socket().getRemoteAddress();
|
||||
uint32 currTime = time(NULL);
|
||||
std::map<std::string, uint32>::iterator itr = LastLoginAttemptTimeForIP.find(ipaddr);
|
||||
|
|
@ -1145,7 +1145,7 @@ bool AuthSocket::_HandleXferResume()
|
|||
socket().recv((char*)&start, sizeof(start));
|
||||
fseek(pPatch, long(start), 0);
|
||||
|
||||
ACORE::Thread u(new PatcherRunnable(this));
|
||||
acore::Thread u(new PatcherRunnable(this));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1181,7 +1181,7 @@ bool AuthSocket::_HandleXferAccept()
|
|||
socket().recv_skip(1); // clear input buffer
|
||||
fseek(pPatch, 0, 0);
|
||||
|
||||
ACORE::Thread u(new PatcherRunnable(this));
|
||||
acore::Thread u(new PatcherRunnable(this));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_COMBATAI_H
|
||||
#define TRINITY_COMBATAI_H
|
||||
#ifndef ACORE_COMBATAI_H
|
||||
#define ACORE_COMBATAI_H
|
||||
|
||||
#include "CreatureAI.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_GAMEOBJECTAI_H
|
||||
#define TRINITY_GAMEOBJECTAI_H
|
||||
#ifndef ACORE_GAMEOBJECTAI_H
|
||||
#define ACORE_GAMEOBJECTAI_H
|
||||
|
||||
#include "Define.h"
|
||||
#include <list>
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_GUARDAI_H
|
||||
#define TRINITY_GUARDAI_H
|
||||
#ifndef ACORE_GUARDAI_H
|
||||
#define ACORE_GUARDAI_H
|
||||
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_PASSIVEAI_H
|
||||
#define TRINITY_PASSIVEAI_H
|
||||
#ifndef ACORE_PASSIVEAI_H
|
||||
#define ACORE_PASSIVEAI_H
|
||||
|
||||
#include "CreatureAI.h"
|
||||
//#include "CreatureAIImpl.h"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_PETAI_H
|
||||
#define TRINITY_PETAI_H
|
||||
#ifndef ACORE_PETAI_H
|
||||
#define ACORE_PETAI_H
|
||||
|
||||
#include "CreatureAI.h"
|
||||
#include "Timer.h"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_REACTORAI_H
|
||||
#define TRINITY_REACTORAI_H
|
||||
#ifndef ACORE_REACTORAI_H
|
||||
#define ACORE_REACTORAI_H
|
||||
|
||||
#include "CreatureAI.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
|
|||
me->IsFriendlyTo(victim) || !me->CanSeeOrDetect(victim))
|
||||
{
|
||||
victim = NULL;
|
||||
Trinity::NearestAttackableUnitInObjectRangeCheck u_check(me, me, max_range);
|
||||
Trinity::UnitLastSearcher<Trinity::NearestAttackableUnitInObjectRangeCheck> checker(me, victim, u_check);
|
||||
acore::NearestAttackableUnitInObjectRangeCheck u_check(me, me, max_range);
|
||||
acore::UnitLastSearcher<acore::NearestAttackableUnitInObjectRangeCheck> checker(me, victim, u_check);
|
||||
me->VisitNearbyObject(max_range, checker);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_TOTEMAI_H
|
||||
#define TRINITY_TOTEMAI_H
|
||||
#ifndef ACORE_TOTEMAI_H
|
||||
#define ACORE_TOTEMAI_H
|
||||
|
||||
#include "CreatureAI.h"
|
||||
#include "Timer.h"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_UNITAI_H
|
||||
#define TRINITY_UNITAI_H
|
||||
#ifndef ACORE_UNITAI_H
|
||||
#define ACORE_UNITAI_H
|
||||
|
||||
#include "Define.h"
|
||||
#include "Unit.h"
|
||||
|
|
@ -28,7 +28,7 @@ enum SelectAggroTarget
|
|||
};
|
||||
|
||||
// default predicate function to select target based on distance, player and/or aura criteria
|
||||
struct DefaultTargetSelector : public ACORE::unary_function<Unit*, bool>
|
||||
struct DefaultTargetSelector : public acore::unary_function<Unit*, bool>
|
||||
{
|
||||
const Unit* me;
|
||||
float m_dist;
|
||||
|
|
@ -78,7 +78,7 @@ struct DefaultTargetSelector : public ACORE::unary_function<Unit*, bool>
|
|||
|
||||
// Target selector for spell casts checking range, auras and attributes
|
||||
// TODO: Add more checks from Spell::CheckCast
|
||||
struct SpellTargetSelector : public ACORE::unary_function<Unit*, bool>
|
||||
struct SpellTargetSelector : public acore::unary_function<Unit*, bool>
|
||||
{
|
||||
public:
|
||||
SpellTargetSelector(Unit* caster, uint32 spellId);
|
||||
|
|
@ -92,7 +92,7 @@ struct SpellTargetSelector : public ACORE::unary_function<Unit*, bool>
|
|||
// Very simple target selector, will just skip main target
|
||||
// NOTE: When passing to UnitAI::SelectTarget remember to use 0 as position for random selection
|
||||
// because tank will not be in the temporary list
|
||||
struct NonTankTargetSelector : public ACORE::unary_function<Unit*, bool>
|
||||
struct NonTankTargetSelector : public acore::unary_function<Unit*, bool>
|
||||
{
|
||||
public:
|
||||
NonTankTargetSelector(Creature* source, bool playerOnly = true) : _source(source), _playerOnly(playerOnly) { }
|
||||
|
|
@ -104,7 +104,7 @@ struct NonTankTargetSelector : public ACORE::unary_function<Unit*, bool>
|
|||
};
|
||||
|
||||
// Simple selector for units using mana
|
||||
struct PowerUsersSelector : public ACORE::unary_function<Unit*, bool>
|
||||
struct PowerUsersSelector : public acore::unary_function<Unit*, bool>
|
||||
{
|
||||
Unit const* _me;
|
||||
Powers const _power;
|
||||
|
|
@ -135,7 +135,7 @@ struct PowerUsersSelector : public ACORE::unary_function<Unit*, bool>
|
|||
}
|
||||
};
|
||||
|
||||
struct FarthestTargetSelector : public ACORE::unary_function<Unit*, bool>
|
||||
struct FarthestTargetSelector : public acore::unary_function<Unit*, bool>
|
||||
{
|
||||
FarthestTargetSelector(Unit const* unit, float dist, bool playerOnly, bool inLos) : _me(unit), _dist(dist), _playerOnly(playerOnly), _inLos(inLos) {}
|
||||
|
||||
|
|
@ -191,7 +191,7 @@ class UnitAI
|
|||
|
||||
Unit* SelectTarget(SelectAggroTarget targetType, uint32 position = 0, float dist = 0.0f, bool playerOnly = false, int32 aura = 0);
|
||||
// Select the targets satifying the predicate.
|
||||
// predicate shall extend ACORE::unary_function<Unit*, bool>
|
||||
// predicate shall extend acore::unary_function<Unit*, bool>
|
||||
template <class PREDICATE> Unit* SelectTarget(SelectAggroTarget targetType, uint32 position, PREDICATE const& predicate)
|
||||
{
|
||||
ThreatContainer::StorageType const& threatlist = me->getThreatManager().getThreatList();
|
||||
|
|
@ -207,7 +207,7 @@ class UnitAI
|
|||
return NULL;
|
||||
|
||||
if (targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST)
|
||||
targetList.sort(Trinity::ObjectDistanceOrderPred(me));
|
||||
targetList.sort(acore::ObjectDistanceOrderPred(me));
|
||||
|
||||
switch (targetType)
|
||||
{
|
||||
|
|
@ -241,7 +241,7 @@ class UnitAI
|
|||
void SelectTargetList(std::list<Unit*>& targetList, uint32 num, SelectAggroTarget targetType, float dist = 0.0f, bool playerOnly = false, int32 aura = 0);
|
||||
|
||||
// Select the targets satifying the predicate.
|
||||
// predicate shall extend ACORE::unary_function<Unit*, bool>
|
||||
// predicate shall extend acore::unary_function<Unit*, bool>
|
||||
template <class PREDICATE> void SelectTargetList(std::list<Unit*>& targetList, PREDICATE const& predicate, uint32 maxTargets, SelectAggroTarget targetType)
|
||||
{
|
||||
ThreatContainer::StorageType const& threatlist = me->getThreatManager().getThreatList();
|
||||
|
|
@ -256,13 +256,13 @@ class UnitAI
|
|||
return;
|
||||
|
||||
if (targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST)
|
||||
targetList.sort(Trinity::ObjectDistanceOrderPred(me));
|
||||
targetList.sort(acore::ObjectDistanceOrderPred(me));
|
||||
|
||||
if (targetType == SELECT_TARGET_FARTHEST || targetType == SELECT_TARGET_BOTTOMAGGRO)
|
||||
targetList.reverse();
|
||||
|
||||
if (targetType == SELECT_TARGET_RANDOM)
|
||||
Trinity::Containers::RandomResizeList(targetList, maxTargets);
|
||||
acore::Containers::RandomResizeList(targetList, maxTargets);
|
||||
else
|
||||
targetList.resize(maxTargets);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_CREATUREAI_H
|
||||
#define TRINITY_CREATUREAI_H
|
||||
#ifndef ACORE_CREATUREAI_H
|
||||
#define ACORE_CREATUREAI_H
|
||||
|
||||
#include "Creature.h"
|
||||
#include "UnitAI.h"
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
#ifndef TRINITY_CREATUREAIFACTORY_H
|
||||
#define TRINITY_CREATUREAIFACTORY_H
|
||||
#ifndef ACORE_CREATUREAIFACTORY_H
|
||||
#define ACORE_CREATUREAIFACTORY_H
|
||||
|
||||
//#include "Policies/Singleton.h"
|
||||
#include "ObjectRegistry.h"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_CREATUREAIREGISTRY_H
|
||||
#define TRINITY_CREATUREAIREGISTRY_H
|
||||
#ifndef ACORE_CREATUREAIREGISTRY_H
|
||||
#define ACORE_CREATUREAIREGISTRY_H
|
||||
|
||||
namespace AIRegistry
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_CREATUREAISELECTOR_H
|
||||
#define TRINITY_CREATUREAISELECTOR_H
|
||||
#ifndef ACORE_CREATUREAISELECTOR_H
|
||||
#define ACORE_CREATUREAISELECTOR_H
|
||||
|
||||
class CreatureAI;
|
||||
class Creature;
|
||||
|
|
|
|||
|
|
@ -378,8 +378,8 @@ void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
|
|||
Unit* ScriptedAI::DoSelectLowestHpFriendly(float range, uint32 minHPDiff)
|
||||
{
|
||||
Unit* unit = NULL;
|
||||
Trinity::MostHPMissingInRange u_check(me, range, minHPDiff);
|
||||
Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange> searcher(me, unit, u_check);
|
||||
acore::MostHPMissingInRange u_check(me, range, minHPDiff);
|
||||
acore::UnitLastSearcher<acore::MostHPMissingInRange> searcher(me, unit, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
|
||||
return unit;
|
||||
|
|
@ -388,8 +388,8 @@ Unit* ScriptedAI::DoSelectLowestHpFriendly(float range, uint32 minHPDiff)
|
|||
std::list<Creature*> ScriptedAI::DoFindFriendlyCC(float range)
|
||||
{
|
||||
std::list<Creature*> list;
|
||||
Trinity::FriendlyCCedInRange u_check(me, range);
|
||||
Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange> searcher(me, list, u_check);
|
||||
acore::FriendlyCCedInRange u_check(me, range);
|
||||
acore::CreatureListSearcher<acore::FriendlyCCedInRange> searcher(me, list, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
return list;
|
||||
}
|
||||
|
|
@ -397,8 +397,8 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyCC(float range)
|
|||
std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 uiSpellid)
|
||||
{
|
||||
std::list<Creature*> list;
|
||||
Trinity::FriendlyMissingBuffInRange u_check(me, range, uiSpellid);
|
||||
Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange> searcher(me, list, u_check);
|
||||
acore::FriendlyMissingBuffInRange u_check(me, range, uiSpellid);
|
||||
acore::CreatureListSearcher<acore::FriendlyMissingBuffInRange> searcher(me, list, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
return list;
|
||||
}
|
||||
|
|
@ -407,13 +407,13 @@ Player* ScriptedAI::GetPlayerAtMinimumRange(float minimumRange)
|
|||
{
|
||||
Player* player = NULL;
|
||||
|
||||
CellCoord pair(Trinity::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
|
||||
CellCoord pair(acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::PlayerAtMinimumRangeAway check(me, minimumRange);
|
||||
Trinity::PlayerSearcher<Trinity::PlayerAtMinimumRangeAway> searcher(me, player, check);
|
||||
TypeContainerVisitor<Trinity::PlayerSearcher<Trinity::PlayerAtMinimumRangeAway>, GridTypeMapContainer> visitor(searcher);
|
||||
acore::PlayerAtMinimumRangeAway check(me, minimumRange);
|
||||
acore::PlayerSearcher<acore::PlayerAtMinimumRangeAway> searcher(me, player, check);
|
||||
TypeContainerVisitor<acore::PlayerSearcher<acore::PlayerAtMinimumRangeAway>, GridTypeMapContainer> visitor(searcher);
|
||||
|
||||
cell.Visit(pair, visitor, *me->GetMap(), *me, minimumRange);
|
||||
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ public:
|
|||
|
||||
// We need to use a copy of SummonList here, otherwise original SummonList would be modified
|
||||
StorageType listCopy = storage_;
|
||||
Trinity::Containers::RandomResizeList<uint64, Predicate>(listCopy, predicate, max);
|
||||
acore::Containers::RandomResizeList<uint64, Predicate>(listCopy, predicate, max);
|
||||
for (StorageType::iterator i = listCopy.begin(); i != listCopy.end(); ++i)
|
||||
{
|
||||
Creature* summon = ObjectAccessor::GetCreature(*me, *i);
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_SMARTAI_H
|
||||
#define TRINITY_SMARTAI_H
|
||||
#ifndef ACORE_SMARTAI_H
|
||||
#define ACORE_SMARTAI_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "Creature.h"
|
||||
|
|
|
|||
|
|
@ -27,17 +27,17 @@
|
|||
#include "SpellMgr.h"
|
||||
#include "Vehicle.h"
|
||||
|
||||
class TrinityStringTextBuilder
|
||||
class AcoreStringTextBuilder
|
||||
{
|
||||
public:
|
||||
TrinityStringTextBuilder(WorldObject* obj, ChatMsg msgtype, int32 id, uint32 language, WorldObject* target)
|
||||
AcoreStringTextBuilder(WorldObject* obj, ChatMsg msgtype, int32 id, uint32 language, WorldObject* target)
|
||||
: _source(obj), _msgType(msgtype), _textId(id), _language(language), _target(target)
|
||||
{
|
||||
}
|
||||
|
||||
size_t operator()(WorldPacket* data, LocaleConstant locale) const
|
||||
{
|
||||
std::string text = sObjectMgr->GetTrinityString(_textId, locale);
|
||||
std::string text = sObjectMgr->GetAcoreString(_textId, locale);
|
||||
return ChatHandler::BuildChatPacket(*data, _msgType, Language(_language), _source, _target, text, 0, "", locale);
|
||||
}
|
||||
|
||||
|
|
@ -741,7 +741,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
caster = unit->SummonTrigger(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetOrientation(), 5000);
|
||||
|
||||
if (e.action.cast.targetsLimit > 0 && targets->size() > e.action.cast.targetsLimit)
|
||||
Trinity::Containers::RandomResizeList(*targets, e.action.cast.targetsLimit);
|
||||
acore::Containers::RandomResizeList(*targets, e.action.cast.targetsLimit);
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
|
|
@ -797,7 +797,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
break;
|
||||
|
||||
if (e.action.cast.targetsLimit > 0 && targets->size() > e.action.cast.targetsLimit)
|
||||
Trinity::Containers::RandomResizeList(*targets, e.action.cast.targetsLimit);
|
||||
acore::Containers::RandomResizeList(*targets, e.action.cast.targetsLimit);
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
|
|
@ -1042,7 +1042,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
me->DoFleeToGetAssistance();
|
||||
if (e.action.flee.withEmote)
|
||||
{
|
||||
TrinityStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_FLEE, LANG_UNIVERSAL, NULL);
|
||||
AcoreStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_FLEE, LANG_UNIVERSAL, NULL);
|
||||
sCreatureTextMgr->SendChatPacket(me, builder, CHAT_MSG_MONSTER_EMOTE);
|
||||
}
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
|
|
@ -1340,7 +1340,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
(*itr)->ToCreature()->CallForHelp((float)e.action.callHelp.range);
|
||||
if (e.action.callHelp.withEmote)
|
||||
{
|
||||
TrinityStringTextBuilder builder(*itr, CHAT_MSG_MONSTER_EMOTE, LANG_CALL_FOR_HELP, LANG_UNIVERSAL, NULL);
|
||||
AcoreStringTextBuilder builder(*itr, CHAT_MSG_MONSTER_EMOTE, LANG_CALL_FOR_HELP, LANG_UNIVERSAL, NULL);
|
||||
sCreatureTextMgr->SendChatPacket(*itr, builder, CHAT_MSG_MONSTER_EMOTE);
|
||||
}
|
||||
}
|
||||
|
|
@ -1516,7 +1516,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
break;
|
||||
|
||||
// xinef: attack random target
|
||||
if (Unit* target = Trinity::Containers::SelectRandomContainerElement(*targets)->ToUnit())
|
||||
if (Unit* target = acore::Containers::SelectRandomContainerElement(*targets)->ToUnit())
|
||||
me->AI()->AttackStart(target);
|
||||
|
||||
delete targets;
|
||||
|
|
@ -1880,7 +1880,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
if (ObjectList* targets = GetTargets(e, unit))
|
||||
{
|
||||
// xinef: we want to move to random element
|
||||
target = Trinity::Containers::SelectRandomContainerElement(*targets);
|
||||
target = acore::Containers::SelectRandomContainerElement(*targets);
|
||||
delete targets;
|
||||
}
|
||||
}
|
||||
|
|
@ -2436,7 +2436,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
// xinef: my implementation
|
||||
if (e.action.jump.selfJump)
|
||||
{
|
||||
if (WorldObject* target = Trinity::Containers::SelectRandomContainerElement(*targets))
|
||||
if (WorldObject* target = acore::Containers::SelectRandomContainerElement(*targets))
|
||||
if (me)
|
||||
me->GetMotionMaster()->MoveJump(target->GetPositionX() + e.target.x, target->GetPositionY() + e.target.y, target->GetPositionZ() + e.target.z, (float)e.action.jump.speedxy, (float)e.action.jump.speedz);
|
||||
}
|
||||
|
|
@ -3554,8 +3554,8 @@ ObjectList* SmartScript::GetWorldObjectsInDist(float dist)
|
|||
WorldObject* obj = GetBaseObject();
|
||||
if (obj)
|
||||
{
|
||||
Trinity::AllWorldObjectsInRange u_check(obj, dist);
|
||||
Trinity::WorldObjectListSearcher<Trinity::AllWorldObjectsInRange> searcher(obj, *targets, u_check);
|
||||
acore::AllWorldObjectsInRange u_check(obj, dist);
|
||||
acore::WorldObjectListSearcher<acore::AllWorldObjectsInRange> searcher(obj, *targets, u_check);
|
||||
obj->VisitNearbyObject(dist, searcher);
|
||||
}
|
||||
return targets;
|
||||
|
|
@ -3685,7 +3685,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
|||
RecalcTimer(e, 1000, 3000);
|
||||
return;
|
||||
}
|
||||
ProcessTimedAction(e, e.event.friendlyCC.repeatMin, e.event.friendlyCC.repeatMax, Trinity::Containers::SelectRandomContainerElement(pList));
|
||||
ProcessTimedAction(e, e.event.friendlyCC.repeatMin, e.event.friendlyCC.repeatMax, acore::Containers::SelectRandomContainerElement(pList));
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_FRIENDLY_MISSING_BUFF:
|
||||
|
|
@ -3696,7 +3696,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
|||
if (pList.empty())
|
||||
return;
|
||||
|
||||
ProcessTimedAction(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax, Trinity::Containers::SelectRandomContainerElement(pList));
|
||||
ProcessTimedAction(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax, acore::Containers::SelectRandomContainerElement(pList));
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_HAS_AURA:
|
||||
|
|
@ -4321,7 +4321,7 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTrigger c
|
|||
}
|
||||
for (SmartAIEventList::iterator i = e.begin(); i != e.end(); ++i)
|
||||
{
|
||||
#ifndef TRINITY_DEBUG
|
||||
#ifndef ACORE_DEBUG
|
||||
if ((*i).event.event_flags & SMART_EVENT_FLAG_DEBUG_ONLY)
|
||||
continue;
|
||||
#endif
|
||||
|
|
@ -4503,8 +4503,8 @@ Unit* SmartScript::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff)
|
|||
|
||||
Unit* unit = NULL;
|
||||
|
||||
Trinity::MostHPMissingInRange u_check(me, range, MinHPDiff);
|
||||
Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange> searcher(me, unit, u_check);
|
||||
acore::MostHPMissingInRange u_check(me, range, MinHPDiff);
|
||||
acore::UnitLastSearcher<acore::MostHPMissingInRange> searcher(me, unit, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
return unit;
|
||||
}
|
||||
|
|
@ -4514,8 +4514,8 @@ void SmartScript::DoFindFriendlyCC(std::list<Creature*>& _list, float range)
|
|||
if (!me)
|
||||
return;
|
||||
|
||||
Trinity::FriendlyCCedInRange u_check(me, range);
|
||||
Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange> searcher(me, _list, u_check);
|
||||
acore::FriendlyCCedInRange u_check(me, range);
|
||||
acore::CreatureListSearcher<acore::FriendlyCCedInRange> searcher(me, _list, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
}
|
||||
|
||||
|
|
@ -4524,8 +4524,8 @@ void SmartScript::DoFindFriendlyMissingBuff(std::list<Creature*>& list, float ra
|
|||
if (!me)
|
||||
return;
|
||||
|
||||
Trinity::FriendlyMissingBuffInRange u_check(me, range, spellid);
|
||||
Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange> searcher(me, list, u_check);
|
||||
acore::FriendlyMissingBuffInRange u_check(me, range, spellid);
|
||||
acore::CreatureListSearcher<acore::FriendlyMissingBuffInRange> searcher(me, list, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
}
|
||||
|
||||
|
|
@ -4535,8 +4535,8 @@ Unit* SmartScript::DoFindClosestFriendlyInRange(float range, bool playerOnly)
|
|||
return NULL;
|
||||
|
||||
Unit* unit = NULL;
|
||||
Trinity::AnyFriendlyNotSelfUnitInObjectRangeCheck u_check(me, me, range, playerOnly);
|
||||
Trinity::UnitLastSearcher<Trinity::AnyFriendlyNotSelfUnitInObjectRangeCheck> searcher(me, unit, u_check);
|
||||
acore::AnyFriendlyNotSelfUnitInObjectRangeCheck u_check(me, me, range, playerOnly);
|
||||
acore::UnitLastSearcher<acore::AnyFriendlyNotSelfUnitInObjectRangeCheck> searcher(me, unit, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
return unit;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_SMARTSCRIPT_H
|
||||
#define TRINITY_SMARTSCRIPT_H
|
||||
#ifndef ACORE_SMARTSCRIPT_H
|
||||
#define ACORE_SMARTSCRIPT_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "Creature.h"
|
||||
|
|
@ -162,13 +162,13 @@ class SmartScript
|
|||
{
|
||||
GameObject* gameObject = NULL;
|
||||
|
||||
CellCoord p(Trinity::ComputeCellCoord(searchObject->GetPositionX(), searchObject->GetPositionY()));
|
||||
CellCoord p(acore::ComputeCellCoord(searchObject->GetPositionX(), searchObject->GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
||||
Trinity::GameObjectWithDbGUIDCheck goCheck(guid);
|
||||
Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(searchObject, gameObject, goCheck);
|
||||
acore::GameObjectWithDbGUIDCheck goCheck(guid);
|
||||
acore::GameObjectSearcher<acore::GameObjectWithDbGUIDCheck> checker(searchObject, gameObject, goCheck);
|
||||
|
||||
TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > objectChecker(checker);
|
||||
TypeContainerVisitor<acore::GameObjectSearcher<acore::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > objectChecker(checker);
|
||||
cell.Visit(p, objectChecker, *searchObject->GetMap(), *searchObject, searchObject->GetVisibilityRange());
|
||||
|
||||
return gameObject;
|
||||
|
|
@ -177,13 +177,13 @@ class SmartScript
|
|||
Creature* FindCreatureNear(WorldObject* searchObject, uint32 guid) const
|
||||
{
|
||||
Creature* creature = NULL;
|
||||
CellCoord p(Trinity::ComputeCellCoord(searchObject->GetPositionX(), searchObject->GetPositionY()));
|
||||
CellCoord p(acore::ComputeCellCoord(searchObject->GetPositionX(), searchObject->GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
||||
Trinity::CreatureWithDbGUIDCheck target_check(guid);
|
||||
Trinity::CreatureSearcher<Trinity::CreatureWithDbGUIDCheck> checker(searchObject, creature, target_check);
|
||||
acore::CreatureWithDbGUIDCheck target_check(guid);
|
||||
acore::CreatureSearcher<acore::CreatureWithDbGUIDCheck> checker(searchObject, creature, target_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureSearcher <Trinity::CreatureWithDbGUIDCheck>, GridTypeMapContainer > unit_checker(checker);
|
||||
TypeContainerVisitor<acore::CreatureSearcher <acore::CreatureWithDbGUIDCheck>, GridTypeMapContainer > unit_checker(checker);
|
||||
cell.Visit(p, unit_checker, *searchObject->GetMap(), *searchObject, searchObject->GetVisibilityRange());
|
||||
|
||||
return creature;
|
||||
|
|
|
|||
|
|
@ -1097,7 +1097,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
|||
}
|
||||
case SMART_ACTION_LOAD_GRID:
|
||||
{
|
||||
if (!Trinity::IsValidMapCoord(e.target.x, e.target.y))
|
||||
if (!acore::IsValidMapCoord(e.target.x, e.target.y))
|
||||
{
|
||||
sLog->outError("SmartScript: SMART_ACTION_LOAD_GRID uses invalid map coords: %u, skipped.", e.entryOrGuid);
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_SMARTSCRIPTMGR_H
|
||||
#define TRINITY_SMARTSCRIPTMGR_H
|
||||
#ifndef ACORE_SMARTSCRIPTMGR_H
|
||||
#define ACORE_SMARTSCRIPTMGR_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "Creature.h"
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
class AchievementChatBuilder
|
||||
{
|
||||
|
|
@ -42,7 +42,7 @@ namespace Trinity
|
|||
|
||||
void operator()(WorldPacket& data, LocaleConstant loc_idx)
|
||||
{
|
||||
std::string text = sObjectMgr->GetTrinityString(i_textId, loc_idx);
|
||||
std::string text = sObjectMgr->GetAcoreString(i_textId, loc_idx);
|
||||
ChatHandler::BuildChatPacket(data, i_msgtype, LANG_UNIVERSAL, &i_player, &i_player, text, i_achievementId);
|
||||
}
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ namespace Trinity
|
|||
int32 i_textId;
|
||||
uint32 i_achievementId;
|
||||
};
|
||||
} // namespace Trinity
|
||||
} // namespace acore
|
||||
|
||||
bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
|
||||
{
|
||||
|
|
@ -662,14 +662,14 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
|
|||
if (achievement->flags & ACHIEVEMENT_FLAG_HIDDEN)
|
||||
return;
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) && defined(TRINITY_DEBUG)
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) && defined(ACORE_DEBUG)
|
||||
sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::SendAchievementEarned(%u)", achievement->ID);
|
||||
#endif
|
||||
|
||||
if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId()))
|
||||
{
|
||||
Trinity::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID);
|
||||
Trinity::LocalizedPacketDo<Trinity::AchievementChatBuilder> say_do(say_builder);
|
||||
acore::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID);
|
||||
acore::LocalizedPacketDo<acore::AchievementChatBuilder> say_do(say_builder);
|
||||
guild->BroadcastWorker(say_do, GetPlayer());
|
||||
}
|
||||
|
||||
|
|
@ -686,15 +686,15 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
|
|||
// if player is in world he can tell his friends about new achievement
|
||||
else if (GetPlayer()->IsInWorld())
|
||||
{
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY());
|
||||
CellCoord p = acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID);
|
||||
Trinity::LocalizedPacketDo<Trinity::AchievementChatBuilder> say_do(say_builder);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::AchievementChatBuilder> > say_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::AchievementChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
acore::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID);
|
||||
acore::LocalizedPacketDo<acore::AchievementChatBuilder> say_do(say_builder);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::AchievementChatBuilder> > say_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::AchievementChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
#ifndef __TRINITY_ACHIEVEMENTMGR_H
|
||||
#define __TRINITY_ACHIEVEMENTMGR_H
|
||||
#ifndef __ACORE_ACHIEVEMENTMGR_H
|
||||
#define __ACORE_ACHIEVEMENTMGR_H
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
|
|
|||
|
|
@ -978,8 +978,8 @@ bool BfCapturePoint::Update(uint32 diff)
|
|||
}
|
||||
|
||||
std::list<Player*> players;
|
||||
Trinity::AnyPlayerInObjectRangeCheck checker(capturePoint, radius);
|
||||
Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(capturePoint, players, checker);
|
||||
acore::AnyPlayerInObjectRangeCheck checker(capturePoint, radius);
|
||||
acore::PlayerListSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(capturePoint, players, checker);
|
||||
capturePoint->VisitNearbyWorldObject(radius, searcher);
|
||||
|
||||
for (std::list<Player*>::iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
class BattlegroundChatBuilder
|
||||
{
|
||||
|
|
@ -46,7 +46,7 @@ namespace Trinity
|
|||
|
||||
void operator()(WorldPacket& data, LocaleConstant loc_idx)
|
||||
{
|
||||
char const* text = sObjectMgr->GetTrinityString(_textId, loc_idx);
|
||||
char const* text = sObjectMgr->GetAcoreString(_textId, loc_idx);
|
||||
if (_args)
|
||||
{
|
||||
// we need copy va_list before use or original va_list will corrupted
|
||||
|
|
@ -83,9 +83,9 @@ namespace Trinity
|
|||
|
||||
void operator()(WorldPacket& data, LocaleConstant loc_idx)
|
||||
{
|
||||
char const* text = sObjectMgr->GetTrinityString(_textId, loc_idx);
|
||||
char const* arg1str = _arg1 ? sObjectMgr->GetTrinityString(_arg1, loc_idx) : "";
|
||||
char const* arg2str = _arg2 ? sObjectMgr->GetTrinityString(_arg2, loc_idx) : "";
|
||||
char const* text = sObjectMgr->GetAcoreString(_textId, loc_idx);
|
||||
char const* arg1str = _arg1 ? sObjectMgr->GetAcoreString(_arg1, loc_idx) : "";
|
||||
char const* arg2str = _arg2 ? sObjectMgr->GetAcoreString(_arg2, loc_idx) : "";
|
||||
|
||||
char str[2048];
|
||||
snprintf(str, 2048, text, arg1str, arg2str);
|
||||
|
|
@ -100,7 +100,7 @@ namespace Trinity
|
|||
uint32 _arg1;
|
||||
uint32 _arg2;
|
||||
};
|
||||
} // namespace Trinity
|
||||
} // namespace acore
|
||||
|
||||
template<class Do>
|
||||
void Battleground::BroadcastWorker(Do& _do)
|
||||
|
|
@ -1064,7 +1064,7 @@ uint32 Battleground::GetBonusHonorFromKill(uint32 kills) const
|
|||
{
|
||||
//variable kills means how many honorable kills you scored (so we need kills * honor_for_one_kill)
|
||||
uint32 maxLevel = std::min<uint32>(GetMaxLevel(), 80U);
|
||||
return Trinity::Honor::hk_honor_at_level(maxLevel, float(kills));
|
||||
return acore::Honor::hk_honor_at_level(maxLevel, float(kills));
|
||||
}
|
||||
|
||||
void Battleground::BlockMovement(Player* player)
|
||||
|
|
@ -1745,8 +1745,8 @@ void Battleground::SendMessageToAll(uint32 entry, ChatMsg type, Player const* so
|
|||
if (!entry)
|
||||
return;
|
||||
|
||||
Trinity::BattlegroundChatBuilder bg_builder(type, entry, source);
|
||||
Trinity::LocalizedPacketDo<Trinity::BattlegroundChatBuilder> bg_do(bg_builder);
|
||||
acore::BattlegroundChatBuilder bg_builder(type, entry, source);
|
||||
acore::LocalizedPacketDo<acore::BattlegroundChatBuilder> bg_do(bg_builder);
|
||||
BroadcastWorker(bg_do);
|
||||
}
|
||||
|
||||
|
|
@ -1758,8 +1758,8 @@ void Battleground::PSendMessageToAll(uint32 entry, ChatMsg type, Player const* s
|
|||
va_list ap;
|
||||
va_start(ap, source);
|
||||
|
||||
Trinity::BattlegroundChatBuilder bg_builder(type, entry, source, &ap);
|
||||
Trinity::LocalizedPacketDo<Trinity::BattlegroundChatBuilder> bg_do(bg_builder);
|
||||
acore::BattlegroundChatBuilder bg_builder(type, entry, source, &ap);
|
||||
acore::LocalizedPacketDo<acore::BattlegroundChatBuilder> bg_do(bg_builder);
|
||||
BroadcastWorker(bg_do);
|
||||
|
||||
va_end(ap);
|
||||
|
|
@ -1775,7 +1775,7 @@ void Battleground::SendWarningToAll(uint32 entry, ...)
|
|||
{
|
||||
if (localizedPackets.find(itr->second->GetSession()->GetSessionDbLocaleIndex()) == localizedPackets.end())
|
||||
{
|
||||
char const* format = sObjectMgr->GetTrinityString(entry, itr->second->GetSession()->GetSessionDbLocaleIndex());
|
||||
char const* format = sObjectMgr->GetAcoreString(entry, itr->second->GetSession()->GetSessionDbLocaleIndex());
|
||||
|
||||
char str[1024];
|
||||
va_list ap;
|
||||
|
|
@ -1792,8 +1792,8 @@ void Battleground::SendWarningToAll(uint32 entry, ...)
|
|||
|
||||
void Battleground::SendMessage2ToAll(uint32 entry, ChatMsg type, Player const* source, uint32 arg1, uint32 arg2)
|
||||
{
|
||||
Trinity::Battleground2ChatBuilder bg_builder(type, entry, source, arg1, arg2);
|
||||
Trinity::LocalizedPacketDo<Trinity::Battleground2ChatBuilder> bg_do(bg_builder);
|
||||
acore::Battleground2ChatBuilder bg_builder(type, entry, source, arg1, arg2);
|
||||
acore::LocalizedPacketDo<acore::Battleground2ChatBuilder> bg_do(bg_builder);
|
||||
BroadcastWorker(bg_do);
|
||||
}
|
||||
|
||||
|
|
@ -1804,10 +1804,10 @@ void Battleground::EndNow()
|
|||
}
|
||||
|
||||
// To be removed
|
||||
char const* Battleground::GetTrinityString(int32 entry)
|
||||
char const* Battleground::GetAcoreString(int32 entry)
|
||||
{
|
||||
// FIXME: now we have different DBC locales and need localized message for each target client
|
||||
return sObjectMgr->GetTrinityStringForDBCLocale(entry);
|
||||
return sObjectMgr->GetAcoreStringForDBCLocale(entry);
|
||||
}
|
||||
|
||||
void Battleground::HandleTriggerBuff(GameObject* gameObject)
|
||||
|
|
|
|||
|
|
@ -569,7 +569,7 @@ class Battleground
|
|||
void DoorOpen(uint32 type);
|
||||
void DoorClose(uint32 type);
|
||||
//to be removed
|
||||
const char* GetTrinityString(int32 entry);
|
||||
const char* GetAcoreString(int32 entry);
|
||||
|
||||
virtual bool HandlePlayerUnderMap(Player* /*player*/) { return false; }
|
||||
|
||||
|
|
|
|||
|
|
@ -641,8 +641,8 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid
|
|||
uint32 winner_arena = player->GetRandomWinner() ? BG_REWARD_WINNER_ARENA_LAST : BG_REWARD_WINNER_ARENA_FIRST;
|
||||
uint32 loser_kills = player->GetRandomWinner() ? BG_REWARD_LOSER_HONOR_LAST : BG_REWARD_LOSER_HONOR_FIRST;
|
||||
|
||||
winner_kills = Trinity::Honor::hk_honor_at_level(player->getLevel(), float(winner_kills));
|
||||
loser_kills = Trinity::Honor::hk_honor_at_level(player->getLevel(), float(loser_kills));
|
||||
winner_kills = acore::Honor::hk_honor_at_level(player->getLevel(), float(winner_kills));
|
||||
loser_kills = acore::Honor::hk_honor_at_level(player->getLevel(), float(loser_kills));
|
||||
|
||||
data->Initialize(SMSG_BATTLEFIELD_LIST);
|
||||
*data << uint64(guid); // battlemaster guid
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ void BattlegroundAV::HandleKillUnit(Creature* unit, Player* killer)
|
|||
SpawnBGObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+i, RESPAWN_IMMEDIATELY);
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
|
||||
if (creature)
|
||||
YellToAll(creature, GetTrinityString(LANG_BG_AV_A_CAPTAIN_DEAD), LANG_UNIVERSAL);
|
||||
YellToAll(creature, GetAcoreString(LANG_BG_AV_A_CAPTAIN_DEAD), LANG_UNIVERSAL);
|
||||
DelCreature(AV_CPLACE_TRIGGER16);
|
||||
}
|
||||
else if (entry == BG_AV_CreatureInfo[AV_NPC_H_CAPTAIN])
|
||||
|
|
@ -128,7 +128,7 @@ void BattlegroundAV::HandleKillUnit(Creature* unit, Player* killer)
|
|||
SpawnBGObject(BG_AV_OBJECT_BURN_BUILDING_HORDE+i, RESPAWN_IMMEDIATELY);
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
|
||||
if (creature)
|
||||
YellToAll(creature, GetTrinityString(LANG_BG_AV_H_CAPTAIN_DEAD), LANG_UNIVERSAL);
|
||||
YellToAll(creature, GetAcoreString(LANG_BG_AV_H_CAPTAIN_DEAD), LANG_UNIVERSAL);
|
||||
DelCreature(AV_CPLACE_TRIGGER18);
|
||||
}
|
||||
else if (entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_N_4] || entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_A_4] || entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_H_4])
|
||||
|
|
@ -642,9 +642,9 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
|||
//send a nice message to all :)
|
||||
char buf[256];
|
||||
if (IsTower(node))
|
||||
sprintf(buf, GetTrinityString(LANG_BG_AV_TOWER_TAKEN), GetNodeName(node), (ownerId == TEAM_ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE));
|
||||
sprintf(buf, GetAcoreString(LANG_BG_AV_TOWER_TAKEN), GetNodeName(node), (ownerId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE));
|
||||
else
|
||||
sprintf(buf, GetTrinityString(LANG_BG_AV_GRAVE_TAKEN), GetNodeName(node), (ownerId == TEAM_ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) :GetTrinityString(LANG_BG_AV_HORDE));
|
||||
sprintf(buf, GetAcoreString(LANG_BG_AV_GRAVE_TAKEN), GetNodeName(node), (ownerId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) :GetAcoreString(LANG_BG_AV_HORDE));
|
||||
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
|
||||
if (creature)
|
||||
|
|
@ -727,8 +727,8 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, TeamId teamId, bool initial)
|
|||
{
|
||||
m_Mine_Reclaim_Timer[mine]=AV_MINE_RECLAIM_TIMER;
|
||||
char buf[256];
|
||||
sprintf(buf, GetTrinityString(LANG_BG_AV_MINE_TAKEN), GetTrinityString((mine == AV_NORTH_MINE) ? LANG_BG_AV_MINE_NORTH : LANG_BG_AV_MINE_SOUTH),
|
||||
(teamId == TEAM_ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE));
|
||||
sprintf(buf, GetAcoreString(LANG_BG_AV_MINE_TAKEN), GetAcoreString((mine == AV_NORTH_MINE) ? LANG_BG_AV_MINE_NORTH : LANG_BG_AV_MINE_SOUTH),
|
||||
(teamId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE));
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
|
||||
if (creature)
|
||||
YellToAll(creature, buf, LANG_UNIVERSAL);
|
||||
|
|
@ -976,7 +976,7 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
|
|||
}
|
||||
//send a nice message to all :)
|
||||
char buf[256];
|
||||
sprintf(buf, GetTrinityString((IsTower(node)) ? LANG_BG_AV_TOWER_DEFENDED : LANG_BG_AV_GRAVE_DEFENDED), GetNodeName(node), (teamId == TEAM_ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE));
|
||||
sprintf(buf, GetAcoreString((IsTower(node)) ? LANG_BG_AV_TOWER_DEFENDED : LANG_BG_AV_GRAVE_DEFENDED), GetNodeName(node), (teamId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE));
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
|
||||
if (creature)
|
||||
YellToAll(creature, buf, LANG_UNIVERSAL);
|
||||
|
|
@ -1078,7 +1078,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
|||
|
||||
//send a nice message to all :)
|
||||
char buf[256];
|
||||
sprintf(buf, (IsTower(node)) ? GetTrinityString(LANG_BG_AV_TOWER_ASSAULTED) : GetTrinityString(LANG_BG_AV_GRAVE_ASSAULTED), GetNodeName(node), (teamId == TEAM_ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE));
|
||||
sprintf(buf, (IsTower(node)) ? GetAcoreString(LANG_BG_AV_TOWER_ASSAULTED) : GetAcoreString(LANG_BG_AV_GRAVE_ASSAULTED), GetNodeName(node), (teamId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE));
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
|
||||
if (creature)
|
||||
YellToAll(creature, buf, LANG_UNIVERSAL);
|
||||
|
|
@ -1436,21 +1436,21 @@ char const* BattlegroundAV::GetNodeName(BG_AV_Nodes node)
|
|||
{
|
||||
switch (node)
|
||||
{
|
||||
case BG_AV_NODES_FIRSTAID_STATION: return GetTrinityString(LANG_BG_AV_NODE_GRAVE_STORM_AID);
|
||||
case BG_AV_NODES_DUNBALDAR_SOUTH: return GetTrinityString(LANG_BG_AV_NODE_TOWER_DUN_S);
|
||||
case BG_AV_NODES_DUNBALDAR_NORTH: return GetTrinityString(LANG_BG_AV_NODE_TOWER_DUN_N);
|
||||
case BG_AV_NODES_STORMPIKE_GRAVE: return GetTrinityString(LANG_BG_AV_NODE_GRAVE_STORMPIKE);
|
||||
case BG_AV_NODES_ICEWING_BUNKER: return GetTrinityString(LANG_BG_AV_NODE_TOWER_ICEWING);
|
||||
case BG_AV_NODES_STONEHEART_GRAVE: return GetTrinityString(LANG_BG_AV_NODE_GRAVE_STONE);
|
||||
case BG_AV_NODES_STONEHEART_BUNKER: return GetTrinityString(LANG_BG_AV_NODE_TOWER_STONE);
|
||||
case BG_AV_NODES_SNOWFALL_GRAVE: return GetTrinityString(LANG_BG_AV_NODE_GRAVE_SNOW);
|
||||
case BG_AV_NODES_ICEBLOOD_TOWER: return GetTrinityString(LANG_BG_AV_NODE_TOWER_ICE);
|
||||
case BG_AV_NODES_ICEBLOOD_GRAVE: return GetTrinityString(LANG_BG_AV_NODE_GRAVE_ICE);
|
||||
case BG_AV_NODES_TOWER_POINT: return GetTrinityString(LANG_BG_AV_NODE_TOWER_POINT);
|
||||
case BG_AV_NODES_FROSTWOLF_GRAVE: return GetTrinityString(LANG_BG_AV_NODE_GRAVE_FROST);
|
||||
case BG_AV_NODES_FROSTWOLF_ETOWER: return GetTrinityString(LANG_BG_AV_NODE_TOWER_FROST_E);
|
||||
case BG_AV_NODES_FROSTWOLF_WTOWER: return GetTrinityString(LANG_BG_AV_NODE_TOWER_FROST_W);
|
||||
case BG_AV_NODES_FROSTWOLF_HUT: return GetTrinityString(LANG_BG_AV_NODE_GRAVE_FROST_HUT);
|
||||
case BG_AV_NODES_FIRSTAID_STATION: return GetAcoreString(LANG_BG_AV_NODE_GRAVE_STORM_AID);
|
||||
case BG_AV_NODES_DUNBALDAR_SOUTH: return GetAcoreString(LANG_BG_AV_NODE_TOWER_DUN_S);
|
||||
case BG_AV_NODES_DUNBALDAR_NORTH: return GetAcoreString(LANG_BG_AV_NODE_TOWER_DUN_N);
|
||||
case BG_AV_NODES_STORMPIKE_GRAVE: return GetAcoreString(LANG_BG_AV_NODE_GRAVE_STORMPIKE);
|
||||
case BG_AV_NODES_ICEWING_BUNKER: return GetAcoreString(LANG_BG_AV_NODE_TOWER_ICEWING);
|
||||
case BG_AV_NODES_STONEHEART_GRAVE: return GetAcoreString(LANG_BG_AV_NODE_GRAVE_STONE);
|
||||
case BG_AV_NODES_STONEHEART_BUNKER: return GetAcoreString(LANG_BG_AV_NODE_TOWER_STONE);
|
||||
case BG_AV_NODES_SNOWFALL_GRAVE: return GetAcoreString(LANG_BG_AV_NODE_GRAVE_SNOW);
|
||||
case BG_AV_NODES_ICEBLOOD_TOWER: return GetAcoreString(LANG_BG_AV_NODE_TOWER_ICE);
|
||||
case BG_AV_NODES_ICEBLOOD_GRAVE: return GetAcoreString(LANG_BG_AV_NODE_GRAVE_ICE);
|
||||
case BG_AV_NODES_TOWER_POINT: return GetAcoreString(LANG_BG_AV_NODE_TOWER_POINT);
|
||||
case BG_AV_NODES_FROSTWOLF_GRAVE: return GetAcoreString(LANG_BG_AV_NODE_GRAVE_FROST);
|
||||
case BG_AV_NODES_FROSTWOLF_ETOWER: return GetAcoreString(LANG_BG_AV_NODE_TOWER_FROST_E);
|
||||
case BG_AV_NODES_FROSTWOLF_WTOWER: return GetAcoreString(LANG_BG_AV_NODE_TOWER_FROST_W);
|
||||
case BG_AV_NODES_FROSTWOLF_HUT: return GetAcoreString(LANG_BG_AV_NODE_GRAVE_FROST_HUT);
|
||||
default:
|
||||
sLog->outError("tried to get name for node %u", node);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_CALENDARMGR_H
|
||||
#define TRINITY_CALENDARMGR_H
|
||||
#ifndef ACORE_CALENDARMGR_H
|
||||
#define ACORE_CALENDARMGR_H
|
||||
|
||||
#include <ace/Singleton.h>
|
||||
#include "Common.h"
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
#ifndef __TRINITY_CHANNELMGR_H
|
||||
#define __TRINITY_CHANNELMGR_H
|
||||
#ifndef __ACORE_CHANNELMGR_H
|
||||
#define __ACORE_CHANNELMGR_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "Channel.h"
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ std::vector<ChatCommand> const& ChatHandler::getCommandTable()
|
|||
|
||||
std::string ChatHandler::PGetParseString(uint32 entry, ...) const
|
||||
{
|
||||
const char *format = GetTrinityString(entry);
|
||||
const char *format = GetAcoreString(entry);
|
||||
char str[1024];
|
||||
va_list ap;
|
||||
va_start(ap, entry);
|
||||
|
|
@ -70,9 +70,9 @@ std::string ChatHandler::PGetParseString(uint32 entry, ...) const
|
|||
return std::string(str);
|
||||
}
|
||||
|
||||
char const* ChatHandler::GetTrinityString(uint32 entry) const
|
||||
char const* ChatHandler::GetAcoreString(uint32 entry) const
|
||||
{
|
||||
return m_session->GetTrinityString(entry);
|
||||
return m_session->GetAcoreString(entry);
|
||||
}
|
||||
|
||||
bool ChatHandler::isAvailable(ChatCommand const& cmd) const
|
||||
|
|
@ -211,12 +211,12 @@ void ChatHandler::SendGlobalGMSysMessage(const char *str)
|
|||
|
||||
void ChatHandler::SendSysMessage(uint32 entry)
|
||||
{
|
||||
SendSysMessage(GetTrinityString(entry));
|
||||
SendSysMessage(GetAcoreString(entry));
|
||||
}
|
||||
|
||||
void ChatHandler::PSendSysMessage(uint32 entry, ...)
|
||||
{
|
||||
const char *format = GetTrinityString(entry);
|
||||
const char *format = GetAcoreString(entry);
|
||||
va_list ap;
|
||||
char str [2048];
|
||||
va_start(ap, entry);
|
||||
|
|
@ -886,8 +886,8 @@ GameObject* ChatHandler::GetNearbyGameObject()
|
|||
|
||||
Player* pl = m_session->GetPlayer();
|
||||
GameObject* obj = NULL;
|
||||
Trinity::NearestGameObjectCheck check(*pl);
|
||||
Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectCheck> searcher(pl, obj, check);
|
||||
acore::NearestGameObjectCheck check(*pl);
|
||||
acore::GameObjectLastSearcher<acore::NearestGameObjectCheck> searcher(pl, obj, check);
|
||||
pl->VisitNearbyGridObject(SIZE_OF_GRIDS, searcher);
|
||||
return obj;
|
||||
}
|
||||
|
|
@ -904,13 +904,13 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid
|
|||
if (!obj && sObjectMgr->GetGOData(lowguid)) // guid is DB guid of object
|
||||
{
|
||||
// search near player then
|
||||
CellCoord p(Trinity::ComputeCellCoord(pl->GetPositionX(), pl->GetPositionY()));
|
||||
CellCoord p(acore::ComputeCellCoord(pl->GetPositionX(), pl->GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
||||
Trinity::GameObjectWithDbGUIDCheck go_check(lowguid);
|
||||
Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(pl, obj, go_check);
|
||||
acore::GameObjectWithDbGUIDCheck go_check(lowguid);
|
||||
acore::GameObjectSearcher<acore::GameObjectWithDbGUIDCheck> checker(pl, obj, go_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
TypeContainerVisitor<acore::GameObjectSearcher<acore::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
cell.Visit(p, object_checker, *pl->GetMap(), *pl, pl->GetGridActivationRange());
|
||||
}
|
||||
|
||||
|
|
@ -1217,9 +1217,9 @@ std::string ChatHandler::GetNameLink(Player* chr) const
|
|||
return playerLink(chr->GetName());
|
||||
}
|
||||
|
||||
char const* CliHandler::GetTrinityString(uint32 entry) const
|
||||
char const* CliHandler::GetAcoreString(uint32 entry) const
|
||||
{
|
||||
return sObjectMgr->GetTrinityStringForDBCLocale(entry);
|
||||
return sObjectMgr->GetAcoreStringForDBCLocale(entry);
|
||||
}
|
||||
|
||||
bool CliHandler::isAvailable(ChatCommand const& cmd) const
|
||||
|
|
@ -1236,7 +1236,7 @@ void CliHandler::SendSysMessage(const char *str)
|
|||
|
||||
std::string CliHandler::GetNameLink() const
|
||||
{
|
||||
return GetTrinityString(LANG_CONSOLE_COMMAND);
|
||||
return GetAcoreString(LANG_CONSOLE_COMMAND);
|
||||
}
|
||||
|
||||
bool CliHandler::needReportToTarget(Player* /*chr*/) const
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class ChatHandler
|
|||
static char* LineFromMessage(char*& pos) { char* start = strtok(pos, "\n"); pos = NULL; return start; }
|
||||
|
||||
// function with different implementation for chat/console
|
||||
virtual char const* GetTrinityString(uint32 entry) const;
|
||||
virtual char const* GetAcoreString(uint32 entry) const;
|
||||
virtual void SendSysMessage(char const* str);
|
||||
|
||||
void SendSysMessage(uint32 entry);
|
||||
|
|
@ -139,7 +139,7 @@ class CliHandler : public ChatHandler
|
|||
explicit CliHandler(void* callbackArg, Print* zprint) : m_callbackArg(callbackArg), m_print(zprint) {}
|
||||
|
||||
// overwrite functions
|
||||
char const* GetTrinityString(uint32 entry) const override;
|
||||
char const* GetAcoreString(uint32 entry) const override;
|
||||
bool isAvailable(ChatCommand const& cmd) const override;
|
||||
void SendSysMessage(const char *str) override;
|
||||
std::string GetNameLink() const override;
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ void ThreatContainer::modifyThreatPercent(Unit* victim, int32 percent)
|
|||
void ThreatContainer::update()
|
||||
{
|
||||
if (iDirty && iThreatList.size() > 1)
|
||||
iThreatList.sort(Trinity::ThreatOrderPred());
|
||||
iThreatList.sort(acore::ThreatOrderPred());
|
||||
|
||||
iDirty = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ class ThreatManager
|
|||
|
||||
//=================================================
|
||||
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
// Binary predicate for sorting HostileReferences based on threat value
|
||||
class ThreatOrderPred
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_CONDITIONMGR_H
|
||||
#define TRINITY_CONDITIONMGR_H
|
||||
#ifndef ACORE_CONDITIONMGR_H
|
||||
#define ACORE_CONDITIONMGR_H
|
||||
|
||||
#include "Define.h"
|
||||
#include "Errors.h"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_DISABLEMGR_H
|
||||
#define TRINITY_DISABLEMGR_H
|
||||
#ifndef ACORE_DISABLEMGR_H
|
||||
#define ACORE_DISABLEMGR_H
|
||||
|
||||
#include "Define.h"
|
||||
|
||||
|
|
@ -53,4 +53,4 @@ namespace DisableMgr
|
|||
void CheckQuestDisables();
|
||||
}
|
||||
|
||||
#endif //TRINITY_DISABLEMGR_H
|
||||
#endif //ACORE_DISABLEMGR_H
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_DBCSTORES_H
|
||||
#define TRINITY_DBCSTORES_H
|
||||
#ifndef ACORE_DBCSTORES_H
|
||||
#define ACORE_DBCSTORES_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "DBCStore.h"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_DBCSTRUCTURE_H
|
||||
#define TRINITY_DBCSTRUCTURE_H
|
||||
#ifndef ACORE_DBCSTRUCTURE_H
|
||||
#define ACORE_DBCSTRUCTURE_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "DBCEnums.h"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_DBCSFRM_H
|
||||
#define TRINITY_DBCSFRM_H
|
||||
#ifndef ACORE_DBCSFRM_H
|
||||
#define ACORE_DBCSFRM_H
|
||||
|
||||
char const Achievementfmt[] = "niixssssssssssssssssxxxxxxxxxxxxxxxxxxiixixxxxxxxxxxxxxxxxxxii";
|
||||
const std::string CustomAchievementfmt="pppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaapapaaaaaaaaaaaaaaaaaapp";
|
||||
|
|
|
|||
|
|
@ -31,31 +31,31 @@ namespace lfg
|
|||
std::string rolesstr = "";
|
||||
|
||||
if (roles & PLAYER_ROLE_TANK)
|
||||
rolesstr.append(sObjectMgr->GetTrinityStringForDBCLocale(LANG_LFG_ROLE_TANK));
|
||||
rolesstr.append(sObjectMgr->GetAcoreStringForDBCLocale(LANG_LFG_ROLE_TANK));
|
||||
|
||||
if (roles & PLAYER_ROLE_HEALER)
|
||||
{
|
||||
if (!rolesstr.empty())
|
||||
rolesstr.append(", ");
|
||||
rolesstr.append(sObjectMgr->GetTrinityStringForDBCLocale(LANG_LFG_ROLE_HEALER));
|
||||
rolesstr.append(sObjectMgr->GetAcoreStringForDBCLocale(LANG_LFG_ROLE_HEALER));
|
||||
}
|
||||
|
||||
if (roles & PLAYER_ROLE_DAMAGE)
|
||||
{
|
||||
if (!rolesstr.empty())
|
||||
rolesstr.append(", ");
|
||||
rolesstr.append(sObjectMgr->GetTrinityStringForDBCLocale(LANG_LFG_ROLE_DAMAGE));
|
||||
rolesstr.append(sObjectMgr->GetAcoreStringForDBCLocale(LANG_LFG_ROLE_DAMAGE));
|
||||
}
|
||||
|
||||
if (roles & PLAYER_ROLE_LEADER)
|
||||
{
|
||||
if (!rolesstr.empty())
|
||||
rolesstr.append(", ");
|
||||
rolesstr.append(sObjectMgr->GetTrinityStringForDBCLocale(LANG_LFG_ROLE_LEADER));
|
||||
rolesstr.append(sObjectMgr->GetAcoreStringForDBCLocale(LANG_LFG_ROLE_LEADER));
|
||||
}
|
||||
|
||||
if (rolesstr.empty())
|
||||
rolesstr.append(sObjectMgr->GetTrinityStringForDBCLocale(LANG_LFG_ROLE_NONE));
|
||||
rolesstr.append(sObjectMgr->GetAcoreStringForDBCLocale(LANG_LFG_ROLE_NONE));
|
||||
|
||||
return rolesstr;
|
||||
}
|
||||
|
|
@ -91,7 +91,7 @@ namespace lfg
|
|||
break;
|
||||
}
|
||||
|
||||
return std::string(sObjectMgr->GetTrinityStringForDBCLocale(entry));
|
||||
return std::string(sObjectMgr->GetAcoreStringForDBCLocale(entry));
|
||||
}
|
||||
|
||||
} // namespace lfg
|
||||
|
|
|
|||
|
|
@ -412,7 +412,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(Lfg5Guids const& checkWith, const
|
|||
proposal.cancelTime = time(NULL) + LFG_TIME_PROPOSAL;
|
||||
proposal.state = LFG_PROPOSAL_INITIATING;
|
||||
proposal.leader = 0;
|
||||
proposal.dungeonId = Trinity::Containers::SelectRandomContainerElement(proposalDungeons);
|
||||
proposal.dungeonId = acore::Containers::SelectRandomContainerElement(proposalDungeons);
|
||||
|
||||
bool leader = false;
|
||||
for (LfgRolesMap::const_iterator itRoles = proposalRoles.begin(); itRoles != proposalRoles.end(); ++itRoles)
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ bool Corpse::Create(uint32 guidlow, Player* owner)
|
|||
SetObjectScale(1);
|
||||
SetUInt64Value(CORPSE_FIELD_OWNER, owner->GetGUID());
|
||||
|
||||
_gridCoord = Trinity::ComputeGridCoord(GetPositionX(), GetPositionY());
|
||||
_gridCoord = acore::ComputeGridCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -173,7 +173,7 @@ bool Corpse::LoadCorpseFromDB(uint32 guid, Field* fields)
|
|||
return false;
|
||||
}
|
||||
|
||||
_gridCoord = Trinity::ComputeGridCoord(GetPositionX(), GetPositionY());
|
||||
_gridCoord = acore::ComputeGridCoord(GetPositionX(), GetPositionY());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -759,13 +759,13 @@ void Creature::DoFleeToGetAssistance()
|
|||
{
|
||||
Creature* creature = NULL;
|
||||
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
Trinity::NearestAssistCreatureInCreatureRangeCheck u_check(this, GetVictim(), radius);
|
||||
Trinity::CreatureLastSearcher<Trinity::NearestAssistCreatureInCreatureRangeCheck> searcher(this, creature, u_check);
|
||||
acore::NearestAssistCreatureInCreatureRangeCheck u_check(this, GetVictim(), radius);
|
||||
acore::CreatureLastSearcher<acore::NearestAssistCreatureInCreatureRangeCheck> searcher(this, creature, u_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestAssistCreatureInCreatureRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
TypeContainerVisitor<acore::CreatureLastSearcher<acore::NearestAssistCreatureInCreatureRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
|
||||
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
|
||||
|
||||
|
|
@ -1846,7 +1846,7 @@ SpellInfo const* Creature::reachWithSpellCure(Unit* victim)
|
|||
// select nearest hostile unit within the given distance (regardless of threat list).
|
||||
Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) const
|
||||
{
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
|
|
@ -1856,11 +1856,11 @@ Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) c
|
|||
if (dist == 0.0f)
|
||||
dist = MAX_SEARCHER_DISTANCE;
|
||||
|
||||
Trinity::NearestHostileUnitCheck u_check(this, dist, playerOnly);
|
||||
Trinity::UnitLastSearcher<Trinity::NearestHostileUnitCheck> searcher(this, target, u_check);
|
||||
acore::NearestHostileUnitCheck u_check(this, dist, playerOnly);
|
||||
acore::UnitLastSearcher<acore::NearestHostileUnitCheck> searcher(this, target, u_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestHostileUnitCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestHostileUnitCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
|
||||
cell.Visit(p, world_unit_searcher, *GetMap(), *this, dist);
|
||||
cell.Visit(p, grid_unit_searcher, *GetMap(), *this, dist);
|
||||
|
|
@ -1872,7 +1872,7 @@ Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) c
|
|||
// select nearest hostile unit within the given attack distance (i.e. distance is ignored if > than ATTACK_DISTANCE), regardless of threat list.
|
||||
Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
|
||||
{
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
|
|
@ -1884,11 +1884,11 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
|
|||
dist = MAX_SEARCHER_DISTANCE;
|
||||
|
||||
{
|
||||
Trinity::NearestHostileUnitInAttackDistanceCheck u_check(this, dist);
|
||||
Trinity::UnitLastSearcher<Trinity::NearestHostileUnitInAttackDistanceCheck> searcher(this, target, u_check);
|
||||
acore::NearestHostileUnitInAttackDistanceCheck u_check(this, dist);
|
||||
acore::UnitLastSearcher<acore::NearestHostileUnitInAttackDistanceCheck> searcher(this, target, u_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestHostileUnitInAttackDistanceCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestHostileUnitInAttackDistanceCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitInAttackDistanceCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitInAttackDistanceCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
|
||||
cell.Visit(p, world_unit_searcher, *GetMap(), *this, dist);
|
||||
cell.Visit(p, grid_unit_searcher, *GetMap(), *this, dist);
|
||||
|
|
@ -1924,14 +1924,14 @@ void Creature::CallAssistance()
|
|||
std::list<Creature*> assistList;
|
||||
|
||||
{
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::AnyAssistCreatureInRangeCheck u_check(this, GetVictim(), radius);
|
||||
Trinity::CreatureListSearcher<Trinity::AnyAssistCreatureInRangeCheck> searcher(this, assistList, u_check);
|
||||
acore::AnyAssistCreatureInRangeCheck u_check(this, GetVictim(), radius);
|
||||
acore::CreatureListSearcher<acore::AnyAssistCreatureInRangeCheck> searcher(this, assistList, u_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AnyAssistCreatureInRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AnyAssistCreatureInRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
|
||||
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
|
||||
}
|
||||
|
|
@ -1956,14 +1956,14 @@ void Creature::CallForHelp(float radius)
|
|||
if (radius <= 0.0f || !GetVictim() || IsPet() || IsCharmed())
|
||||
return;
|
||||
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::CallOfHelpCreatureInRangeDo u_do(this, GetVictim(), radius);
|
||||
Trinity::CreatureWorker<Trinity::CallOfHelpCreatureInRangeDo> worker(this, u_do);
|
||||
acore::CallOfHelpCreatureInRangeDo u_do(this, GetVictim(), radius);
|
||||
acore::CreatureWorker<acore::CallOfHelpCreatureInRangeDo> worker(this, u_do);
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureWorker<Trinity::CallOfHelpCreatureInRangeDo>, GridTypeMapContainer > grid_creature_searcher(worker);
|
||||
TypeContainerVisitor<acore::CreatureWorker<acore::CallOfHelpCreatureInRangeDo>, GridTypeMapContainer > grid_creature_searcher(worker);
|
||||
|
||||
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
|
||||
}
|
||||
|
|
@ -2585,7 +2585,7 @@ std::string const& Creature::GetNameForLocaleIdx(LocaleConstant loc_idx) const
|
|||
|
||||
void Creature::SetPosition(float x, float y, float z, float o)
|
||||
{
|
||||
if (!Trinity::IsValidMapCoord(x, y, z, o))
|
||||
if (!acore::IsValidMapCoord(x, y, z, o))
|
||||
return;
|
||||
|
||||
GetMap()->CreatureRelocation(this, x, y, z, o);
|
||||
|
|
|
|||
|
|
@ -258,8 +258,8 @@ void CreatureGroup::LeaderMoveTo(float x, float y, float z, bool run)
|
|||
float dy = y + sin(followAngle + pathAngle) * followDist;
|
||||
float dz = z;
|
||||
|
||||
Trinity::NormalizeMapCoord(dx);
|
||||
Trinity::NormalizeMapCoord(dy);
|
||||
acore::NormalizeMapCoord(dx);
|
||||
acore::NormalizeMapCoord(dy);
|
||||
|
||||
member->UpdateGroundPositionZ(dx, dy, dz);
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ GossipMenu::~GossipMenu()
|
|||
|
||||
void GossipMenu::AddMenuItem(int32 menuItemId, uint8 icon, std::string const& message, uint32 sender, uint32 action, std::string const& boxMessage, uint32 boxMoney, bool coded /*= false*/)
|
||||
{
|
||||
//TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
ASSERT(_menuItems.size() <= GOSSIP_MAX_MENU_ITEMS);
|
||||
|
||||
// Find a free new id - script case
|
||||
|
|
@ -120,7 +119,6 @@ void GossipMenu::AddMenuItem(uint32 menuId, uint32 menuItemId, uint32 sender, ui
|
|||
|
||||
void GossipMenu::AddGossipMenuItemData(uint32 menuItemId, uint32 gossipActionMenuId, uint32 gossipActionPoi)
|
||||
{
|
||||
//TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
GossipMenuItemData& itemData = _menuItemData[menuItemId];
|
||||
|
||||
itemData.GossipActionMenuId = gossipActionMenuId;
|
||||
|
|
@ -129,7 +127,6 @@ void GossipMenu::AddGossipMenuItemData(uint32 menuItemId, uint32 gossipActionMen
|
|||
|
||||
uint32 GossipMenu::GetMenuItemSender(uint32 menuItemId) const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
GossipMenuItemContainer::const_iterator itr = _menuItems.find(menuItemId);
|
||||
if (itr == _menuItems.end())
|
||||
return 0;
|
||||
|
|
@ -139,7 +136,6 @@ uint32 GossipMenu::GetMenuItemSender(uint32 menuItemId) const
|
|||
|
||||
uint32 GossipMenu::GetMenuItemAction(uint32 menuItemId) const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
GossipMenuItemContainer::const_iterator itr = _menuItems.find(menuItemId);
|
||||
if (itr == _menuItems.end())
|
||||
return 0;
|
||||
|
|
@ -149,7 +145,6 @@ uint32 GossipMenu::GetMenuItemAction(uint32 menuItemId) const
|
|||
|
||||
bool GossipMenu::IsMenuItemCoded(uint32 menuItemId) const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
GossipMenuItemContainer::const_iterator itr = _menuItems.find(menuItemId);
|
||||
if (itr == _menuItems.end())
|
||||
return false;
|
||||
|
|
@ -159,7 +154,6 @@ bool GossipMenu::IsMenuItemCoded(uint32 menuItemId) const
|
|||
|
||||
void GossipMenu::ClearMenu()
|
||||
{
|
||||
//TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
_menuItems.clear();
|
||||
_menuItemData.clear();
|
||||
}
|
||||
|
|
@ -281,8 +275,6 @@ void QuestMenu::AddMenuItem(uint32 QuestId, uint8 Icon)
|
|||
if (!sObjectMgr->GetQuestTemplate(QuestId))
|
||||
return;
|
||||
|
||||
//TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
|
||||
ASSERT(_questMenuItems.size() <= GOSSIP_MAX_MENU_ITEMS);
|
||||
|
||||
QuestMenuItem questMenuItem;
|
||||
|
|
@ -295,7 +287,6 @@ void QuestMenu::AddMenuItem(uint32 QuestId, uint8 Icon)
|
|||
|
||||
bool QuestMenu::HasItem(uint32 questId) const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
for (QuestMenuItemList::const_iterator i = _questMenuItems.begin(); i != _questMenuItems.end(); ++i)
|
||||
if (i->QuestId == questId)
|
||||
return true;
|
||||
|
|
@ -305,7 +296,6 @@ bool QuestMenu::HasItem(uint32 questId) const
|
|||
|
||||
void QuestMenu::ClearMenu()
|
||||
{
|
||||
//TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
_questMenuItems.clear();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -163,19 +163,16 @@ class GossipMenu
|
|||
|
||||
uint32 GetMenuItemCount() const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
return _menuItems.size();
|
||||
}
|
||||
|
||||
bool Empty() const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
return _menuItems.empty();
|
||||
}
|
||||
|
||||
GossipMenuItem const* GetItem(uint32 id) const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
GossipMenuItemContainer::const_iterator itr = _menuItems.find(id);
|
||||
if (itr != _menuItems.end())
|
||||
return &itr->second;
|
||||
|
|
@ -185,7 +182,6 @@ class GossipMenu
|
|||
|
||||
GossipMenuItemData const* GetItemData(uint32 indexId) const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
GossipMenuItemDataContainer::const_iterator itr = _menuItemData.find(indexId);
|
||||
if (itr != _menuItemData.end())
|
||||
return &itr->second;
|
||||
|
|
@ -204,9 +200,6 @@ class GossipMenu
|
|||
return _menuItems;
|
||||
}
|
||||
|
||||
//ACE_RW_Thread_Mutex& GetLock() const { return *(const_cast<ACE_RW_Thread_Mutex*>(&_menuLock)); }
|
||||
//ACE_RW_Thread_Mutex _menuLock; // pussywizard
|
||||
|
||||
private:
|
||||
GossipMenuItemContainer _menuItems;
|
||||
GossipMenuItemDataContainer _menuItemData;
|
||||
|
|
@ -225,13 +218,11 @@ class QuestMenu
|
|||
|
||||
uint8 GetMenuItemCount() const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
return _questMenuItems.size();
|
||||
}
|
||||
|
||||
bool Empty() const
|
||||
{
|
||||
//TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
return _questMenuItems.empty();
|
||||
}
|
||||
|
||||
|
|
@ -239,13 +230,9 @@ class QuestMenu
|
|||
|
||||
QuestMenuItem const& GetItem(uint16 index) const
|
||||
{
|
||||
//TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, GetLock());
|
||||
return _questMenuItems[index];
|
||||
}
|
||||
|
||||
//ACE_RW_Thread_Mutex& GetLock() const { return *(const_cast<ACE_RW_Thread_Mutex*>(&_menuLock)); }
|
||||
//ACE_RW_Thread_Mutex _menuLock; // pussywizard
|
||||
|
||||
private:
|
||||
QuestMenuItemList _questMenuItems;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -453,7 +453,7 @@ void GameObject::Update(uint32 diff)
|
|||
if (info->summoningRitual.casterTargetSpell && info->summoningRitual.casterTargetSpell != 1) // No idea why this field is a bool in some cases
|
||||
for (uint32 i = 0; i < info->summoningRitual.casterTargetSpellTargets; i++)
|
||||
// m_unique_users can contain only player GUIDs
|
||||
if (Player* target = ObjectAccessor::GetPlayer(*this, Trinity::Containers::SelectRandomContainerElement(m_unique_users)))
|
||||
if (Player* target = ObjectAccessor::GetPlayer(*this, acore::Containers::SelectRandomContainerElement(m_unique_users)))
|
||||
spellCaster->CastSpell(target, info->summoningRitual.casterTargetSpell, true);
|
||||
|
||||
// finish owners spell
|
||||
|
|
@ -601,8 +601,8 @@ void GameObject::Update(uint32 diff)
|
|||
// search unfriendly creature
|
||||
if (owner) // hunter trap
|
||||
{
|
||||
Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
|
||||
Trinity::UnitSearcher<Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
|
||||
acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
|
||||
acore::UnitSearcher<acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
|
||||
VisitNearbyGridObject(radius, searcher);
|
||||
if (!target)
|
||||
VisitNearbyWorldObject(radius, searcher);
|
||||
|
|
@ -612,8 +612,8 @@ void GameObject::Update(uint32 diff)
|
|||
// environmental damage spells already have around enemies targeting but this not help in case not existed GO casting support
|
||||
// affect only players
|
||||
Player* player = NULL;
|
||||
Trinity::AnyPlayerInObjectRangeCheck checker(this, radius, true, true);
|
||||
Trinity::PlayerSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(this, player, checker);
|
||||
acore::AnyPlayerInObjectRangeCheck checker(this, radius, true, true);
|
||||
acore::PlayerSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(this, player, checker);
|
||||
VisitNearbyWorldObject(radius, searcher);
|
||||
target = player;
|
||||
}
|
||||
|
|
@ -1170,13 +1170,13 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target)
|
|||
GameObject* trapGO = NULL;
|
||||
{
|
||||
// using original GO distance
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
||||
Trinity::NearestGameObjectEntryInObjectRangeCheck go_check(*target, trapEntry, range);
|
||||
Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO, go_check);
|
||||
acore::NearestGameObjectEntryInObjectRangeCheck go_check(*target, trapEntry, range);
|
||||
acore::GameObjectLastSearcher<acore::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO, go_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
TypeContainerVisitor<acore::GameObjectLastSearcher<acore::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
cell.Visit(p, object_checker, *GetMap(), *target, range);
|
||||
}
|
||||
|
||||
|
|
@ -1190,12 +1190,12 @@ GameObject* GameObject::LookupFishingHoleAround(float range)
|
|||
{
|
||||
GameObject* ok = NULL;
|
||||
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
Trinity::NearestGameObjectFishingHole u_check(*this, range);
|
||||
Trinity::GameObjectSearcher<Trinity::NearestGameObjectFishingHole> checker(this, ok, u_check);
|
||||
acore::NearestGameObjectFishingHole u_check(*this, range);
|
||||
acore::GameObjectSearcher<acore::NearestGameObjectFishingHole> checker(this, ok, u_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::NearestGameObjectFishingHole>, GridTypeMapContainer > grid_object_checker(checker);
|
||||
TypeContainerVisitor<acore::GameObjectSearcher<acore::NearestGameObjectFishingHole>, GridTypeMapContainer > grid_object_checker(checker);
|
||||
cell.Visit(p, grid_object_checker, *GetMap(), *this, range);
|
||||
|
||||
return ok;
|
||||
|
|
@ -1951,7 +1951,7 @@ void GameObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*s
|
|||
dist += GetObjectSize();
|
||||
if (includeMargin)
|
||||
dist += VISIBILITY_COMPENSATION * 2.0f; // pussywizard: to ensure everyone receives all important packets
|
||||
Trinity::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
VisitNearbyWorldObject(dist, notifier);
|
||||
}
|
||||
|
||||
|
|
@ -2455,7 +2455,7 @@ void GameObject::SetPosition(float x, float y, float z, float o)
|
|||
{
|
||||
// pussywizard: do not call for MotionTransport and other gobjects not in grid
|
||||
|
||||
if (!Trinity::IsValidMapCoord(x, y, z, o))
|
||||
if (!acore::IsValidMapCoord(x, y, z, o))
|
||||
return;
|
||||
|
||||
GetMap()->GameObjectRelocation(this, x, y, z, o);
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_BAG_H
|
||||
#define TRINITY_BAG_H
|
||||
#ifndef ACORE_BAG_H
|
||||
#define ACORE_BAG_H
|
||||
|
||||
// Maximum 36 Slots ((CONTAINER_END - CONTAINER_FIELD_SLOT_1)/2
|
||||
#define MAX_BAG_SIZE 36 // 2.0.12
|
||||
|
|
|
|||
|
|
@ -1421,8 +1421,8 @@ void WorldObject::GetRandomPoint(const Position &pos, float distance, float &ran
|
|||
rand_y = pos.m_positionY + new_dist * sin(angle);
|
||||
rand_z = pos.m_positionZ;
|
||||
|
||||
Trinity::NormalizeMapCoord(rand_x);
|
||||
Trinity::NormalizeMapCoord(rand_y);
|
||||
acore::NormalizeMapCoord(rand_x);
|
||||
acore::NormalizeMapCoord(rand_y);
|
||||
UpdateGroundPositionZ(rand_x, rand_y, rand_z); // update to LOS height if available
|
||||
}
|
||||
|
||||
|
|
@ -1503,7 +1503,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const
|
|||
|
||||
bool Position::IsPositionValid() const
|
||||
{
|
||||
return Trinity::IsValidMapCoord(m_positionX, m_positionY, m_positionZ, m_orientation);
|
||||
return acore::IsValidMapCoord(m_positionX, m_positionY, m_positionZ, m_orientation);
|
||||
}
|
||||
|
||||
float WorldObject::GetGridActivationRange() const
|
||||
|
|
@ -1871,7 +1871,7 @@ void Object::ForceValuesUpdateAtIndex(uint32 i)
|
|||
}
|
||||
}
|
||||
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
class MonsterChatBuilder
|
||||
{
|
||||
|
|
@ -1919,61 +1919,61 @@ namespace Trinity
|
|||
Language i_language;
|
||||
WorldObject const* i_target;
|
||||
};
|
||||
} // namespace Trinity
|
||||
} // namespace acore
|
||||
|
||||
void WorldObject::MonsterSay(const char* text, uint32 language, WorldObject const* target)
|
||||
{
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, text, language, target);
|
||||
Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> say_do(say_build);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, text, language, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
}
|
||||
|
||||
void WorldObject::MonsterSay(int32 textId, uint32 language, WorldObject const* target)
|
||||
{
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, textId, language, target);
|
||||
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, textId, language, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
}
|
||||
|
||||
void WorldObject::MonsterYell(const char* text, uint32 language, WorldObject const* target)
|
||||
{
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, text, language, target);
|
||||
Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> say_do(say_build);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
|
||||
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, text, language, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
|
||||
}
|
||||
|
||||
void WorldObject::MonsterYell(int32 textId, uint32 language, WorldObject const* target)
|
||||
{
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, textId, language, target);
|
||||
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
|
||||
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, textId, language, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
|
||||
}
|
||||
|
||||
|
|
@ -1987,15 +1987,15 @@ void WorldObject::MonsterTextEmote(const char* text, WorldObject const* target,
|
|||
|
||||
void WorldObject::MonsterTextEmote(int32 textId, WorldObject const* target, bool IsBossEmote)
|
||||
{
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::MonsterChatBuilder say_build(this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId, LANG_UNIVERSAL, target);
|
||||
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)), say_do);
|
||||
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
acore::MonsterChatBuilder say_build(this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId, LANG_UNIVERSAL, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> > say_worker(this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)));
|
||||
}
|
||||
|
||||
|
|
@ -2043,7 +2043,7 @@ void WorldObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*
|
|||
dist += GetObjectSize();
|
||||
if (includeMargin)
|
||||
dist += VISIBILITY_COMPENSATION; // pussywizard: to ensure everyone receives all important packets
|
||||
Trinity::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
VisitNearbyWorldObject(dist, notifier);
|
||||
}
|
||||
|
||||
|
|
@ -2370,8 +2370,8 @@ void WorldObject::SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list
|
|||
Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive) const
|
||||
{
|
||||
Creature* creature = NULL;
|
||||
Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
|
||||
Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(this, creature, checker);
|
||||
acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
|
||||
acore::CreatureLastSearcher<acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(this, creature, checker);
|
||||
VisitNearbyObject(range, searcher);
|
||||
return creature;
|
||||
}
|
||||
|
|
@ -2379,8 +2379,8 @@ Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive
|
|||
GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
|
||||
{
|
||||
GameObject* go = NULL;
|
||||
Trinity::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range);
|
||||
Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> searcher(this, go, checker);
|
||||
acore::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range);
|
||||
acore::GameObjectLastSearcher<acore::NearestGameObjectEntryInObjectRangeCheck> searcher(this, go, checker);
|
||||
VisitNearbyGridObject(range, searcher);
|
||||
return go;
|
||||
}
|
||||
|
|
@ -2388,8 +2388,8 @@ GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
|
|||
GameObject* WorldObject::FindNearestGameObjectOfType(GameobjectTypes type, float range) const
|
||||
{
|
||||
GameObject* go = NULL;
|
||||
Trinity::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range);
|
||||
Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectTypeInObjectRangeCheck> searcher(this, go, checker);
|
||||
acore::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range);
|
||||
acore::GameObjectLastSearcher<acore::NearestGameObjectTypeInObjectRangeCheck> searcher(this, go, checker);
|
||||
VisitNearbyGridObject(range, searcher);
|
||||
return go;
|
||||
}
|
||||
|
|
@ -2398,8 +2398,8 @@ Player* WorldObject::SelectNearestPlayer(float distance) const
|
|||
{
|
||||
Player* target = NULL;
|
||||
|
||||
Trinity::NearestPlayerInObjectRangeCheck checker(this, distance);
|
||||
Trinity::PlayerLastSearcher<Trinity::NearestPlayerInObjectRangeCheck> searcher(this, target, checker);
|
||||
acore::NearestPlayerInObjectRangeCheck checker(this, distance);
|
||||
acore::PlayerLastSearcher<acore::NearestPlayerInObjectRangeCheck> searcher(this, target, checker);
|
||||
VisitNearbyObject(distance, searcher);
|
||||
|
||||
return target;
|
||||
|
|
@ -2407,32 +2407,32 @@ Player* WorldObject::SelectNearestPlayer(float distance) const
|
|||
|
||||
void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& gameobjectList, uint32 entry, float maxSearchRange) const
|
||||
{
|
||||
CellCoord pair(Trinity::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
CellCoord pair(acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::AllGameObjectsWithEntryInRange check(this, entry, maxSearchRange);
|
||||
Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInRange> searcher(this, gameobjectList, check);
|
||||
TypeContainerVisitor<Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInRange>, GridTypeMapContainer> visitor(searcher);
|
||||
acore::AllGameObjectsWithEntryInRange check(this, entry, maxSearchRange);
|
||||
acore::GameObjectListSearcher<acore::AllGameObjectsWithEntryInRange> searcher(this, gameobjectList, check);
|
||||
TypeContainerVisitor<acore::GameObjectListSearcher<acore::AllGameObjectsWithEntryInRange>, GridTypeMapContainer> visitor(searcher);
|
||||
|
||||
cell.Visit(pair, visitor, *(this->GetMap()), *this, maxSearchRange);
|
||||
}
|
||||
|
||||
void WorldObject::GetCreatureListWithEntryInGrid(std::list<Creature*>& creatureList, uint32 entry, float maxSearchRange) const
|
||||
{
|
||||
CellCoord pair(Trinity::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
CellCoord pair(acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::AllCreaturesOfEntryInRange check(this, entry, maxSearchRange);
|
||||
Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher);
|
||||
acore::AllCreaturesOfEntryInRange check(this, entry, maxSearchRange);
|
||||
acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher);
|
||||
|
||||
cell.Visit(pair, visitor, *(this->GetMap()), *this, maxSearchRange);
|
||||
}
|
||||
|
||||
/*
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
class NearUsedPosDo
|
||||
{
|
||||
|
|
@ -2501,7 +2501,7 @@ namespace Trinity
|
|||
float i_angle;
|
||||
ObjectPosSelector& i_selector;
|
||||
};
|
||||
} // namespace Trinity
|
||||
} // namespace acore
|
||||
*/
|
||||
|
||||
//===================================================================================================
|
||||
|
|
@ -2511,8 +2511,8 @@ void WorldObject::GetNearPoint2D(float &x, float &y, float distance2d, float abs
|
|||
x = GetPositionX() + (GetObjectSize() + distance2d) * cos(absAngle);
|
||||
y = GetPositionY() + (GetObjectSize() + distance2d) * sin(absAngle);
|
||||
|
||||
Trinity::NormalizeMapCoord(x);
|
||||
Trinity::NormalizeMapCoord(y);
|
||||
acore::NormalizeMapCoord(x);
|
||||
acore::NormalizeMapCoord(y);
|
||||
}
|
||||
|
||||
void WorldObject::GetNearPoint(WorldObject const* searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle) const
|
||||
|
|
@ -2619,7 +2619,7 @@ void WorldObject::MovePosition(Position &pos, float dist, float angle)
|
|||
desty = pos.m_positionY + dist * sin(angle);
|
||||
|
||||
// Prevent invalid coordinates here, position is unchanged
|
||||
if (!Trinity::IsValidMapCoord(destx, desty))
|
||||
if (!acore::IsValidMapCoord(destx, desty))
|
||||
{
|
||||
sLog->outCrash("WorldObject::MovePosition invalid coordinates X: %f and Y: %f were passed!", destx, desty);
|
||||
return;
|
||||
|
|
@ -2649,8 +2649,8 @@ void WorldObject::MovePosition(Position &pos, float dist, float angle)
|
|||
|
||||
pos.Relocate(destx, desty, destz);
|
||||
|
||||
Trinity::NormalizeMapCoord(pos.m_positionX);
|
||||
Trinity::NormalizeMapCoord(pos.m_positionY);
|
||||
acore::NormalizeMapCoord(pos.m_positionX);
|
||||
acore::NormalizeMapCoord(pos.m_positionY);
|
||||
UpdateGroundPositionZ(pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
pos.m_orientation = m_orientation;
|
||||
}
|
||||
|
|
@ -2666,7 +2666,7 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float
|
|||
destz += 2.0f;
|
||||
|
||||
// Prevent invalid coordinates here, position is unchanged
|
||||
if (!Trinity::IsValidMapCoord(destx, desty))
|
||||
if (!acore::IsValidMapCoord(destx, desty))
|
||||
{
|
||||
sLog->outCrash("WorldObject::MovePositionToFirstCollision invalid coordinates X: %f and Y: %f were passed!", destx, desty);
|
||||
return;
|
||||
|
|
@ -2731,8 +2731,8 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float
|
|||
break;
|
||||
}
|
||||
|
||||
Trinity::NormalizeMapCoord(destx);
|
||||
Trinity::NormalizeMapCoord(desty);
|
||||
acore::NormalizeMapCoord(destx);
|
||||
acore::NormalizeMapCoord(desty);
|
||||
UpdateAllowedPositionZ(destx, desty, destz);
|
||||
|
||||
float ground = GetMap()->GetHeight(GetPhaseMask(), destx, desty, MAX_HEIGHT, true);
|
||||
|
|
@ -2766,7 +2766,7 @@ void WorldObject::MovePositionToFirstCollisionForTotem(Position &pos, float dist
|
|||
destz = pos.GetPositionZ();
|
||||
|
||||
// Prevent invalid coordinates here, position is unchanged
|
||||
if (!Trinity::IsValidMapCoord(destx, desty))
|
||||
if (!acore::IsValidMapCoord(destx, desty))
|
||||
{
|
||||
sLog->outCrash("WorldObject::MovePositionToFirstCollision invalid coordinates X: %f and Y: %f were passed!", destx, desty);
|
||||
return;
|
||||
|
|
@ -2842,8 +2842,8 @@ void WorldObject::MovePositionToFirstCollisionForTotem(Position &pos, float dist
|
|||
destz = prevdz;
|
||||
}
|
||||
|
||||
Trinity::NormalizeMapCoord(destx);
|
||||
Trinity::NormalizeMapCoord(desty);
|
||||
acore::NormalizeMapCoord(destx);
|
||||
acore::NormalizeMapCoord(desty);
|
||||
|
||||
pos.Relocate(destx, desty, destz);
|
||||
pos.m_orientation = m_orientation;
|
||||
|
|
@ -2884,8 +2884,8 @@ void WorldObject::DestroyForNearbyPlayers()
|
|||
return;
|
||||
|
||||
std::list<Player*> targets;
|
||||
Trinity::AnyPlayerInObjectRangeCheck check(this, GetVisibilityRange()+VISIBILITY_COMPENSATION, false);
|
||||
Trinity::PlayerListSearcherWithSharedVision<Trinity::AnyPlayerInObjectRangeCheck> searcher(this, targets, check);
|
||||
acore::AnyPlayerInObjectRangeCheck check(this, GetVisibilityRange()+VISIBILITY_COMPENSATION, false);
|
||||
acore::PlayerListSearcherWithSharedVision<acore::AnyPlayerInObjectRangeCheck> searcher(this, targets, check);
|
||||
VisitNearbyWorldObject(GetVisibilityRange()+VISIBILITY_COMPENSATION, searcher);
|
||||
for (std::list<Player*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter)
|
||||
{
|
||||
|
|
@ -2908,7 +2908,7 @@ void WorldObject::DestroyForNearbyPlayers()
|
|||
void WorldObject::UpdateObjectVisibility(bool /*forced*/, bool /*fromUpdate*/)
|
||||
{
|
||||
//updates object's visibility for nearby players
|
||||
Trinity::VisibleChangesNotifier notifier(*this);
|
||||
acore::VisibleChangesNotifier notifier(*this);
|
||||
VisitNearbyWorldObject(GetVisibilityRange()+VISIBILITY_COMPENSATION, notifier);
|
||||
}
|
||||
|
||||
|
|
@ -3013,7 +3013,7 @@ struct WorldObjectChangeAccumulator
|
|||
|
||||
void WorldObject::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet& player_set)
|
||||
{
|
||||
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
WorldObjectChangeAccumulator notifier(*this, data_map, player_set);
|
||||
|
|
@ -3027,17 +3027,17 @@ void WorldObject::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet& play
|
|||
|
||||
void WorldObject::GetCreaturesWithEntryInRange(std::list<Creature*> &creatureList, float radius, uint32 entry)
|
||||
{
|
||||
CellCoord pair(Trinity::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
CellCoord pair(acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::AllCreaturesOfEntryInRange check(this, entry, radius);
|
||||
Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
acore::AllCreaturesOfEntryInRange check(this, entry, radius);
|
||||
acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, WorldTypeMapContainer> world_visitor(searcher);
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, WorldTypeMapContainer> world_visitor(searcher);
|
||||
cell.Visit(pair, world_visitor, *(this->GetMap()), *this, radius);
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> grid_visitor(searcher);
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> grid_visitor(searcher);
|
||||
cell.Visit(pair, grid_visitor, *(this->GetMap()), *this, radius);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1059,7 +1059,7 @@ class WorldObject : public Object, public WorldLocation
|
|||
bool CanDetectStealthOf(WorldObject const* obj, bool checkAlert = false) const;
|
||||
};
|
||||
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
// Binary predicate to sort WorldObjects based on the distance to a reference WorldObject
|
||||
class ObjectDistanceOrderPred
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_OBJECTDEFINES_H
|
||||
#define TRINITY_OBJECTDEFINES_H
|
||||
#ifndef ACORE_OBJECTDEFINES_H
|
||||
#define ACORE_OBJECTDEFINES_H
|
||||
|
||||
#include "Define.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -482,7 +482,7 @@ inline void KillRewarder::_InitGroupData()
|
|||
_maxLevel = lvl;
|
||||
// 2.4. _maxNotGrayMember - maximum level of alive group member within reward distance,
|
||||
// for whom victim is not gray;
|
||||
uint32 grayLevel = Trinity::XP::GetGrayLevel(lvl);
|
||||
uint32 grayLevel = acore::XP::GetGrayLevel(lvl);
|
||||
if (_victim->getLevel() > grayLevel && (!_maxNotGrayMember || _maxNotGrayMember->getLevel() < lvl))
|
||||
_maxNotGrayMember = member;
|
||||
}
|
||||
|
|
@ -502,7 +502,7 @@ inline void KillRewarder::_InitXP(Player* player)
|
|||
// * otherwise, not in PvP;
|
||||
// * not if killer is on vehicle.
|
||||
if (_isBattleGround || (!_isPvP && !_killer->GetVehicle()))
|
||||
_xp = Trinity::XP::Gain(player, _victim, _isBattleGround);
|
||||
_xp = acore::XP::Gain(player, _victim, _isBattleGround);
|
||||
|
||||
if (_xp && !_isBattleGround && _victim) // pussywizard: npcs with relatively low hp give lower exp
|
||||
if (_victim->GetTypeId() == TYPEID_UNIT)
|
||||
|
|
@ -615,7 +615,7 @@ void KillRewarder::_RewardGroup()
|
|||
{
|
||||
// 3.1.2. Alter group rate if group is in raid (not for battlegrounds).
|
||||
const bool isRaid = !_isPvP && sMapStore.LookupEntry(_killer->GetMapId())->IsRaid() && _group->isRaidGroup();
|
||||
_groupRate = Trinity::XP::xp_in_group_rate(_count, isRaid);
|
||||
_groupRate = acore::XP::xp_in_group_rate(_count, isRaid);
|
||||
}
|
||||
|
||||
// 3.1.3. Reward each group member (even dead or corpse) within reward distance.
|
||||
|
|
@ -5697,7 +5697,7 @@ void Player::UpdateLocalChannels(uint32 newZone)
|
|||
{
|
||||
// pussywizard: mutex needed (tc changed opcode to THREAD UNSAFE)
|
||||
static ACE_Thread_Mutex channelsLock;
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, channelsLock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, channelsLock);
|
||||
|
||||
if (GetSession()->PlayerLoading() && !IsBeingTeleportedFar())
|
||||
return; // The client handles it automatically after loading, but not after teleporting
|
||||
|
|
@ -5742,7 +5742,7 @@ void Player::UpdateLocalChannels(uint32 newZone)
|
|||
char const* currentNameExt;
|
||||
|
||||
if (channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY)
|
||||
currentNameExt = sObjectMgr->GetTrinityStringForDBCLocale(LANG_CHANNEL_CITY);
|
||||
currentNameExt = sObjectMgr->GetAcoreStringForDBCLocale(LANG_CHANNEL_CITY);
|
||||
else
|
||||
currentNameExt = current_zone_name.c_str();
|
||||
|
||||
|
|
@ -6387,7 +6387,7 @@ void Player::UpdateWeaponSkill(WeaponAttackType attType)
|
|||
void Player::UpdateCombatSkills(Unit* victim, WeaponAttackType attType, bool defence)
|
||||
{
|
||||
uint8 plevel = getLevel(); // if defense than victim == attacker
|
||||
uint8 greylevel = Trinity::XP::GetGrayLevel(plevel);
|
||||
uint8 greylevel = acore::XP::GetGrayLevel(plevel);
|
||||
uint8 moblevel = victim->getLevelForTarget(this);
|
||||
/*if (moblevel < greylevel)
|
||||
return;*/ // Patch 3.0.8 (2009-01-20): You can no longer skill up weapons on mobs that are immune to damage.
|
||||
|
|
@ -6883,7 +6883,7 @@ void Player::SendMessageToSetInRange(WorldPacket* data, float dist, bool self, b
|
|||
dist += GetObjectSize();
|
||||
if (includeMargin)
|
||||
dist += VISIBILITY_COMPENSATION; // pussywizard: to ensure everyone receives all important packets
|
||||
Trinity::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
VisitNearbyWorldObject(dist, notifier);
|
||||
}
|
||||
|
||||
|
|
@ -6893,7 +6893,7 @@ void Player::SendMessageToSetInRange_OwnTeam(WorldPacket* data, float dist, bool
|
|||
if (self)
|
||||
GetSession()->SendPacket(data);
|
||||
|
||||
Trinity::MessageDistDeliverer notifier(this, data, dist, true);
|
||||
acore::MessageDistDeliverer notifier(this, data, dist, true);
|
||||
VisitNearbyWorldObject(dist, notifier);
|
||||
}
|
||||
|
||||
|
|
@ -7067,7 +7067,7 @@ int32 Player::CalculateReputationGain(ReputationSource source, uint32 creatureOr
|
|||
break;
|
||||
}
|
||||
|
||||
if (rate != 1.0f && creatureOrQuestLevel <= Trinity::XP::GetGrayLevel(getLevel()))
|
||||
if (rate != 1.0f && creatureOrQuestLevel <= acore::XP::GetGrayLevel(getLevel()))
|
||||
percent *= rate;
|
||||
|
||||
if (percent <= 0.0f)
|
||||
|
|
@ -7299,7 +7299,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
|||
return false;
|
||||
|
||||
uint8 k_level = getLevel();
|
||||
uint8 k_grey = Trinity::XP::GetGrayLevel(k_level);
|
||||
uint8 k_grey = acore::XP::GetGrayLevel(k_level);
|
||||
uint8 v_level = victim->getLevel();
|
||||
|
||||
if (v_level <= k_grey)
|
||||
|
|
@ -7326,7 +7326,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
|||
else
|
||||
victim_guid = 0; // Don't show HK: <rank> message, only log.
|
||||
|
||||
honor_f = ceil(Trinity::Honor::hk_honor_at_level_f(k_level) * (v_level - k_grey) / (k_level - k_grey));
|
||||
honor_f = ceil(acore::Honor::hk_honor_at_level_f(k_level) * (v_level - k_grey) / (k_level - k_grey));
|
||||
|
||||
// count the number of playerkills in one day
|
||||
ApplyModUInt32Value(PLAYER_FIELD_KILLS, 1, true);
|
||||
|
|
@ -14112,7 +14112,7 @@ void Player::TradeCancel(bool sendback)
|
|||
|
||||
void Player::UpdateSoulboundTradeItems()
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, m_soulboundTradableLock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, m_soulboundTradableLock);
|
||||
if (m_itemSoulboundTradeable.empty())
|
||||
return;
|
||||
|
||||
|
|
@ -14136,14 +14136,14 @@ void Player::UpdateSoulboundTradeItems()
|
|||
|
||||
void Player::AddTradeableItem(Item* item)
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, m_soulboundTradableLock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, m_soulboundTradableLock);
|
||||
m_itemSoulboundTradeable.push_back(item);
|
||||
}
|
||||
|
||||
//TODO: should never allow an item to be added to m_itemSoulboundTradeable twice
|
||||
void Player::RemoveTradeableItem(Item* item)
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, m_soulboundTradableLock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, m_soulboundTradableLock);
|
||||
m_itemSoulboundTradeable.remove(item);
|
||||
}
|
||||
|
||||
|
|
@ -14991,7 +14991,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
|
|||
}
|
||||
|
||||
if (sWorld->getIntConfig(CONFIG_INSTANT_TAXI) == 2 && npcflags & UNIT_NPC_FLAG_FLIGHTMASTER)
|
||||
menu->GetGossipMenu().AddMenuItem(-1, GOSSIP_ICON_INTERACT_1, GetSession()->GetTrinityString(LANG_TOGGLE_INSTANT_FLIGHT), 0, GOSSIP_ACTION_TOGGLE_INSTANT_FLIGHT, "", 0, false); // instant flight toggle option
|
||||
menu->GetGossipMenu().AddMenuItem(-1, GOSSIP_ICON_INTERACT_1, GetSession()->GetAcoreString(LANG_TOGGLE_INSTANT_FLIGHT), 0, GOSSIP_ACTION_TOGGLE_INSTANT_FLIGHT, "", 0, false); // instant flight toggle option
|
||||
}
|
||||
|
||||
void Player::SendPreparedGossip(WorldObject* source)
|
||||
|
|
@ -18026,7 +18026,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
|||
m_movementInfo.transport.pos.Relocate(x, y, z, o);
|
||||
m_transport->CalculatePassengerPosition(x, y, z, &o);
|
||||
|
||||
if (!Trinity::IsValidMapCoord(x, y, z, o) || std::fabs(m_movementInfo.transport.pos.GetPositionX()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionY()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionZ()) > 75.0f)
|
||||
if (!acore::IsValidMapCoord(x, y, z, o) || std::fabs(m_movementInfo.transport.pos.GetPositionX()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionY()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionZ()) > 75.0f)
|
||||
{
|
||||
m_transport = NULL;
|
||||
m_movementInfo.transport.Reset();
|
||||
|
|
@ -18757,7 +18757,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
|
|||
// Send problematic items by mail
|
||||
while (!problematicItems.empty())
|
||||
{
|
||||
std::string subject = GetSession()->GetTrinityString(LANG_NOT_EQUIPPED_ITEM);
|
||||
std::string subject = GetSession()->GetAcoreString(LANG_NOT_EQUIPPED_ITEM);
|
||||
|
||||
MailDraft draft(subject, "There were problems with equipping item(s).");
|
||||
for (uint8 i = 0; !problematicItems.empty() && i < MAX_MAIL_ITEMS; ++i)
|
||||
|
|
@ -19543,7 +19543,7 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report
|
|||
|
||||
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_MAP, target_map, this))
|
||||
{
|
||||
GetSession()->SendAreaTriggerMessage("%s", GetSession()->GetTrinityString(LANG_INSTANCE_CLOSED));
|
||||
GetSession()->SendAreaTriggerMessage("%s", GetSession()->GetAcoreString(LANG_INSTANCE_CLOSED));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -19574,9 +19574,9 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report
|
|||
else if (mapDiff->hasErrorMessage) // if (missingAchievement) covered by this case
|
||||
SendTransferAborted(target_map, TRANSFER_ABORT_DIFFICULTY, target_difficulty);
|
||||
else if (missingItem)
|
||||
GetSession()->SendAreaTriggerMessage(GetSession()->GetTrinityString(LANG_LEVEL_MINREQUIRED_AND_ITEM), LevelMin, sObjectMgr->GetItemTemplate(missingItem)->Name1.c_str());
|
||||
GetSession()->SendAreaTriggerMessage(GetSession()->GetAcoreString(LANG_LEVEL_MINREQUIRED_AND_ITEM), LevelMin, sObjectMgr->GetItemTemplate(missingItem)->Name1.c_str());
|
||||
else if (LevelMin)
|
||||
GetSession()->SendAreaTriggerMessage(GetSession()->GetTrinityString(LANG_LEVEL_MINREQUIRED), LevelMin);
|
||||
GetSession()->SendAreaTriggerMessage(GetSession()->GetAcoreString(LANG_LEVEL_MINREQUIRED), LevelMin);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -20949,8 +20949,8 @@ void Player::TextEmote(const std::string& text)
|
|||
|
||||
WorldPacket data;
|
||||
std::list<Player*> players;
|
||||
Trinity::AnyPlayerInObjectRangeCheck checker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
|
||||
Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(this, players, checker);
|
||||
acore::AnyPlayerInObjectRangeCheck checker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
|
||||
acore::PlayerListSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(this, players, checker);
|
||||
this->VisitNearbyWorldObject(sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), searcher);
|
||||
|
||||
for (auto const& itr : players)
|
||||
|
|
@ -23040,10 +23040,10 @@ void Player::UpdateObjectVisibility(bool forced, bool fromUpdate)
|
|||
|
||||
void Player::UpdateVisibilityForPlayer(bool mapChange)
|
||||
{
|
||||
Trinity::VisibleNotifier notifierNoLarge(*this, mapChange, false); // visit only objects which are not large; default distance
|
||||
acore::VisibleNotifier notifierNoLarge(*this, mapChange, false); // visit only objects which are not large; default distance
|
||||
m_seer->VisitNearbyObject(GetSightRange()+VISIBILITY_INC_FOR_GOBJECTS, notifierNoLarge);
|
||||
notifierNoLarge.SendToSelf();
|
||||
Trinity::VisibleNotifier notifierLarge(*this, mapChange, true); // visit only large objects; maximum distance
|
||||
acore::VisibleNotifier notifierLarge(*this, mapChange, true); // visit only large objects; maximum distance
|
||||
m_seer->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, notifierLarge);
|
||||
notifierLarge.SendToSelf();
|
||||
|
||||
|
|
@ -23926,7 +23926,7 @@ void Player::AutoUnequipOffhandIfNeed(bool force /*= false*/)
|
|||
offItem->DeleteFromInventoryDB(trans); // deletes item from character's inventory
|
||||
offItem->SaveToDB(trans); // recursive and not have transaction guard into self, item not in inventory and can be save standalone
|
||||
|
||||
std::string subject = GetSession()->GetTrinityString(LANG_NOT_EQUIPPED_ITEM);
|
||||
std::string subject = GetSession()->GetAcoreString(LANG_NOT_EQUIPPED_ITEM);
|
||||
MailDraft(subject, "There were problems with equipping one or several items").AddItem(offItem).SendMailTo(trans, this, MailSender(this, MAIL_STATIONERY_GM), MAIL_CHECK_MASK_COPIED);
|
||||
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
|
|
@ -24079,7 +24079,7 @@ uint32 Player::GetResurrectionSpellId()
|
|||
bool Player::isHonorOrXPTarget(Unit* victim) const
|
||||
{
|
||||
uint8 v_level = victim->getLevel();
|
||||
uint8 k_grey = Trinity::XP::GetGrayLevel(getLevel());
|
||||
uint8 k_grey = acore::XP::GetGrayLevel(getLevel());
|
||||
|
||||
// Victim level less gray level
|
||||
if (v_level <= k_grey)
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef __TRINITY_SOCIALMGR_H
|
||||
#define __TRINITY_SOCIALMGR_H
|
||||
#ifndef __ACORE_SOCIALMGR_H
|
||||
#define __ACORE_SOCIALMGR_H
|
||||
|
||||
#include <ace/Singleton.h>
|
||||
#include "DatabaseEnv.h"
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ void MotionTransport::UpdatePosition(float x, float y, float z, float o)
|
|||
|
||||
void MotionTransport::AddPassenger(WorldObject* passenger, bool withAll)
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, Lock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, Lock);
|
||||
if (_passengers.insert(passenger).second)
|
||||
{
|
||||
if (Player* plr = passenger->ToPlayer())
|
||||
|
|
@ -275,7 +275,7 @@ void MotionTransport::AddPassenger(WorldObject* passenger, bool withAll)
|
|||
|
||||
void MotionTransport::RemovePassenger(WorldObject* passenger, bool withAll)
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, Lock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, Lock);
|
||||
if (_passengers.erase(passenger) || _staticPassengers.erase(passenger))
|
||||
{
|
||||
if (Player* plr = passenger->ToPlayer())
|
||||
|
|
@ -599,7 +599,7 @@ void MotionTransport::UpdatePassengerPositions(PassengerSet& passengers)
|
|||
CalculatePassengerPosition(x, y, z, &o);
|
||||
|
||||
// check if position is valid
|
||||
if (!Trinity::IsValidMapCoord(x, y, z))
|
||||
if (!acore::IsValidMapCoord(x, y, z))
|
||||
continue;
|
||||
|
||||
switch (passenger->GetTypeId())
|
||||
|
|
@ -865,7 +865,7 @@ void StaticTransport::RelocateToProgress(uint32 progress)
|
|||
float oriRotAngle = oriRotAngleCurr + percRot * (oriRotAngleNext - oriRotAngleCurr);
|
||||
|
||||
// check if position is valid
|
||||
if (!Trinity::IsValidMapCoord(pos.x, pos.y, pos.z))
|
||||
if (!acore::IsValidMapCoord(pos.x, pos.y, pos.z))
|
||||
return;
|
||||
|
||||
// update position to new one
|
||||
|
|
@ -900,7 +900,7 @@ void StaticTransport::UpdatePassengerPositions()
|
|||
CalculatePassengerPosition(x, y, z, &o);
|
||||
|
||||
// check if position is valid
|
||||
if (!Trinity::IsValidMapCoord(x, y, z))
|
||||
if (!acore::IsValidMapCoord(x, y, z))
|
||||
continue;
|
||||
|
||||
switch (passenger->GetTypeId())
|
||||
|
|
|
|||
|
|
@ -1835,7 +1835,7 @@ void Unit::CalcAbsorbResist(Unit* attacker, Unit* victim, SpellSchoolMask school
|
|||
// We're going to call functions which can modify content of the list during iteration over it's elements
|
||||
// Let's copy the list so we can prevent iterator invalidation
|
||||
AuraEffectList vSchoolAbsorbCopy(victim->GetAuraEffectsByType(SPELL_AURA_SCHOOL_ABSORB));
|
||||
vSchoolAbsorbCopy.sort(Trinity::AbsorbAuraOrderPred());
|
||||
vSchoolAbsorbCopy.sort(acore::AbsorbAuraOrderPred());
|
||||
|
||||
// absorb without mana cost
|
||||
for (AuraEffectList::iterator itr = vSchoolAbsorbCopy.begin(); (itr != vSchoolAbsorbCopy.end()) && (dmgInfo.GetDamage() > 0); ++itr)
|
||||
|
|
@ -15672,8 +15672,8 @@ void Unit::UpdateReactives(uint32 p_time)
|
|||
Unit* Unit::SelectNearbyTarget(Unit* exclude, float dist) const
|
||||
{
|
||||
std::list<Unit*> targets;
|
||||
Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
acore::UnitListSearcher<acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
VisitNearbyObject(dist, searcher);
|
||||
|
||||
// remove current target
|
||||
|
|
@ -15701,14 +15701,14 @@ Unit* Unit::SelectNearbyTarget(Unit* exclude, float dist) const
|
|||
return NULL;
|
||||
|
||||
// select random
|
||||
return Trinity::Containers::SelectRandomContainerElement(targets);
|
||||
return acore::Containers::SelectRandomContainerElement(targets);
|
||||
}
|
||||
|
||||
Unit* Unit::SelectNearbyNoTotemTarget(Unit* exclude, float dist) const
|
||||
{
|
||||
std::list<Unit*> targets;
|
||||
Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
Trinity::UnitListSearcher<Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
acore::UnitListSearcher<acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
VisitNearbyObject(dist, searcher);
|
||||
|
||||
// remove current target
|
||||
|
|
@ -15736,7 +15736,7 @@ Unit* Unit::SelectNearbyNoTotemTarget(Unit* exclude, float dist) const
|
|||
return NULL;
|
||||
|
||||
// select random
|
||||
return Trinity::Containers::SelectRandomContainerElement(targets);
|
||||
return acore::Containers::SelectRandomContainerElement(targets);
|
||||
}
|
||||
|
||||
void Unit::ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
|
||||
|
|
@ -16282,7 +16282,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura)
|
|||
|
||||
if (!nearMembers.empty())
|
||||
{
|
||||
nearMembers.sort(Trinity::HealthPctOrderPred());
|
||||
nearMembers.sort(acore::HealthPctOrderPred());
|
||||
if (Unit* target = nearMembers.front())
|
||||
{
|
||||
CastSpell(target, 41637 /*Dummy visual effect triggered by main spell cast*/, true);
|
||||
|
|
@ -17706,7 +17706,7 @@ void Unit::UpdateObjectVisibility(bool forced, bool /*fromUpdate*/)
|
|||
// pussywizard: generally this is not needed here, delayed notifier will handle this, call only for pets
|
||||
if ((IsGuardian() || IsPet()) && IS_PLAYER_GUID(GetOwnerGUID()))
|
||||
{
|
||||
Trinity::AIRelocationNotifier notifier(*this);
|
||||
acore::AIRelocationNotifier notifier(*this);
|
||||
float radius = 60.0f;
|
||||
VisitNearbyObject(radius, notifier);
|
||||
}
|
||||
|
|
@ -18517,7 +18517,7 @@ void Unit::SendTeleportPacket(Position& pos)
|
|||
|
||||
bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool teleport)
|
||||
{
|
||||
if (!Trinity::IsValidMapCoord(x, y, z, orientation))
|
||||
if (!acore::IsValidMapCoord(x, y, z, orientation))
|
||||
return false;
|
||||
|
||||
float old_orientation = GetOrientation();
|
||||
|
|
@ -19040,10 +19040,10 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
|||
//active->m_last_notify_position.Relocate(active->GetPositionX(), active->GetPositionY(), active->GetPositionZ());
|
||||
}
|
||||
|
||||
Trinity::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
viewPoint->VisitNearbyObject(player->GetSightRange()+VISIBILITY_INC_FOR_GOBJECTS, relocateNoLarge);
|
||||
relocateNoLarge.SendToSelf();
|
||||
Trinity::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
viewPoint->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, relocateLarge);
|
||||
relocateLarge.SendToSelf();
|
||||
}
|
||||
|
|
@ -19074,10 +19074,10 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
|||
active->m_last_notify_position.Relocate(active->GetPositionX(), active->GetPositionY(), active->GetPositionZ());
|
||||
}
|
||||
|
||||
Trinity::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
viewPoint->VisitNearbyObject(player->GetSightRange()+VISIBILITY_INC_FOR_GOBJECTS, relocateNoLarge);
|
||||
relocateNoLarge.SendToSelf();
|
||||
Trinity::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
viewPoint->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, relocateLarge);
|
||||
relocateLarge.SendToSelf();
|
||||
|
||||
|
|
@ -19098,7 +19098,7 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
|||
|
||||
unit->m_last_notify_position.Relocate(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ());
|
||||
|
||||
Trinity::CreatureRelocationNotifier relocate(*unit);
|
||||
acore::CreatureRelocationNotifier relocate(*unit);
|
||||
unit->VisitNearbyObject(unit->GetVisibilityRange()+VISIBILITY_COMPENSATION, relocate);
|
||||
|
||||
this->AddToNotify(NOTIFY_AI_RELOCATION);
|
||||
|
|
@ -19111,7 +19111,7 @@ void Unit::ExecuteDelayedUnitAINotifyEvent()
|
|||
if (!this->IsInWorld() || this->IsDuringRemoveFromWorld())
|
||||
return;
|
||||
|
||||
Trinity::AIRelocationNotifier notifier(*this);
|
||||
acore::AIRelocationNotifier notifier(*this);
|
||||
float radius = 60.0f;
|
||||
this->VisitNearbyObject(radius, notifier);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2564,7 +2564,7 @@ class Unit : public WorldObject
|
|||
bool m_petCatchUp;
|
||||
};
|
||||
|
||||
namespace Trinity
|
||||
namespace acore
|
||||
{
|
||||
// Binary predicate for sorting Units based on percent value of a power
|
||||
class PowerPctOrderPred
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef __TRINITY_VEHICLE_H
|
||||
#define __TRINITY_VEHICLE_H
|
||||
#ifndef __ACORE_VEHICLE_H
|
||||
#define __ACORE_VEHICLE_H
|
||||
|
||||
#include "ObjectDefines.h"
|
||||
#include "VehicleDefines.h"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef __TRINITY_VEHICLEDEFINES_H
|
||||
#define __TRINITY_VEHICLEDEFINES_H
|
||||
#ifndef __ACORE_VEHICLEDEFINES_H
|
||||
#define __ACORE_VEHICLEDEFINES_H
|
||||
|
||||
#include "Define.h"
|
||||
#include "Map.h"
|
||||
|
|
|
|||
|
|
@ -1709,14 +1709,14 @@ void GameEventMgr::RunSmartAIScripts(uint16 event_id, bool activate)
|
|||
//! Iterate over every supported source type (creature and gameobject)
|
||||
//! Not entirely sure how this will affect units in non-loaded grids.
|
||||
{
|
||||
TRINITY_READ_GUARD(HashMapHolder<Creature>::LockType, *HashMapHolder<Creature>::GetLock());
|
||||
ACORE_READ_GUARD(HashMapHolder<Creature>::LockType, *HashMapHolder<Creature>::GetLock());
|
||||
HashMapHolder<Creature>::MapType const& m = ObjectAccessor::GetCreatures();
|
||||
for (HashMapHolder<Creature>::MapType::const_iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if (iter->second->IsInWorld() && !iter->second->IsDuringRemoveFromWorld() && iter->second->FindMap() && iter->second->IsAIEnabled && iter->second->AI())
|
||||
iter->second->AI()->sOnGameEvent(activate, event_id);
|
||||
}
|
||||
{
|
||||
TRINITY_READ_GUARD(HashMapHolder<GameObject>::LockType, *HashMapHolder<GameObject>::GetLock());
|
||||
ACORE_READ_GUARD(HashMapHolder<GameObject>::LockType, *HashMapHolder<GameObject>::GetLock());
|
||||
HashMapHolder<GameObject>::MapType const& m = ObjectAccessor::GetGameObjects();
|
||||
for (HashMapHolder<GameObject>::MapType::const_iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if (iter->second->IsInWorld() && iter->second->FindMap() && iter->second->AI())
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_GAMEEVENT_MGR_H
|
||||
#define TRINITY_GAMEEVENT_MGR_H
|
||||
#ifndef ACORE_GAMEEVENT_MGR_H
|
||||
#define ACORE_GAMEEVENT_MGR_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "SharedDefines.h"
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ Unit* ObjectAccessor::FindUnit(uint64 guid)
|
|||
|
||||
Player* ObjectAccessor::FindPlayerByName(std::string const& name, bool checkInWorld)
|
||||
{
|
||||
/*TRINITY_READ_GUARD(HashMapHolder<Player>::LockType, *HashMapHolder<Player>::GetLock());
|
||||
/*ACORE_READ_GUARD(HashMapHolder<Player>::LockType, *HashMapHolder<Player>::GetLock());
|
||||
std::string nameStr = name;
|
||||
std::transform(nameStr.begin(), nameStr.end(), nameStr.begin(), ::tolower);
|
||||
HashMapHolder<Player>::MapType const& m = GetPlayers();
|
||||
|
|
@ -200,7 +200,7 @@ Player* ObjectAccessor::FindPlayerByName(std::string const& name, bool checkInWo
|
|||
|
||||
void ObjectAccessor::SaveAllPlayers()
|
||||
{
|
||||
TRINITY_READ_GUARD(HashMapHolder<Player>::LockType, *HashMapHolder<Player>::GetLock());
|
||||
ACORE_READ_GUARD(HashMapHolder<Player>::LockType, *HashMapHolder<Player>::GetLock());
|
||||
HashMapHolder<Player>::MapType const& m = GetPlayers();
|
||||
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
itr->second->SaveToDB(false, false);
|
||||
|
|
@ -208,7 +208,7 @@ void ObjectAccessor::SaveAllPlayers()
|
|||
|
||||
Corpse* ObjectAccessor::GetCorpseForPlayerGUID(uint64 guid)
|
||||
{
|
||||
TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
ACORE_READ_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
|
||||
Player2CorpsesMapType::iterator iter = i_player2corpse.find(guid);
|
||||
if (iter == i_player2corpse.end())
|
||||
|
|
@ -225,7 +225,7 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse, bool final)
|
|||
|
||||
if (!final)
|
||||
{
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
Player2CorpsesMapType::iterator iter = i_player2corpse.find(corpse->GetOwnerGUID());
|
||||
if (iter == i_player2corpse.end())
|
||||
return;
|
||||
|
|
@ -252,10 +252,10 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse, bool final)
|
|||
|
||||
// Critical section
|
||||
{
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
|
||||
// build mapid*cellid -> guid_set map
|
||||
CellCoord cellCoord = Trinity::ComputeCellCoord(corpse->GetPositionX(), corpse->GetPositionY());
|
||||
CellCoord cellCoord = acore::ComputeCellCoord(corpse->GetPositionX(), corpse->GetPositionY());
|
||||
sObjectMgr->DeleteCorpseCellData(corpse->GetMapId(), cellCoord.GetId(), GUID_LOPART(corpse->GetOwnerGUID()));
|
||||
}
|
||||
|
||||
|
|
@ -268,20 +268,20 @@ void ObjectAccessor::AddCorpse(Corpse* corpse)
|
|||
|
||||
// Critical section
|
||||
{
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
|
||||
ASSERT(i_player2corpse.find(corpse->GetOwnerGUID()) == i_player2corpse.end());
|
||||
i_player2corpse[corpse->GetOwnerGUID()] = corpse;
|
||||
|
||||
// build mapid*cellid -> guid_set map
|
||||
CellCoord cellCoord = Trinity::ComputeCellCoord(corpse->GetPositionX(), corpse->GetPositionY());
|
||||
CellCoord cellCoord = acore::ComputeCellCoord(corpse->GetPositionX(), corpse->GetPositionY());
|
||||
sObjectMgr->AddCorpseCellData(corpse->GetMapId(), cellCoord.GetId(), GUID_LOPART(corpse->GetOwnerGUID()), corpse->GetInstanceId());
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectAccessor::AddCorpsesToGrid(GridCoord const& gridpair, GridType& grid, Map* map)
|
||||
{
|
||||
TRINITY_READ_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
ACORE_READ_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
|
||||
for (Player2CorpsesMapType::iterator iter = i_player2corpse.begin(); iter != i_player2corpse.end(); ++iter)
|
||||
{
|
||||
|
|
@ -369,7 +369,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
|
|||
}
|
||||
|
||||
// pussywizard: for deleting bones
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
i_playerBones.push_back(bones->GetGUID());
|
||||
}
|
||||
|
||||
|
|
@ -396,7 +396,7 @@ void ObjectAccessor::RemoveOldCorpses()
|
|||
|
||||
// pussywizard: for deleting bones
|
||||
std::list<uint64>::iterator next2;
|
||||
TRINITY_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, i_corpseLock);
|
||||
for (std::list<uint64>::iterator itr = i_playerBones.begin(); itr != i_playerBones.end(); itr = next2)
|
||||
{
|
||||
next2 = itr;
|
||||
|
|
@ -429,13 +429,13 @@ void ObjectAccessor::RemoveOldCorpses()
|
|||
|
||||
void ObjectAccessor::AddDelayedCorpseAction(Corpse* corpse, uint8 action, uint32 mapId, uint32 instanceId)
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, DelayedCorpseLock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, DelayedCorpseLock);
|
||||
i_delayedCorpseActions.push_back(DelayedCorpseAction(corpse, action, mapId, instanceId));
|
||||
}
|
||||
|
||||
void ObjectAccessor::ProcessDelayedCorpseActions()
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, DelayedCorpseLock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, DelayedCorpseLock);
|
||||
for (std::list<DelayedCorpseAction>::iterator itr = i_delayedCorpseActions.begin(); itr != i_delayedCorpseActions.end(); ++itr)
|
||||
{
|
||||
DelayedCorpseAction a = (*itr);
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_OBJECTACCESSOR_H
|
||||
#define TRINITY_OBJECTACCESSOR_H
|
||||
#ifndef ACORE_OBJECTACCESSOR_H
|
||||
#define ACORE_OBJECTACCESSOR_H
|
||||
|
||||
#include "Define.h"
|
||||
#include "UpdateData.h"
|
||||
|
|
@ -39,19 +39,19 @@ class HashMapHolder
|
|||
|
||||
static void Insert(T* o)
|
||||
{
|
||||
TRINITY_WRITE_GUARD(LockType, i_lock);
|
||||
ACORE_WRITE_GUARD(LockType, i_lock);
|
||||
m_objectMap[o->GetGUID()] = o;
|
||||
}
|
||||
|
||||
static void Remove(T* o)
|
||||
{
|
||||
TRINITY_WRITE_GUARD(LockType, i_lock);
|
||||
ACORE_WRITE_GUARD(LockType, i_lock);
|
||||
m_objectMap.erase(o->GetGUID());
|
||||
}
|
||||
|
||||
static T* Find(uint64 guid)
|
||||
{
|
||||
TRINITY_READ_GUARD(LockType, i_lock);
|
||||
ACORE_READ_GUARD(LockType, i_lock);
|
||||
typename MapType::iterator itr = m_objectMap.find(guid);
|
||||
return (itr != m_objectMap.end()) ? itr->second : NULL;
|
||||
}
|
||||
|
|
@ -149,14 +149,14 @@ class ObjectAccessor
|
|||
if (!obj || obj->GetMapId() != mapid)
|
||||
return NULL;
|
||||
|
||||
CellCoord p = Trinity::ComputeCellCoord(x, y);
|
||||
CellCoord p = acore::ComputeCellCoord(x, y);
|
||||
if (!p.IsCoordValid())
|
||||
{
|
||||
sLog->outError("ObjectAccessor::GetObjectInWorld: invalid coordinates supplied X:%f Y:%f grid cell [%u:%u]", x, y, p.x_coord, p.y_coord);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CellCoord q = Trinity::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
|
||||
CellCoord q = acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
|
||||
if (!q.IsCoordValid())
|
||||
{
|
||||
sLog->outError("ObjectAccessor::GetObjecInWorld: object (GUID: %u TypeId: %u) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUIDLow(), obj->GetTypeId(), obj->GetPositionX(), obj->GetPositionY(), q.x_coord, q.y_coord);
|
||||
|
|
@ -227,7 +227,7 @@ class ObjectAccessor
|
|||
//non-static functions
|
||||
void AddUpdateObject(Object* obj)
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, i_objectLock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, i_objectLock);
|
||||
if (obj->GetTypeId() < TYPEID_UNIT) // these are not in map: TYPEID_OBJECT, TYPEID_ITEM, TYPEID_CONTAINER
|
||||
i_objects.insert(obj);
|
||||
else
|
||||
|
|
@ -236,7 +236,7 @@ class ObjectAccessor
|
|||
|
||||
void RemoveUpdateObject(Object* obj)
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, i_objectLock);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, i_objectLock);
|
||||
if (obj->GetTypeId() < TYPEID_UNIT) // these are not in map: TYPEID_OBJECT, TYPEID_ITEM, TYPEID_CONTAINER
|
||||
i_objects.erase(obj);
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1807,7 +1807,7 @@ void ObjectMgr::AddCreatureToGrid(uint32 guid, CreatureData const* data)
|
|||
{
|
||||
if (mask & 1)
|
||||
{
|
||||
CellCoord cellCoord = Trinity::ComputeCellCoord(data->posX, data->posY);
|
||||
CellCoord cellCoord = acore::ComputeCellCoord(data->posX, data->posY);
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()];
|
||||
cell_guids.creatures.insert(guid);
|
||||
}
|
||||
|
|
@ -1821,7 +1821,7 @@ void ObjectMgr::RemoveCreatureFromGrid(uint32 guid, CreatureData const* data)
|
|||
{
|
||||
if (mask & 1)
|
||||
{
|
||||
CellCoord cellCoord = Trinity::ComputeCellCoord(data->posX, data->posY);
|
||||
CellCoord cellCoord = acore::ComputeCellCoord(data->posX, data->posY);
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()];
|
||||
cell_guids.creatures.erase(guid);
|
||||
}
|
||||
|
|
@ -2140,7 +2140,7 @@ void ObjectMgr::AddGameobjectToGrid(uint32 guid, GameObjectData const* data)
|
|||
{
|
||||
if (mask & 1)
|
||||
{
|
||||
CellCoord cellCoord = Trinity::ComputeCellCoord(data->posX, data->posY);
|
||||
CellCoord cellCoord = acore::ComputeCellCoord(data->posX, data->posY);
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()];
|
||||
cell_guids.gameobjects.insert(guid);
|
||||
}
|
||||
|
|
@ -2154,7 +2154,7 @@ void ObjectMgr::RemoveGameobjectFromGrid(uint32 guid, GameObjectData const* data
|
|||
{
|
||||
if (mask & 1)
|
||||
{
|
||||
CellCoord cellCoord = Trinity::ComputeCellCoord(data->posX, data->posY);
|
||||
CellCoord cellCoord = acore::ComputeCellCoord(data->posX, data->posY);
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()];
|
||||
cell_guids.gameobjects.erase(guid);
|
||||
}
|
||||
|
|
@ -4701,7 +4701,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!Trinity::IsValidMapCoord(tmp.TeleportTo.DestX, tmp.TeleportTo.DestY, tmp.TeleportTo.DestZ, tmp.TeleportTo.Orientation))
|
||||
if (!acore::IsValidMapCoord(tmp.TeleportTo.DestX, tmp.TeleportTo.DestY, tmp.TeleportTo.DestZ, tmp.TeleportTo.Orientation))
|
||||
{
|
||||
sLog->outErrorDb("Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TELEPORT_TO for script id %u",
|
||||
tableName.c_str(), tmp.TeleportTo.DestX, tmp.TeleportTo.DestY, tmp.TeleportTo.DestZ, tmp.TeleportTo.Orientation, tmp.id);
|
||||
|
|
@ -4799,7 +4799,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
|
|||
|
||||
case SCRIPT_COMMAND_TEMP_SUMMON_CREATURE:
|
||||
{
|
||||
if (!Trinity::IsValidMapCoord(tmp.TempSummonCreature.PosX, tmp.TempSummonCreature.PosY, tmp.TempSummonCreature.PosZ, tmp.TempSummonCreature.Orientation))
|
||||
if (!acore::IsValidMapCoord(tmp.TempSummonCreature.PosX, tmp.TempSummonCreature.PosY, tmp.TempSummonCreature.PosZ, tmp.TempSummonCreature.Orientation))
|
||||
{
|
||||
sLog->outErrorDb("Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u",
|
||||
tableName.c_str(), tmp.TempSummonCreature.PosX, tmp.TempSummonCreature.PosY, tmp.TempSummonCreature.PosZ, tmp.TempSummonCreature.Orientation, tmp.id);
|
||||
|
|
@ -6277,7 +6277,7 @@ uint32 ObjectMgr::GenerateMailID()
|
|||
sLog->outError("Mail ids overflow!! Can't continue, shutting down server. ");
|
||||
World::StopNow(ERROR_EXIT_CODE);
|
||||
}
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, _mailIdMutex);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, _mailIdMutex);
|
||||
return _mailId++;
|
||||
}
|
||||
|
||||
|
|
@ -6288,25 +6288,25 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
|
|||
case HIGHGUID_ITEM:
|
||||
{
|
||||
ASSERT(_hiItemGuid < 0xFFFFFFFE && "Item guid overflow!");
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, _hiItemGuidMutex);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, _hiItemGuidMutex);
|
||||
return _hiItemGuid++;
|
||||
}
|
||||
case HIGHGUID_UNIT:
|
||||
{
|
||||
ASSERT(_hiCreatureGuid < 0x00FFFFFE && "Creature guid overflow!");
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, _hiCreatureGuidMutex);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, _hiCreatureGuidMutex);
|
||||
return _hiCreatureGuid++;
|
||||
}
|
||||
case HIGHGUID_PET:
|
||||
{
|
||||
ASSERT(_hiPetGuid < 0x00FFFFFE && "Pet guid overflow!");
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, _hiPetGuidMutex);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, _hiPetGuidMutex);
|
||||
return _hiPetGuid++;
|
||||
}
|
||||
case HIGHGUID_VEHICLE:
|
||||
{
|
||||
ASSERT(_hiVehicleGuid < 0x00FFFFFF && "Vehicle guid overflow!");
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, _hiVehicleGuidMutex);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, _hiVehicleGuidMutex);
|
||||
return _hiVehicleGuid++;
|
||||
}
|
||||
case HIGHGUID_PLAYER:
|
||||
|
|
@ -6317,25 +6317,25 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
|
|||
case HIGHGUID_GAMEOBJECT:
|
||||
{
|
||||
ASSERT(_hiGoGuid < 0x00FFFFFE && "Gameobject guid overflow!");
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, _hiGoGuidMutex);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, _hiGoGuidMutex);
|
||||
return _hiGoGuid++;
|
||||
}
|
||||
case HIGHGUID_CORPSE:
|
||||
{
|
||||
ASSERT(_hiCorpseGuid < 0xFFFFFFFE && "Corpse guid overflow!");
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, _hiCorpseGuidMutex);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, _hiCorpseGuidMutex);
|
||||
return _hiCorpseGuid++;
|
||||
}
|
||||
case HIGHGUID_DYNAMICOBJECT:
|
||||
{
|
||||
ASSERT(_hiDoGuid < 0xFFFFFFFE && "DynamicObject guid overflow!");
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, _hiDoGuidMutex);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, _hiDoGuidMutex);
|
||||
return _hiDoGuid++;
|
||||
}
|
||||
case HIGHGUID_MO_TRANSPORT:
|
||||
{
|
||||
ASSERT(_hiMoTransGuid < 0xFFFFFFFE && "MO Transport guid overflow!");
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, _hiMoTransGuidMutex);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, _hiMoTransGuidMutex);
|
||||
return _hiMoTransGuid++;
|
||||
}
|
||||
default:
|
||||
|
|
@ -6821,7 +6821,7 @@ std::string ObjectMgr::GeneratePetName(uint32 entry)
|
|||
|
||||
uint32 ObjectMgr::GeneratePetNumber()
|
||||
{
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, _hiPetNumberMutex);
|
||||
ACORE_GUARD(ACE_Thread_Mutex, _hiPetNumberMutex);
|
||||
return ++_hiPetNumber;
|
||||
}
|
||||
|
||||
|
|
@ -7172,7 +7172,7 @@ void ObjectMgr::LoadPointsOfInterest()
|
|||
POI.Importance = fields[5].GetUInt32();
|
||||
POI.Name = fields[6].GetString();
|
||||
|
||||
if (!Trinity::IsValidMapCoord(POI.PositionX, POI.PositionY))
|
||||
if (!acore::IsValidMapCoord(POI.PositionX, POI.PositionY))
|
||||
{
|
||||
sLog->outErrorDb("Table `points_of_interest` (ID: %u) have invalid coordinates (X: %f Y: %f), ignored.", point_id, POI.PositionX, POI.PositionY);
|
||||
continue;
|
||||
|
|
@ -7745,15 +7745,15 @@ void ObjectMgr::LoadGameObjectForQuests()
|
|||
sLog->outString();
|
||||
}
|
||||
|
||||
bool ObjectMgr::LoadTrinityStrings()
|
||||
bool ObjectMgr::LoadAcoreStrings()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
_trinityStringStore.clear(); // for reload case
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT entry, content_default, content_loc1, content_loc2, content_loc3, content_loc4, content_loc5, content_loc6, content_loc7, content_loc8 FROM trinity_string");
|
||||
_acoreStringStore.clear(); // for reload case
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT entry, content_default, content_loc1, content_loc2, content_loc3, content_loc4, content_loc5, content_loc6, content_loc7, content_loc8 FROM acore_string");
|
||||
if (!result)
|
||||
{
|
||||
sLog->outString(">> Loaded 0 trinity strings. DB table `trinity_strings` is empty.");
|
||||
sLog->outString(">> Loaded 0 trinity strings. DB table `acore_strings` is empty.");
|
||||
sLog->outString();
|
||||
return false;
|
||||
}
|
||||
|
|
@ -7764,7 +7764,7 @@ bool ObjectMgr::LoadTrinityStrings()
|
|||
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
|
||||
TrinityString& data = _trinityStringStore[entry];
|
||||
AcoreString& data = _acoreStringStore[entry];
|
||||
|
||||
data.Content.resize(DEFAULT_LOCALE + 1);
|
||||
|
||||
|
|
@ -7773,15 +7773,15 @@ bool ObjectMgr::LoadTrinityStrings()
|
|||
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded %u trinity strings in %u ms", (uint32)_trinityStringStore.size(), GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString(">> Loaded %u trinity strings in %u ms", (uint32)_acoreStringStore.size(), GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
char const* ObjectMgr::GetTrinityString(uint32 entry, LocaleConstant locale) const
|
||||
char const* ObjectMgr::GetAcoreString(uint32 entry, LocaleConstant locale) const
|
||||
{
|
||||
if (TrinityString const* ts = GetTrinityString(entry))
|
||||
if (AcoreString const* ts = GetAcoreString(entry))
|
||||
{
|
||||
if (ts->Content.size() > size_t(locale) && !ts->Content[locale].empty())
|
||||
return ts->Content[locale].c_str();
|
||||
|
|
@ -8143,7 +8143,7 @@ void ObjectMgr::LoadMailLevelRewards()
|
|||
|
||||
void ObjectMgr::AddSpellToTrainer(uint32 entry, uint32 spell, uint32 spellCost, uint32 reqSkill, uint32 reqSkillValue, uint32 reqLevel)
|
||||
{
|
||||
if (entry >= TRINITY_TRAINER_START_REF)
|
||||
if (entry >= ACORE_TRAINER_START_REF)
|
||||
return;
|
||||
|
||||
CreatureTemplate const* cInfo = GetCreatureTemplate(entry);
|
||||
|
|
|
|||
|
|
@ -474,16 +474,16 @@ struct CellObjectGuids
|
|||
typedef std::unordered_map<uint32/*cell_id*/, CellObjectGuids> CellObjectGuidsMap;
|
||||
typedef std::unordered_map<uint32/*(mapid, spawnMode) pair*/, CellObjectGuidsMap> MapObjectGuids;
|
||||
|
||||
// Trinity string ranges
|
||||
#define MIN_TRINITY_STRING_ID 1 // 'trinity_string'
|
||||
#define MAX_TRINITY_STRING_ID 2000000000
|
||||
// Acore string ranges
|
||||
#define MIN_ACORE_STRING_ID 1 // 'acore_string'
|
||||
#define MAX_ACORE_STRING_ID 2000000000
|
||||
#define MIN_CREATURE_AI_TEXT_STRING_ID (-1) // 'creature_ai_texts'
|
||||
#define MAX_CREATURE_AI_TEXT_STRING_ID (-1000000)
|
||||
|
||||
// Trinity Trainer Reference start range
|
||||
#define TRINITY_TRAINER_START_REF 200000
|
||||
// Acore Trainer Reference start range
|
||||
#define ACORE_TRAINER_START_REF 200000
|
||||
|
||||
struct TrinityString
|
||||
struct AcoreString
|
||||
{
|
||||
StringVector Content;
|
||||
};
|
||||
|
|
@ -501,7 +501,7 @@ typedef std::unordered_map<uint32, QuestOfferRewardLocale> QuestOfferRewardLocal
|
|||
typedef std::unordered_map<uint32, QuestRequestItemsLocale> QuestRequestItemsLocaleContainer;
|
||||
typedef std::unordered_map<uint32, NpcTextLocale> NpcTextLocaleContainer;
|
||||
typedef std::unordered_map<uint32, PageTextLocale> PageTextLocaleContainer;
|
||||
typedef std::unordered_map<int32, TrinityString> TrinityStringContainer;
|
||||
typedef std::unordered_map<int32, AcoreString> AcoreStringContainer;
|
||||
typedef std::unordered_map<uint32, GossipMenuItemsLocale> GossipMenuItemsLocaleContainer;
|
||||
typedef std::unordered_map<uint32, PointOfInterestLocale> PointOfInterestLocaleContainer;
|
||||
|
||||
|
|
@ -964,7 +964,7 @@ class ObjectMgr
|
|||
void ValidateSpellScripts();
|
||||
void InitializeSpellInfoPrecomputedData();
|
||||
|
||||
bool LoadTrinityStrings();
|
||||
bool LoadAcoreStrings();
|
||||
void LoadBroadcastTexts();
|
||||
void LoadBroadcastTextLocales();
|
||||
void LoadCreatureClassLevelStats();
|
||||
|
|
@ -1216,16 +1216,16 @@ class ObjectMgr
|
|||
GameObjectData& NewGOData(uint32 guid) { return _gameObjectDataStore[guid]; }
|
||||
void DeleteGOData(uint32 guid);
|
||||
|
||||
TrinityString const* GetTrinityString(uint32 entry) const
|
||||
AcoreString const* GetAcoreString(uint32 entry) const
|
||||
{
|
||||
TrinityStringContainer::const_iterator itr = _trinityStringStore.find(entry);
|
||||
if (itr == _trinityStringStore.end())
|
||||
AcoreStringContainer::const_iterator itr = _acoreStringStore.find(entry);
|
||||
if (itr == _acoreStringStore.end())
|
||||
return NULL;
|
||||
|
||||
return &itr->second;
|
||||
}
|
||||
char const* GetTrinityString(uint32 entry, LocaleConstant locale) const;
|
||||
char const* GetTrinityStringForDBCLocale(uint32 entry) const { return GetTrinityString(entry, DBCLocaleIndex); }
|
||||
char const* GetAcoreString(uint32 entry, LocaleConstant locale) const;
|
||||
char const* GetAcoreStringForDBCLocale(uint32 entry) const { return GetAcoreString(entry, DBCLocaleIndex); }
|
||||
LocaleConstant GetDBCLocaleIndex() const { return DBCLocaleIndex; }
|
||||
void SetDBCLocaleIndex(LocaleConstant locale) { DBCLocaleIndex = locale; }
|
||||
|
||||
|
|
@ -1478,7 +1478,7 @@ class ObjectMgr
|
|||
QuestRequestItemsLocaleContainer _questRequestItemsLocaleStore;
|
||||
NpcTextLocaleContainer _npcTextLocaleStore;
|
||||
PageTextLocaleContainer _pageTextLocaleStore;
|
||||
TrinityStringContainer _trinityStringStore;
|
||||
AcoreStringContainer _acoreStringStore;
|
||||
GossipMenuItemsLocaleContainer _gossipMenuItemsLocaleStore;
|
||||
PointOfInterestLocaleContainer _pointOfInterestLocaleStore;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_CELL_H
|
||||
#define TRINITY_CELL_H
|
||||
#ifndef ACORE_CELL_H
|
||||
#define ACORE_CELL_H
|
||||
|
||||
#include "TypeContainer.h"
|
||||
#include "TypeContainerVisitor.h"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_CELLIMPL_H
|
||||
#define TRINITY_CELLIMPL_H
|
||||
#ifndef ACORE_CELLIMPL_H
|
||||
#define ACORE_CELLIMPL_H
|
||||
|
||||
#include <cmath>
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ inline Cell::Cell(CellCoord const& p)
|
|||
|
||||
inline Cell::Cell(float x, float y)
|
||||
{
|
||||
CellCoord p = Trinity::ComputeCellCoord(x, y);
|
||||
CellCoord p = acore::ComputeCellCoord(x, y);
|
||||
data.Part.grid_x = p.x_coord / MAX_NUMBER_OF_CELLS;
|
||||
data.Part.grid_y = p.y_coord / MAX_NUMBER_OF_CELLS;
|
||||
data.Part.cell_x = p.x_coord % MAX_NUMBER_OF_CELLS;
|
||||
|
|
@ -38,12 +38,12 @@ inline CellArea Cell::CalculateCellArea(float x, float y, float radius)
|
|||
{
|
||||
if (radius <= 0.0f)
|
||||
{
|
||||
CellCoord center = Trinity::ComputeCellCoord(x, y).normalize();
|
||||
CellCoord center = acore::ComputeCellCoord(x, y).normalize();
|
||||
return CellArea(center, center);
|
||||
}
|
||||
|
||||
CellCoord centerX = Trinity::ComputeCellCoord(x - radius, y - radius).normalize();
|
||||
CellCoord centerY = Trinity::ComputeCellCoord(x + radius, y + radius).normalize();
|
||||
CellCoord centerX = acore::ComputeCellCoord(x - radius, y - radius).normalize();
|
||||
CellCoord centerY = acore::ComputeCellCoord(x + radius, y + radius).normalize();
|
||||
|
||||
return CellArea(centerX, centerY);
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue