aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/authserver/authserver.conf.dist2
-rw-r--r--src/server/game/Chat/Chat.cpp28
-rw-r--r--src/server/game/Chat/Chat.h4
-rw-r--r--src/server/game/DungeonFinding/LFGQueue.cpp48
-rw-r--r--src/server/game/DungeonFinding/LFGQueue.h2
-rw-r--r--src/server/game/Entities/Player/Player.cpp13
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp4
-rw-r--r--src/server/scripts/Commands/cs_lfg.cpp2
8 files changed, 66 insertions, 37 deletions
diff --git a/src/server/authserver/authserver.conf.dist b/src/server/authserver/authserver.conf.dist
index ba9cb5b23b4..437ec221e94 100644
--- a/src/server/authserver/authserver.conf.dist
+++ b/src/server/authserver/authserver.conf.dist
@@ -182,7 +182,7 @@ Updates.EnableDatabases = 0
Updates.SourcePath = ""
#
-# Updates.SourcePath
+# Updates.MySqlCLIPath
# Description: The path to your mysql cli binary.
# If the path is left empty, built-in path from cmake is used.
# Example: "C:/Program Files/MySQL/MySQL Server 5.6/bin/mysql.exe"
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp
index 5a74ad05b66..0d6816fc80d 100644
--- a/src/server/game/Chat/Chat.cpp
+++ b/src/server/game/Chat/Chat.cpp
@@ -186,13 +186,33 @@ bool ChatHandler::hasStringAbbr(const char* name, const char* part)
return true;
}
-void ChatHandler::SendSysMessage(const char *str)
+void ChatHandler::SendSysMessage(const char *str, bool escapeCharacters)
{
WorldPacket data;
// need copy to prevent corruption by strtok call in LineFromMessage original string
- char* buf = strdup(str);
- char* pos = buf;
+ char* buf;
+ char* pos;
+
+ if (escapeCharacters && strchr(str, '|'))
+ {
+ size_t startPos = 0;
+ std::ostringstream o;
+ while (const char* charPos = strchr(str + startPos, '|'))
+ {
+ o.write(str + startPos, charPos - str - startPos);
+ o << "||";
+ startPos = charPos - str + 1;
+ }
+ o.write(str + startPos, strlen(str) - startPos);
+ buf = strdup(o.str().c_str());
+ }
+ else
+ {
+ buf = strdup(str);
+ }
+
+ pos = buf;
while (char* line = LineFromMessage(pos))
{
@@ -1223,7 +1243,7 @@ bool CliHandler::isAvailable(ChatCommand const& cmd) const
return cmd.AllowConsole;
}
-void CliHandler::SendSysMessage(const char *str)
+void CliHandler::SendSysMessage(const char *str, bool /*escapeCharacters*/)
{
m_print(m_callbackArg, str);
m_print(m_callbackArg, "\r\n");
diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h
index 1b095534ad0..72d80aba7e6 100644
--- a/src/server/game/Chat/Chat.h
+++ b/src/server/game/Chat/Chat.h
@@ -66,7 +66,7 @@ class ChatHandler
// function with different implementation for chat/console
virtual char const* GetTrinityString(uint32 entry) const;
- virtual void SendSysMessage(char const* str);
+ virtual void SendSysMessage(char const* str, bool escapeCharacters = false);
void SendSysMessage(uint32 entry);
@@ -166,7 +166,7 @@ class CliHandler : public ChatHandler
char const* GetTrinityString(uint32 entry) const override;
bool isAvailable(ChatCommand const& cmd) const override;
bool HasPermission(uint32 /*permission*/) const override { return true; }
- void SendSysMessage(const char *str) override;
+ void SendSysMessage(const char *str, bool escapeCharacters) override;
std::string GetNameLink() const override;
bool needReportToTarget(Player* chr) const override;
LocaleConstant GetSessionDbcLocale() const override;
diff --git a/src/server/game/DungeonFinding/LFGQueue.cpp b/src/server/game/DungeonFinding/LFGQueue.cpp
index d2140a96a46..86b010a9ace 100644
--- a/src/server/game/DungeonFinding/LFGQueue.cpp
+++ b/src/server/game/DungeonFinding/LFGQueue.cpp
@@ -72,7 +72,7 @@ char const* GetCompatibleString(LfgCompatibility compatibles)
case LFG_INCOMPATIBLES_NO_ROLES:
return "Incompatible roles";
case LFG_INCOMPATIBLES_TOO_MUCH_PLAYERS:
- return "Too much players";
+ return "Too many players";
case LFG_INCOMPATIBLES_WRONG_GROUP_SIZE:
return "Wrong group size";
default:
@@ -80,7 +80,7 @@ char const* GetCompatibleString(LfgCompatibility compatibles)
}
}
-std::string LFGQueue::GetDetailedMatchRoles(GuidList const& check)
+std::string LFGQueue::GetDetailedMatchRoles(GuidList const& check) const
{
if (check.empty())
return "";
@@ -92,31 +92,25 @@ std::string LFGQueue::GetDetailedMatchRoles(GuidList const& check)
GuidSet::const_iterator it = guids.begin();
o << it->GetRawValue();
- LfgQueueDataContainer::iterator itQueue = QueueDataStore.find(*it);
- if (itQueue == QueueDataStore.end())
- {
- TC_LOG_ERROR("lfg.queue.data.details", "Queue data not found for [%s]", it->ToString().c_str());
- o << ' ' << GetRolesString(PLAYER_ROLE_NONE);
- }
- else
+ LfgQueueDataContainer::const_iterator itQueue = QueueDataStore.find(*it);
+ if (itQueue != QueueDataStore.end())
{
// skip leader flag, log only dps/tank/healer
- o << ' ' << GetRolesString(itQueue->second.roles[*it] & uint8(~PLAYER_ROLE_LEADER));
+ auto role = itQueue->second.roles.find(*it);
+ if (role != itQueue->second.roles.end())
+ o << ' ' << GetRolesString(itQueue->second.roles.at(*it) & uint8(~PLAYER_ROLE_LEADER));
}
for (++it; it != guids.end(); ++it)
{
o << '|' << it->GetRawValue();
itQueue = QueueDataStore.find(*it);
- if (itQueue == QueueDataStore.end())
- {
- TC_LOG_ERROR("lfg.queue.data.details", "Queue data not found for [%s]", it->ToString().c_str());
- o << ' ' << GetRolesString(PLAYER_ROLE_NONE);
- }
- else
+ if (itQueue != QueueDataStore.end())
{
// skip leader flag, log only dps/tank/healer
- o << ' ' << GetRolesString(itQueue->second.roles[*it] & uint8(~PLAYER_ROLE_LEADER));
+ auto role = itQueue->second.roles.find(*it);
+ if (role != itQueue->second.roles.end())
+ o << ' ' << GetRolesString(itQueue->second.roles.at(*it) & uint8(~PLAYER_ROLE_LEADER));
}
}
@@ -438,7 +432,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(GuidList check)
if (numPlayers > MAXGROUPSIZE)
{
- TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: (%s) Too much players (%u)", GetDetailedMatchRoles(check).c_str(), numPlayers);
+ TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: (%s) Too many players (%u)", GetDetailedMatchRoles(check).c_str(), numPlayers);
SetCompatibles(strGuids, LFG_INCOMPATIBLES_TOO_MUCH_PLAYERS);
return LFG_INCOMPATIBLES_TOO_MUCH_PLAYERS;
}
@@ -666,7 +660,23 @@ std::string LFGQueue::DumpCompatibleInfo(bool full /* = false */) const
o << "Compatible Map size: " << CompatibleMapStore.size() << "\n";
if (full)
for (LfgCompatibleContainer::const_iterator itr = CompatibleMapStore.begin(); itr != CompatibleMapStore.end(); ++itr)
- o << "(" << itr->first << "): " << GetCompatibleString(itr->second.compatibility) << "\n";
+ {
+ o << "(" << itr->first << "): " << GetCompatibleString(itr->second.compatibility);
+ if (!itr->second.roles.empty())
+ {
+ o << " (";
+ bool first = true;
+ for (const auto& role : itr->second.roles)
+ {
+ if (!first)
+ o << "|";
+ o << role.first.GetRawValue() << " " << GetRolesString(role.second & uint8(~PLAYER_ROLE_LEADER));
+ first = false;
+ }
+ o << ")";
+ }
+ o << "\n";
+ }
return o.str();
}
diff --git a/src/server/game/DungeonFinding/LFGQueue.h b/src/server/game/DungeonFinding/LFGQueue.h
index 77683614d49..f72e9b4fd6d 100644
--- a/src/server/game/DungeonFinding/LFGQueue.h
+++ b/src/server/game/DungeonFinding/LFGQueue.h
@@ -88,7 +88,7 @@ class LFGQueue
public:
// Add/Remove from queue
- std::string GetDetailedMatchRoles(GuidList const& check);
+ std::string GetDetailedMatchRoles(GuidList const& check) const;
void AddToQueue(ObjectGuid guid);
void RemoveFromQueue(ObjectGuid guid);
void AddQueueData(ObjectGuid guid, time_t joinTime, LfgDungeonSet const& dungeons, LfgRolesMap const& rolesMap);
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 88d7dfa6381..25531760b69 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -8335,9 +8335,6 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
return;
}
- // use triggered flag only for items with many spell casts and for not first cast
- uint8 count = 0;
-
// item spells cast at use
for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
{
@@ -8358,13 +8355,12 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
continue;
}
- Spell* spell = new Spell(this, spellInfo, (count > 0) ? TRIGGERED_FULL_MASK : TRIGGERED_NONE);
+ Spell* spell = new Spell(this, spellInfo, TRIGGERED_NONE);
spell->m_CastItem = item;
spell->m_cast_count = cast_count; // set count of casts
spell->m_glyphIndex = glyphIndex; // glyph index
spell->prepare(&targets);
-
- ++count;
+ return;
}
// Item enchantments spells cast at use
@@ -8386,13 +8382,12 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
continue;
}
- Spell* spell = new Spell(this, spellInfo, (count > 0) ? TRIGGERED_FULL_MASK : TRIGGERED_NONE);
+ Spell* spell = new Spell(this, spellInfo, TRIGGERED_NONE);
spell->m_CastItem = item;
spell->m_cast_count = cast_count; // set count of casts
spell->m_glyphIndex = glyphIndex; // glyph index
spell->prepare(&targets);
-
- ++count;
+ return;
}
}
}
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index d02a22d43f4..0978adc1814 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -13171,6 +13171,10 @@ bool Unit::IsInFeralForm() const
bool Unit::IsInDisallowedMountForm() const
{
+ if (SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(getTransForm()))
+ if (transformSpellInfo->HasAttribute(SPELL_ATTR0_CASTABLE_WHILE_MOUNTED))
+ return false;
+
if (ShapeshiftForm form = GetShapeshiftForm())
{
SpellShapeshiftEntry const* shapeshift = sSpellShapeshiftStore.LookupEntry(form);
diff --git a/src/server/scripts/Commands/cs_lfg.cpp b/src/server/scripts/Commands/cs_lfg.cpp
index d1662f3a97c..8bb64a454d2 100644
--- a/src/server/scripts/Commands/cs_lfg.cpp
+++ b/src/server/scripts/Commands/cs_lfg.cpp
@@ -150,7 +150,7 @@ public:
static bool HandleLfgQueueInfoCommand(ChatHandler* handler, char const* args)
{
- handler->SendSysMessage(sLFGMgr->DumpQueueInfo(*args != '\0').c_str());
+ handler->SendSysMessage(sLFGMgr->DumpQueueInfo(*args != '\0').c_str(), true);
return true;
}