From f80a16b897bb42722807f667b440e596f5111097 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Wed, 3 May 2017 00:15:43 +0300 Subject: [PATCH] [Client] Don't use try/catch when printing missing plugins Also move load order note to bottom where it fits better. --- apps/openmw/mwmp/Networking.cpp | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 1e0cdd849..7d20f2987 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -60,7 +60,6 @@ string comparePlugins(PacketPreInit::PluginContainer checksums, PacketPreInit::P bool full = false) { std::ostringstream sstr; - sstr << "Note: Use the same load order as the server.\n"; size_t pluginNameLen1 = 0; size_t pluginNameLen2 = 0; for (size_t i = 0; i < checksums.size(); i++) @@ -82,27 +81,20 @@ string comparePlugins(PacketPreInit::PluginContainer checksums, PacketPreInit::P { string plugin; unsigned val; - try + + if (i < checksums.size()) { plugin = checksums.at(i).first; val = checksums.at(i).second[0]; - } - catch(exception &e) - { - plugin = "null"; - val = 0; - } - if (plugin == "null") - { - printWithWidth(sstr, "", pluginNameLen1 + 16); - } - else - { printWithWidth(sstr, plugin, pluginNameLen1 + 2); printWithWidth(sstr, intToHexStr(val), 14); } - + else + { + printWithWidth(sstr, "", pluginNameLen1 + 16); + } + printWithWidth(sstr, checksumsResponse[i].first, pluginNameLen2 + 2); if (checksumsResponse[i].second.size() > 0) { @@ -116,7 +108,7 @@ string comparePlugins(PacketPreInit::PluginContainer checksums, PacketPreInit::P sstr << "any"; sstr << "\n"; } - sstr << "\nMore info in logs"; + sstr << "\nNote: Use the same load order as the server."; return sstr.str(); }