refactor(Core): rename namespaces and macros to acore (#2454)

This commit is contained in:
Viste
2019-12-01 15:13:31 +03:00
committed by Francesco Borzì
parent e19e95e5d0
commit e22d78ecd6
278 changed files with 1292 additions and 1309 deletions
@@ -47,7 +47,7 @@ void WorldSession::SendAuctionHello(uint64 guid, Creature* unit)
{
if (GetPlayer()->getLevel() < sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ))
{
SendNotification(GetTrinityString(LANG_AUCTION_REQ), sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ));
SendNotification(GetAcoreString(LANG_AUCTION_REQ), sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ));
return;
}
@@ -745,7 +745,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recvData)
if (diff > delay)
diff = delay;
_lastAuctionListItemsMSTime = now + delay - diff;
TRINITY_GUARD(ACE_Thread_Mutex, AsyncAuctionListingMgr::GetTempLock());
ACORE_GUARD(ACE_Thread_Mutex, AsyncAuctionListingMgr::GetTempLock());
AsyncAuctionListingMgr::GetTempList().push_back( AuctionListItemsDelayEvent(delay-diff, _player->GetGUID(), guid, searchedname, listfrom, levelmin, levelmax, usable, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, getAll) );
}
+16 -16
View File
@@ -243,7 +243,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
// pussywizard: optimization
/*if (sender->HasAura(1852) && type != CHAT_MSG_WHISPER)
{
SendNotification(GetTrinityString(LANG_GM_SILENCE), sender->GetName().c_str());
SendNotification(GetAcoreString(LANG_GM_SILENCE), sender->GetName().c_str());
recvData.rfinish();
return;
}*/
@@ -300,7 +300,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
if (!_player->CanSpeak())
{
std::string timeStr = secsToTimeString(m_muteTime - time(NULL));
SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str());
SendNotification(GetAcoreString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str());
return;
}
@@ -348,7 +348,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ))
{
SendNotification(GetTrinityString(LANG_SAY_REQ), sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ));
SendNotification(GetAcoreString(LANG_SAY_REQ), sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ));
return;
}
@@ -363,7 +363,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
{
if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ))
{
SendNotification(GetTrinityString(LANG_WHISPER_REQ), sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ));
SendNotification(GetAcoreString(LANG_WHISPER_REQ), sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ));
return;
}
@@ -392,7 +392,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
// pussywizard: optimization
/*if (GetPlayer()->HasAura(1852) && !receiver->IsGameMaster())
{
SendNotification(GetTrinityString(LANG_GM_SILENCE), GetPlayer()->GetName().c_str());
SendNotification(GetAcoreString(LANG_GM_SILENCE), GetPlayer()->GetName().c_str());
return;
}*/
@@ -552,7 +552,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
{
if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ))
{
SendNotification(GetTrinityString(LANG_CHANNEL_REQ), sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ));
SendNotification(GetAcoreString(LANG_CHANNEL_REQ), sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ));
return;
}
}
@@ -584,7 +584,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
}
else // New AFK mode
{
sender->autoReplyMsg = msg.empty() ? GetTrinityString(LANG_PLAYER_AFK_DEFAULT) : msg;
sender->autoReplyMsg = msg.empty() ? GetAcoreString(LANG_PLAYER_AFK_DEFAULT) : msg;
if (sender->isDND())
sender->ToggleDND();
@@ -611,7 +611,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
}
else // New DND mode
{
sender->autoReplyMsg = msg.empty() ? GetTrinityString(LANG_PLAYER_DND_DEFAULT) : msg;
sender->autoReplyMsg = msg.empty() ? GetAcoreString(LANG_PLAYER_DND_DEFAULT) : msg;
if (sender->isAFK())
sender->ToggleAFK();
@@ -651,7 +651,7 @@ void WorldSession::HandleEmoteOpcode(WorldPacket & recvData)
GetPlayer()->HandleEmoteCommand(emote);
}
namespace Trinity
namespace acore
{
class EmoteChatBuilder
{
@@ -681,7 +681,7 @@ namespace Trinity
uint32 i_emote_num;
Unit const* i_target;
};
} // namespace Trinity
} // namespace acore
void WorldSession::HandleTextEmoteOpcode(WorldPacket & recvData)
{
@@ -693,7 +693,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recvData)
if (!GetPlayer()->CanSpeak())
{
std::string timeStr = secsToTimeString(m_muteTime - time(NULL));
SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str());
SendNotification(GetAcoreString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str());
return;
}
@@ -732,15 +732,15 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recvData)
Unit* unit = ObjectAccessor::GetUnit(*_player, guid);
CellCoord p = Trinity::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY());
CellCoord p = acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY());
Cell cell(p);
cell.SetNoCreate();
Trinity::EmoteChatBuilder emote_builder(*GetPlayer(), text_emote, emoteNum, unit);
Trinity::LocalizedPacketDo<Trinity::EmoteChatBuilder > emote_do(emote_builder);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::EmoteChatBuilder > > emote_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), emote_do);
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::EmoteChatBuilder> >, WorldTypeMapContainer> message(emote_worker);
acore::EmoteChatBuilder emote_builder(*GetPlayer(), text_emote, emoteNum, unit);
acore::LocalizedPacketDo<acore::EmoteChatBuilder > emote_do(emote_builder);
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::EmoteChatBuilder > > emote_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), emote_do);
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::EmoteChatBuilder> >, WorldTypeMapContainer> message(emote_worker);
cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit);
+2 -2
View File
@@ -91,7 +91,7 @@ void WorldSession::HandleSendMail(WorldPacket & recvData)
if (player->getLevel() < sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ))
{
SendNotification(GetTrinityString(LANG_MAIL_SENDER_REQ), sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ));
SendNotification(GetAcoreString(LANG_MAIL_SENDER_REQ), sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ));
return;
}
@@ -488,7 +488,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recvData)
{
std::string senderName;
if (!sObjectMgr->GetPlayerNameByGUID(sender_guid, senderName))
senderName = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN);
senderName = sObjectMgr->GetAcoreStringForDBCLocale(LANG_UNKNOWN);
std::string subj = m->subject;
CleanStringForMysqlQuery(subj);
CharacterDatabase.PExecute("INSERT INTO log_money VALUES(%u, %u, \"%s\", \"%s\", %u, \"%s\", %u, \"<COD> %s\", NOW())", GetAccountId(), player->GetGUIDLow(), player->GetName().c_str(), player->GetSession()->GetRemoteAddress().c_str(), sender_accId, senderName.c_str(), m->COD, subj.c_str());
+3 -3
View File
@@ -293,7 +293,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recvData)
data << uint32(matchcount); // placeholder, count of players matching criteria
data << uint32(displaycount); // placeholder, count of players displayed
TRINITY_READ_GUARD(HashMapHolder<Player>::LockType, *HashMapHolder<Player>::GetLock());
ACORE_READ_GUARD(HashMapHolder<Player>::LockType, *HashMapHolder<Player>::GetLock());
HashMapHolder<Player>::MapType const& m = sObjectAccessor->GetPlayers();
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
{
@@ -582,7 +582,7 @@ void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ADD_FRIEND");
#endif
std::string friendName = GetTrinityString(LANG_FRIEND_IGNORE_UNKNOWN);
std::string friendName = GetAcoreString(LANG_FRIEND_IGNORE_UNKNOWN);
std::string friendNote;
recv_data >> friendName;
@@ -671,7 +671,7 @@ void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recv_data)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ADD_IGNORE");
#endif
std::string ignoreName = GetTrinityString(LANG_FRIEND_IGNORE_UNKNOWN);
std::string ignoreName = GetAcoreString(LANG_FRIEND_IGNORE_UNKNOWN);
recv_data >> ignoreName;
+3 -3
View File
@@ -115,7 +115,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
if (!_player->getHostileRefManager().isEmpty())
_player->getHostileRefManager().deleteReferences(); // pussywizard: multithreading crashfix
CellCoord pair(Trinity::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY()));
CellCoord pair(acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY()));
Cell cell(pair);
if (!GridCoord(cell.GridX(), cell.GridY()).IsCoordValid())
{
@@ -163,7 +163,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
}
// xinef: do this again, player can be teleported inside bg->AddPlayer(_player)!!!!
CellCoord pair2(Trinity::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY()));
CellCoord pair2(acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY()));
Cell cell2(pair2);
if (!GridCoord(cell2.GridX(), cell2.GridY()).IsCoordValid())
{
@@ -358,7 +358,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData)
return;
}
if (!Trinity::IsValidMapCoord(movementInfo.pos.GetPositionX() + movementInfo.transport.pos.GetPositionX(), movementInfo.pos.GetPositionY() + movementInfo.transport.pos.GetPositionY(),
if (!acore::IsValidMapCoord(movementInfo.pos.GetPositionX() + movementInfo.transport.pos.GetPositionX(), movementInfo.pos.GetPositionY() + movementInfo.transport.pos.GetPositionY(),
movementInfo.pos.GetPositionZ() + movementInfo.transport.pos.GetPositionZ(), movementInfo.pos.GetOrientation() + movementInfo.transport.pos.GetOrientation()))
{
recvData.rfinish(); // prevent warnings spam
+1 -1
View File
@@ -116,7 +116,7 @@ void WorldSession::HandleTrainerListOpcode(WorldPacket & recvData)
void WorldSession::SendTrainerList(uint64 guid)
{
std::string str = GetTrinityString(LANG_NPC_TAINER_HELLO);
std::string str = GetAcoreString(LANG_NPC_TAINER_HELLO);
SendTrainerList(guid, str);
}
+1 -1
View File
@@ -25,7 +25,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket& recvData)
if (GetPlayer()->getLevel() < sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ))
{
SendNotification(GetTrinityString(LANG_TICKET_REQ), sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ));
SendNotification(GetAcoreString(LANG_TICKET_REQ), sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ));
return;
}
+2 -2
View File
@@ -571,7 +571,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
if (GetPlayer()->getLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ))
{
SendNotification(GetTrinityString(LANG_TRADE_REQ), sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
SendNotification(GetAcoreString(LANG_TRADE_REQ), sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
return;
}
@@ -636,7 +636,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
if (pOther->getLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ))
{
SendNotification(GetTrinityString(LANG_TRADE_OTHER_REQ), sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
SendNotification(GetAcoreString(LANG_TRADE_OTHER_REQ), sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
return;
}