diff --git a/components/openmw-mp/Master/ProxyMasterPacket.hpp b/components/openmw-mp/Master/ProxyMasterPacket.hpp index a9920d424..2b0fca1dc 100644 --- a/components/openmw-mp/Master/ProxyMasterPacket.hpp +++ b/components/openmw-mp/Master/ProxyMasterPacket.hpp @@ -44,7 +44,7 @@ namespace mwmp rule = &ruleIt->second; } - packet->RW(key, send, QueryData::maxStringLength); + packet->RW(key, send, false, QueryData::maxStringLength); if (!send) { ruleIt = server.rules.insert(pair(key, ServerRule())).first; @@ -77,7 +77,7 @@ namespace mwmp } for(auto &&player : server.players) - packet->RW(player, send, QueryData::maxStringLength); + packet->RW(player, send, false, QueryData::maxStringLength); int32_t pluginsCount = server.plugins.size(); @@ -94,7 +94,7 @@ namespace mwmp for (auto &&plugin : server.plugins) { - packet->RW(plugin.name, send, QueryData::maxStringLength); + packet->RW(plugin.name, send, false, QueryData::maxStringLength); packet->RW(plugin.hash, send); } } diff --git a/components/openmw-mp/Packets/BasePacket.hpp b/components/openmw-mp/Packets/BasePacket.hpp index 928a7ea0b..bca5cc75d 100644 --- a/components/openmw-mp/Packets/BasePacket.hpp +++ b/components/openmw-mp/Packets/BasePacket.hpp @@ -76,7 +76,9 @@ namespace mwmp bs->Read(data); } - void RW(std::string &str, bool write, std::string::size_type maxSize = std::string::npos, bool compress = false) + const static uint32_t maxStrSize = 64 * 1024; // 64 KiB + + void RW(std::string &str, bool write, bool compress = false, std::string::size_type maxSize = maxStrSize) { if (write) {