diff --git a/data/scripts/actions/items/exercise_training_weapons.lua b/data/scripts/actions/items/exercise_training_weapons.lua index 4a72f19e5c8..3c62d7c1183 100644 --- a/data/scripts/actions/items/exercise_training_weapons.lua +++ b/data/scripts/actions/items/exercise_training_weapons.lua @@ -133,7 +133,7 @@ end local exerciseTraining = Action() function exerciseTraining.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if not target or not target:getId() then + if not target or type(target) == "table" or not target:getId() then return true end diff --git a/src/creatures/creature.cpp b/src/creatures/creature.cpp index 6101ff0473d..9684e03b6d2 100644 --- a/src/creatures/creature.cpp +++ b/src/creatures/creature.cpp @@ -805,7 +805,8 @@ bool Creature::dropCorpse(std::shared_ptr lastHitCreature, std::shared auto monster = getMonster(); if (monster && !monster->isRewardBoss()) { std::ostringstream lootMessage; - lootMessage << "Loot of " << getNameDescription() << ": " << corpseContainer->getContentDescription(player->getProtocolVersion() < 1200) << "."; + auto collorMessage = player->getProtocolVersion() < 1200 || player->getOperatingSystem() >= CLIENTOS_OTCLIENT_LINUX; + lootMessage << "Loot of " << getNameDescription() << ": " << corpseContainer->getContentDescription(collorMessage) << "."; auto suffix = corpseContainer->getAttribute(ItemAttribute_t::LOOTMESSAGE_SUFFIX); if (!suffix.empty()) { lootMessage << suffix; diff --git a/src/items/containers/container.cpp b/src/items/containers/container.cpp index 7bd7dcef2c9..5d2ffd98769 100644 --- a/src/items/containers/container.cpp +++ b/src/items/containers/container.cpp @@ -218,7 +218,7 @@ std::string Container::getContentDescription(bool oldProtocol) { return getContentDescription(os, oldProtocol).str(); } -std::ostringstream &Container::getContentDescription(std::ostringstream &os, bool oldProtocol) { +std::ostringstream &Container::getContentDescription(std::ostringstream &os, bool sendColoredMessage) { bool firstitem = true; for (ContainerIterator it = iterator(); it.hasNext(); it.advance()) { std::shared_ptr item = *it; @@ -234,10 +234,10 @@ std::ostringstream &Container::getContentDescription(std::ostringstream &os, boo os << ", "; } - if (oldProtocol) { - os << item->getNameDescription(); - } else { + if (sendColoredMessage) { os << "{" << item->getID() << "|" << item->getNameDescription() << "}"; + } else { + os << item->getNameDescription(); } } diff --git a/src/server/network/connection/connection.cpp b/src/server/network/connection/connection.cpp index cc27eb0e9eb..1c575ff00d0 100644 --- a/src/server/network/connection/connection.cpp +++ b/src/server/network/connection/connection.cpp @@ -399,9 +399,9 @@ void Connection::handleTimeout(ConnectionWeak_ptr connectionWeak, const std::err if (auto connection = connectionWeak.lock()) { if (!error) { - g_logger().warn("Connection Timeout, IP: {}", convertIPToString(connection->getIP())); + g_logger().debug("Connection Timeout, IP: {}", convertIPToString(connection->getIP())); } else { - g_logger().warn("Connection Timeout or error: {}, IP: {}", error.message(), convertIPToString(connection->getIP())); + g_logger().debug("Connection Timeout or error: {}, IP: {}", error.message(), convertIPToString(connection->getIP())); } connection->close(FORCE_CLOSE); } diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 6a7fb70a631..891c4c4289b 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -8829,7 +8829,7 @@ void ProtocolGame::parseSaveWheel(NetworkMessage &msg) { } void ProtocolGame::sendDisableLoginMusic() { - if (oldProtocol) { + if (oldProtocol || !player || player->getOperatingSystem() >= CLIENTOS_OTCLIENT_LINUX) { return; }