Core/Misc: Replace Trinity::make_unique with std (#24869)

This commit is contained in:
Peter Keresztes Schmidt
2020-06-23 08:54:12 +02:00
committed by GitHub
parent 01c8d03e2e
commit bab5fd87a3
26 changed files with 59 additions and 64 deletions
-5
View File
@@ -125,9 +125,4 @@ struct TC_COMMON_API LocalizedString
#define MAX_QUERY_LEN 32*1024
namespace Trinity
{
using std::make_unique;
}
#endif
+13 -13
View File
@@ -348,7 +348,7 @@ bool DB2FileLoaderRegularImpl::LoadTableData(DB2FileSource* source, uint32 secti
{
if (!_data)
{
_data = Trinity::make_unique<uint8[]>(_header->RecordSize * _header->RecordCount + _header->StringTableSize + 8);
_data = std::make_unique<uint8[]>(_header->RecordSize * _header->RecordCount + _header->StringTableSize + 8);
_stringTable = &_data[_header->RecordSize * _header->RecordCount];
}
@@ -1002,7 +1002,7 @@ DB2FileLoaderSparseImpl::DB2FileLoaderSparseImpl(char const* fileName, DB2FileLo
_source(source),
_totalRecordSize(0),
_maxRecordSize(0),
_fieldAndArrayOffsets(loadInfo ? (Trinity::make_unique<std::size_t[]>(loadInfo->Meta->FieldCount + loadInfo->FieldCount - (!loadInfo->Meta->HasIndexFieldInData() ? 1 : 0))) : nullptr)
_fieldAndArrayOffsets(loadInfo ? (std::make_unique<std::size_t[]>(loadInfo->Meta->FieldCount + loadInfo->FieldCount - (!loadInfo->Meta->HasIndexFieldInData() ? 1 : 0))) : nullptr)
{
}
@@ -1057,7 +1057,7 @@ bool DB2FileLoaderSparseImpl::LoadCatalogData(DB2FileSource* source, uint32 sect
void DB2FileLoaderSparseImpl::SetAdditionalData(std::vector<uint32> /*idTable*/, std::vector<DB2RecordCopy> /*copyTable*/, std::vector<std::vector<DB2IndexData>> parentIndexes)
{
_parentIndexes = std::move(parentIndexes);
_recordBuffer = Trinity::make_unique<uint8[]>(_maxRecordSize);
_recordBuffer = std::make_unique<uint8[]>(_maxRecordSize);
}
char* DB2FileLoaderSparseImpl::AutoProduceData(uint32& maxId, char**& indexTable, std::vector<char*>& stringPool)
@@ -1777,7 +1777,7 @@ bool DB2FileLoader::LoadHeaders(DB2FileSource* source, DB2FileLoadInfo const* lo
if (loadInfo && (_header.ParentLookupCount && loadInfo->Meta->ParentIndexField == -1))
return false;
std::unique_ptr<DB2SectionHeader[]> sections = Trinity::make_unique<DB2SectionHeader[]>(_header.SectionCount);
std::unique_ptr<DB2SectionHeader[]> sections = std::make_unique<DB2SectionHeader[]>(_header.SectionCount);
if (_header.SectionCount && !source->Read(sections.get(), sizeof(DB2SectionHeader) * _header.SectionCount))
return false;
@@ -1808,7 +1808,7 @@ bool DB2FileLoader::LoadHeaders(DB2FileSource* source, DB2FileLoadInfo const* lo
return false;
}
std::unique_ptr<DB2FieldEntry[]> fieldData = Trinity::make_unique<DB2FieldEntry[]>(_header.FieldCount);
std::unique_ptr<DB2FieldEntry[]> fieldData = std::make_unique<DB2FieldEntry[]>(_header.FieldCount);
if (!source->Read(fieldData.get(), sizeof(DB2FieldEntry) * _header.FieldCount))
return false;
@@ -1818,7 +1818,7 @@ bool DB2FileLoader::LoadHeaders(DB2FileSource* source, DB2FileLoadInfo const* lo
std::unique_ptr<std::unordered_map<uint32, uint32>[]> commonValues;
if (_header.ColumnMetaSize)
{
columnMeta = Trinity::make_unique<DB2ColumnMeta[]>(_header.TotalFieldCount);
columnMeta = std::make_unique<DB2ColumnMeta[]>(_header.TotalFieldCount);
if (!source->Read(columnMeta.get(), _header.ColumnMetaSize))
return false;
@@ -1830,30 +1830,30 @@ bool DB2FileLoader::LoadHeaders(DB2FileSource* source, DB2FileLoadInfo const* lo
columnMeta[loadInfo->Meta->IndexField].CompressionType == DB2ColumnCompression::SignedImmediate);
}
palletValues = Trinity::make_unique<std::unique_ptr<DB2PalletValue[]>[]>(_header.TotalFieldCount);
palletValues = std::make_unique<std::unique_ptr<DB2PalletValue[]>[]>(_header.TotalFieldCount);
for (uint32 i = 0; i < _header.TotalFieldCount; ++i)
{
if (columnMeta[i].CompressionType != DB2ColumnCompression::Pallet)
continue;
palletValues[i] = Trinity::make_unique<DB2PalletValue[]>(columnMeta[i].AdditionalDataSize / sizeof(DB2PalletValue));
palletValues[i] = std::make_unique<DB2PalletValue[]>(columnMeta[i].AdditionalDataSize / sizeof(DB2PalletValue));
if (!source->Read(palletValues[i].get(), columnMeta[i].AdditionalDataSize))
return false;
}
palletArrayValues = Trinity::make_unique<std::unique_ptr<DB2PalletValue[]>[]>(_header.TotalFieldCount);
palletArrayValues = std::make_unique<std::unique_ptr<DB2PalletValue[]>[]>(_header.TotalFieldCount);
for (uint32 i = 0; i < _header.TotalFieldCount; ++i)
{
if (columnMeta[i].CompressionType != DB2ColumnCompression::PalletArray)
continue;
palletArrayValues[i] = Trinity::make_unique<DB2PalletValue[]>(columnMeta[i].AdditionalDataSize / sizeof(DB2PalletValue));
palletArrayValues[i] = std::make_unique<DB2PalletValue[]>(columnMeta[i].AdditionalDataSize / sizeof(DB2PalletValue));
if (!source->Read(palletArrayValues[i].get(), columnMeta[i].AdditionalDataSize))
return false;
}
std::unique_ptr<std::unique_ptr<DB2CommonValue[]>[]> commonData = Trinity::make_unique<std::unique_ptr<DB2CommonValue[]>[]>(_header.TotalFieldCount);
commonValues = Trinity::make_unique<std::unordered_map<uint32, uint32>[]>(_header.TotalFieldCount);
std::unique_ptr<std::unique_ptr<DB2CommonValue[]>[]> commonData = std::make_unique<std::unique_ptr<DB2CommonValue[]>[]>(_header.TotalFieldCount);
commonValues = std::make_unique<std::unordered_map<uint32, uint32>[]>(_header.TotalFieldCount);
for (uint32 i = 0; i < _header.TotalFieldCount; ++i)
{
if (columnMeta[i].CompressionType != DB2ColumnCompression::CommonData)
@@ -1862,7 +1862,7 @@ bool DB2FileLoader::LoadHeaders(DB2FileSource* source, DB2FileLoadInfo const* lo
if (!columnMeta[i].AdditionalDataSize)
continue;
commonData[i] = Trinity::make_unique<DB2CommonValue[]>(columnMeta[i].AdditionalDataSize / sizeof(DB2CommonValue));
commonData[i] = std::make_unique<DB2CommonValue[]>(columnMeta[i].AdditionalDataSize / sizeof(DB2CommonValue));
if (!source->Read(commonData[i].get(), columnMeta[i].AdditionalDataSize))
return false;
+3 -3
View File
@@ -152,7 +152,7 @@ void Log::CreateLoggerFromConfig(std::string const& appenderName)
if (level < lowestLogLevel)
lowestLogLevel = level;
logger = Trinity::make_unique<Logger>(name, level);
logger = std::make_unique<Logger>(name, level);
//fprintf(stdout, "Log::CreateLoggerFromConfig: Created Logger %s, Level %u\n", name.c_str(), level);
std::istringstream ss(*iter);
@@ -215,12 +215,12 @@ void Log::RegisterAppender(uint8 index, AppenderCreatorFn appenderCreateFn)
void Log::outMessage(std::string const& filter, LogLevel const level, std::string&& message)
{
write(Trinity::make_unique<LogMessage>(level, filter, std::move(message)));
write(std::make_unique<LogMessage>(level, filter, std::move(message)));
}
void Log::outCommand(std::string&& message, std::string&& param1)
{
write(Trinity::make_unique<LogMessage>(LOG_LEVEL_INFO, "commands.gm", std::move(message), std::move(param1)));
write(std::make_unique<LogMessage>(LOG_LEVEL_INFO, "commands.gm", std::move(message), std::move(param1)));
}
void Log::write(std::unique_ptr<LogMessage>&& msg) const
+3 -3
View File
@@ -27,10 +27,10 @@
void Metric::Initialize(std::string const& realmName, Trinity::Asio::IoContext& ioContext, std::function<void()> overallStatusLogger)
{
_dataStream = Trinity::make_unique<boost::asio::ip::tcp::iostream>();
_dataStream = std::make_unique<boost::asio::ip::tcp::iostream>();
_realmName = FormatInfluxDBTagValue(realmName);
_batchTimer = Trinity::make_unique<Trinity::Asio::DeadlineTimer>(ioContext);
_overallStatusTimer = Trinity::make_unique<Trinity::Asio::DeadlineTimer>(ioContext);
_batchTimer = std::make_unique<Trinity::Asio::DeadlineTimer>(ioContext);
_overallStatusTimer = std::make_unique<Trinity::Asio::DeadlineTimer>(ioContext);
_overallStatusLogger = overallStatusLogger;
LoadFromConfigs();
}
@@ -253,7 +253,7 @@ int32 LoginRESTService::HandleGetGameAccounts(std::shared_ptr<AsyncRequest> requ
if (!request->GetClient()->userid)
return 401;
request->SetCallback(Trinity::make_unique<QueryCallback>(LoginDatabase.AsyncQuery([&] {
request->SetCallback(std::make_unique<QueryCallback>(LoginDatabase.AsyncQuery([&] {
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_GAME_ACCOUNT_LIST);
stmt->setString(0, request->GetClient()->userid);
return stmt;
@@ -345,7 +345,7 @@ int32 LoginRESTService::HandlePostLogin(std::shared_ptr<AsyncRequest> request)
std::string sentPasswordHash = CalculateShaPassHash(login, password);
request->SetCallback(Trinity::make_unique<QueryCallback>(LoginDatabase.AsyncQuery(stmt)
request->SetCallback(std::make_unique<QueryCallback>(LoginDatabase.AsyncQuery(stmt)
.WithChainingPreparedCallback([request, login, sentPasswordHash, this](QueryCallback& callback, PreparedQueryResult result)
{
if (result)
@@ -444,7 +444,7 @@ int32 LoginRESTService::HandlePostRefreshLoginTicket(std::shared_ptr<AsyncReques
if (!request->GetClient()->userid)
return 401;
request->SetCallback(Trinity::make_unique<QueryCallback>(LoginDatabase.AsyncQuery([&] {
request->SetCallback(std::make_unique<QueryCallback>(LoginDatabase.AsyncQuery([&] {
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_EXISTING_AUTHENTICATION);
stmt->setString(0, request->GetClient()->userid);
return stmt;
@@ -69,7 +69,7 @@ template <class T>
void DatabaseWorkerPool<T>::SetConnectionInfo(std::string const& infoString,
uint8 const asyncThreads, uint8 const synchThreads)
{
_connectionInfo = Trinity::make_unique<MySQLConnectionInfo>(infoString);
_connectionInfo = std::make_unique<MySQLConnectionInfo>(infoString);
_async_threads = asyncThreads;
_synch_threads = synchThreads;
@@ -365,9 +365,9 @@ uint32 DatabaseWorkerPool<T>::OpenConnections(InternalIndex type, uint8 numConne
switch (type)
{
case IDX_ASYNC:
return Trinity::make_unique<T>(_queue.get(), *_connectionInfo);
return std::make_unique<T>(_queue.get(), *_connectionInfo);
case IDX_SYNCH:
return Trinity::make_unique<T>(*_connectionInfo);
return std::make_unique<T>(*_connectionInfo);
default:
ABORT();
}
@@ -62,7 +62,7 @@ m_Mysql(NULL),
m_connectionInfo(connInfo),
m_connectionFlags(CONNECTION_ASYNC)
{
m_worker = Trinity::make_unique<DatabaseWorker>(m_queue, this);
m_worker = std::make_unique<DatabaseWorker>(m_queue, this);
}
MySQLConnection::~MySQLConnection()
@@ -486,7 +486,7 @@ void MySQLConnection::PrepareStatement(uint32 index, std::string const& sql, Con
m_prepareError = true;
}
else
m_stmts[index] = Trinity::make_unique<MySQLPreparedStatement>(reinterpret_cast<MySQLStmt*>(stmt), sql);
m_stmts[index] = std::make_unique<MySQLPreparedStatement>(reinterpret_cast<MySQLStmt*>(stmt), sql);
}
}
@@ -42,7 +42,7 @@ UpdateFetcher::UpdateFetcher(Path const& sourceDirectory,
std::function<void(std::string const&)> const& apply,
std::function<void(Path const& path)> const& applyFile,
std::function<QueryResult(std::string const&)> const& retrieve) :
_sourceDirectory(Trinity::make_unique<Path>(sourceDirectory)), _apply(apply), _applyFile(applyFile),
_sourceDirectory(std::make_unique<Path>(sourceDirectory)), _apply(apply), _applyFile(applyFile),
_retrieve(retrieve)
{
}
@@ -639,7 +639,7 @@ void AreaTrigger::InitSplines(std::vector<G3D::Vector3> splinePoints, uint32 tim
_movementTime = 0;
_spline = Trinity::make_unique<::Movement::Spline<int32>>();
_spline = std::make_unique<::Movement::Spline<int32>>();
_spline->init_spline(&splinePoints[0], splinePoints.size(), ::Movement::SplineBase::ModeLinear);
_spline->initLengths();
@@ -2730,5 +2730,5 @@ private:
GameObjectModel* GameObject::CreateModel()
{
return GameObjectModel::Create(Trinity::make_unique<GameObjectModelOwnerImpl>(this), sWorld->GetDataPath());
return GameObjectModel::Create(std::make_unique<GameObjectModelOwnerImpl>(this), sWorld->GetDataPath());
}
@@ -85,7 +85,7 @@ namespace
}
}
CollectionMgr::CollectionMgr(WorldSession* owner) : _owner(owner), _appearances(Trinity::make_unique<boost::dynamic_bitset<uint32>>())
CollectionMgr::CollectionMgr(WorldSession* owner) : _owner(owner), _appearances(std::make_unique<boost::dynamic_bitset<uint32>>())
{
}
+4 -4
View File
@@ -346,14 +346,14 @@ Player::Player(WorldSession* session) : Unit(true), m_sceneMgr(this)
m_achievementMgr = new PlayerAchievementMgr(this);
m_reputationMgr = new ReputationMgr(this);
m_questObjectiveCriteriaMgr = Trinity::make_unique<QuestObjectiveCriteriaMgr>(this);
m_questObjectiveCriteriaMgr = std::make_unique<QuestObjectiveCriteriaMgr>(this);
for (uint8 i = 0; i < MAX_CUF_PROFILES; ++i)
_CUFProfiles[i] = nullptr;
_advancedCombatLoggingEnabled = false;
_restMgr = Trinity::make_unique<RestMgr>(this);
_restMgr = std::make_unique<RestMgr>(this);
_usePvpItemLevels = false;
}
@@ -18645,7 +18645,7 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder* holder)
_LoadCUFProfiles(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_CUF_PROFILES));
std::unique_ptr<Garrison> garrison = Trinity::make_unique<Garrison>(this);
std::unique_ptr<Garrison> garrison = std::make_unique<Garrison>(this);
if (garrison->LoadFromDB(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_GARRISON),
holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_GARRISON_BLUEPRINTS),
holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_GARRISON_BUILDINGS),
@@ -18704,7 +18704,7 @@ void Player::_LoadCUFProfiles(PreparedQueryResult result)
continue;
}
_CUFProfiles[id] = Trinity::make_unique<CUFProfile>(name, frameHeight, frameWidth, sortBy, healthText, boolOptions, topPoint, bottomPoint, leftPoint, topOffset, bottomOffset, leftOffset);
_CUFProfiles[id] = std::make_unique<CUFProfile>(name, frameHeight, frameWidth, sortBy, healthText, boolOptions, topPoint, bottomPoint, leftPoint, topOffset, bottomOffset, leftOffset);
}
while (result->NextRow());
}
+2 -2
View File
@@ -14095,7 +14095,7 @@ void Unit::SendSetVehicleRecId(uint32 vehicleId)
void Unit::ApplyMovementForce(ObjectGuid id, Position origin, float magnitude, uint8 type, Position direction /*= {}*/, ObjectGuid transportGuid /*= ObjectGuid::Empty*/)
{
if (!_movementForces)
_movementForces = Trinity::make_unique<MovementForces>();
_movementForces = std::make_unique<MovementForces>();
MovementForce force;
force.ID = id;
@@ -14208,7 +14208,7 @@ void Unit::UpdateMovementForcesModMagnitude()
}
if (modMagnitude != 1.0f && !_movementForces)
_movementForces = Trinity::make_unique<MovementForces>();
_movementForces = std::make_unique<MovementForces>();
if (_movementForces)
{
+1 -1
View File
@@ -1635,7 +1635,7 @@ class TC_GAME_API ObjectMgr
{
auto itr = _guidGenerators.find(high);
if (itr == _guidGenerators.end())
itr = _guidGenerators.insert(std::make_pair(high, Trinity::make_unique<ObjectGuidGenerator<high>>())).first;
itr = _guidGenerators.insert(std::make_pair(high, std::make_unique<ObjectGuidGenerator<high>>())).first;
return *itr->second;
}
+1 -1
View File
@@ -2385,7 +2385,7 @@ void Group::AddRaidMarker(uint8 markerId, uint32 mapId, float positionX, float p
return;
m_activeMarkers |= (1 << markerId);
m_markers[markerId] = Trinity::make_unique<RaidMarker>(mapId, positionX, positionY, positionZ, transportGuid);
m_markers[markerId] = std::make_unique<RaidMarker>(mapId, positionX, positionY, positionZ, transportGuid);
SendRaidMarkersChanged();
}
+1 -1
View File
@@ -4381,7 +4381,7 @@ Weather* Map::GetOrGenerateZoneDefaultWeather(uint32 zoneId)
ZoneDynamicInfo& info = _zoneDynamicInfo[zoneId];
if (!info.DefaultWeather)
{
info.DefaultWeather = Trinity::make_unique<Weather>(zoneId, weatherData);
info.DefaultWeather = std::make_unique<Weather>(zoneId, weatherData);
info.DefaultWeather->ReGenerate();
info.DefaultWeather->UpdateWeather();
}
+1 -1
View File
@@ -747,7 +747,7 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
{
auto itr = _guidGenerators.find(high);
if (itr == _guidGenerators.end())
itr = _guidGenerators.insert(std::make_pair(high, Trinity::make_unique<ObjectGuidGenerator<high>>())).first;
itr = _guidGenerators.insert(std::make_pair(high, std::make_unique<ObjectGuidGenerator<high>>())).first;
return *itr->second;
}
+1 -1
View File
@@ -243,7 +243,7 @@ public:
void QueueForDelayedDelete(T&& any)
{
_delayed_delete_queue.push_back(
Trinity::make_unique<
std::make_unique<
DeleteableObject<typename std::decay<T>::type>
>(std::forward<T>(any))
);
@@ -936,7 +936,7 @@ private:
}
// Create the source listener
auto listener = Trinity::make_unique<SourceUpdateListener>(
auto listener = std::make_unique<SourceUpdateListener>(
sScriptReloadMgr->GetSourceDirectory() / module_name,
module_name);
@@ -240,7 +240,7 @@ std::unique_ptr<Trinity::Crypto::RSA> ConnectToRSA;
bool WorldPackets::Auth::ConnectTo::InitializeEncryption()
{
std::unique_ptr<Trinity::Crypto::RSA> rsa = Trinity::make_unique<Trinity::Crypto::RSA>();
std::unique_ptr<Trinity::Crypto::RSA> rsa = std::make_unique<Trinity::Crypto::RSA>();
if (!rsa->LoadFromString(RSAPrivateKey, Trinity::Crypto::RSA::PrivateKey{}))
return false;
@@ -502,7 +502,7 @@ void WorldPackets::Misc::SaveCUFProfiles::Read()
CUFProfiles.resize(_worldPacket.read<uint32>());
for (std::unique_ptr<CUFProfile>& cufProfile : CUFProfiles)
{
cufProfile = Trinity::make_unique<CUFProfile>();
cufProfile = std::make_unique<CUFProfile>();
uint8 strLen = _worldPacket.ReadBits(7);
+2 -2
View File
@@ -134,8 +134,8 @@ WorldSession::WorldSession(uint32 id, std::string&& name, uint32 battlenetAccoun
expireTime(60000), // 1 min after socket loss, session is deleted
forceExit(false),
m_currentBankerGUID(),
_battlePetMgr(Trinity::make_unique<BattlePetMgr>(this)),
_collectionMgr(Trinity::make_unique<CollectionMgr>(this))
_battlePetMgr(std::make_unique<BattlePetMgr>(this)),
_collectionMgr(std::make_unique<CollectionMgr>(this))
{
memset(_tutorials, 0, sizeof(_tutorials));
+1 -1
View File
@@ -5382,7 +5382,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
float objSize = target->GetCombatReach();
float range = m_spellInfo->GetMaxRange(true, m_caster, this) * 1.5f + objSize; // can't be overly strict
m_preGeneratedPath = Trinity::make_unique<PathGenerator>(m_caster);
m_preGeneratedPath = std::make_unique<PathGenerator>(m_caster);
m_preGeneratedPath->SetPathLengthLimit(range);
// first try with raycast, if it fails fall back to normal path
float targetObjectSize = std::min(target->GetCombatReach(), 4.0f);
+6 -6
View File
@@ -35,7 +35,7 @@
RealmList::RealmList() : _updateInterval(0)
{
_realmsMutex = Trinity::make_unique<boost::shared_mutex>();
_realmsMutex = std::make_unique<boost::shared_mutex>();
}
RealmList::~RealmList()
@@ -52,8 +52,8 @@ RealmList* RealmList::Instance()
void RealmList::Initialize(Trinity::Asio::IoContext& ioContext, uint32 updateInterval)
{
_updateInterval = updateInterval;
_updateTimer = Trinity::make_unique<Trinity::Asio::DeadlineTimer>(ioContext);
_resolver = Trinity::make_unique<boost::asio::ip::tcp::resolver>(ioContext);
_updateTimer = std::make_unique<Trinity::Asio::DeadlineTimer>(ioContext);
_resolver = std::make_unique<boost::asio::ip::tcp::resolver>(ioContext);
LoadBuildInfo();
// Get the content of the realmlist table in the database
@@ -112,11 +112,11 @@ void RealmList::UpdateRealm(Realm& realm, Battlenet::RealmHandle const& id, uint
realm.AllowedSecurityLevel = allowedSecurityLevel;
realm.PopulationLevel = population;
if (!realm.ExternalAddress || *realm.ExternalAddress != address)
realm.ExternalAddress = Trinity::make_unique<boost::asio::ip::address>(std::move(address));
realm.ExternalAddress = std::make_unique<boost::asio::ip::address>(std::move(address));
if (!realm.LocalAddress || *realm.LocalAddress != localAddr)
realm.LocalAddress = Trinity::make_unique<boost::asio::ip::address>(std::move(localAddr));
realm.LocalAddress = std::make_unique<boost::asio::ip::address>(std::move(localAddr));
if (!realm.LocalSubnetMask || *realm.LocalSubnetMask != localSubmask)
realm.LocalSubnetMask = Trinity::make_unique<boost::asio::ip::address>(std::move(localSubmask));
realm.LocalSubnetMask = std::make_unique<boost::asio::ip::address>(std::move(localSubmask));
realm.Port = port;
}
+3 -3
View File
@@ -516,9 +516,9 @@ bool LoadRealmInfo()
{
realm.Id = realmListRealm->Id;
realm.Build = realmListRealm->Build;
realm.ExternalAddress = Trinity::make_unique<boost::asio::ip::address>(*realmListRealm->ExternalAddress);
realm.LocalAddress = Trinity::make_unique<boost::asio::ip::address>(*realmListRealm->LocalAddress);
realm.LocalSubnetMask = Trinity::make_unique<boost::asio::ip::address>(*realmListRealm->LocalSubnetMask);
realm.ExternalAddress = std::make_unique<boost::asio::ip::address>(*realmListRealm->ExternalAddress);
realm.LocalAddress = std::make_unique<boost::asio::ip::address>(*realmListRealm->LocalAddress);
realm.LocalSubnetMask = std::make_unique<boost::asio::ip::address>(*realmListRealm->LocalSubnetMask);
realm.Port = realmListRealm->Port;
realm.Name = realmListRealm->Name;
realm.NormalizedName = realmListRealm->NormalizedName;
+2 -2
View File
@@ -32,7 +32,7 @@ WDTFile::WDTFile(uint32 fileDataId, std::string const& description, std::string
memset(&_adtInfo, 0, sizeof(WDT::MAIN));
if (cache)
{
_adtCache = Trinity::make_unique<ADTCache>();
_adtCache = std::make_unique<ADTCache>();
memset(_adtCache->file, 0, sizeof(_adtCache->file));
}
else
@@ -80,7 +80,7 @@ bool WDTFile::init(uint32 mapId)
else if (!strcmp(fourcc, "MAID"))
{
ASSERT(size == sizeof(WDT::MAID));
_adtFileDataIds = Trinity::make_unique<WDT::MAID>();
_adtFileDataIds = std::make_unique<WDT::MAID>();
_file.read(_adtFileDataIds.get(), sizeof(WDT::MAID));
}
else if (!strcmp(fourcc,"MWMO"))