From 0b40cb89193fcaefe8a658e6fdf418d71cf77acc Mon Sep 17 00:00:00 2001 From: David Cernat Date: Wed, 3 May 2017 03:14:11 +0300 Subject: [PATCH] [Client] When there are more client than server plugins, print them all --- apps/openmw/mwmp/Networking.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 9f7ff6c6f..21fad1106 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -144,7 +144,7 @@ string comparePluginsMonospaced(PacketPreInit::PluginContainer checksums, Packet printWithWidth(sstr, "name", pluginNameLen2 + 2); sstr << "hash\n"; - for (size_t i = 0; i < checksumsResponse.size(); i++) + for (size_t i = 0; i < checksums.size() || i < checksumsResponse.size(); i++) { string plugin; unsigned val; @@ -162,17 +162,21 @@ string comparePluginsMonospaced(PacketPreInit::PluginContainer checksums, Packet printWithWidth(sstr, "", pluginNameLen1 + 16); } - printWithWidth(sstr, checksumsResponse[i].first, pluginNameLen2 + 2); - if (checksumsResponse[i].second.size() > 0) + if (i < checksumsResponse.size()) { - if (full) - for (size_t j = 0; j < checksumsResponse[i].second.size(); j++) - printWithWidth(sstr, intToHexStr(checksumsResponse[i].second[j]), 14); + printWithWidth(sstr, checksumsResponse[i].first, pluginNameLen2 + 2); + if (checksumsResponse[i].second.size() > 0) + { + if (full) + for (size_t j = 0; j < checksumsResponse[i].second.size(); j++) + printWithWidth(sstr, intToHexStr(checksumsResponse[i].second[j]), 14); + else + sstr << intToHexStr(checksumsResponse[i].second[0]); + } else - sstr << intToHexStr(checksumsResponse[i].second[0]); + sstr << "any"; } - else - sstr << "any"; + sstr << "\n"; }