1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 18:19:55 +00:00

[General] Reorder RW(string) arguments

Change limit of default max string size to 64 KiB
This commit is contained in:
Koncord 2018-07-03 01:12:59 +08:00
parent f9ebe400f7
commit 695fb7d4a7
2 changed files with 6 additions and 4 deletions

View file

@ -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<string, ServerRule>(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);
}
}

View file

@ -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)
{