diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 4fc971396..0d70d3f8a 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -350,6 +350,33 @@ Networking *Networking::getPtr() return sThis; } +Networking::PluginListSample Networking::getPluginListSample() +{ + PluginListSample pls; + unsigned id = 0; + while(true) + { + unsigned field = 0; + auto name = ""; + Script::Call(name, id, field); + if(strlen(name) == 0) + break; + HashList hashList; + while(true) + { + auto hash = ""; + Script::Call(hash, id, field); + if(strlen(hash) == 0) + break; + hashList.push_back((unsigned)stoul(hash)); + field++; + } + pls.push_back({name, hashList}); + id++; + } + return pls; +} + void Networking::stopServer(int code) { running = false; diff --git a/apps/openmw-mp/Networking.hpp b/apps/openmw-mp/Networking.hpp index bcdfede6d..a905be3be 100644 --- a/apps/openmw-mp/Networking.hpp +++ b/apps/openmw-mp/Networking.hpp @@ -55,7 +55,10 @@ namespace mwmp static const Networking &get(); static Networking *getPtr(); + typedef std::vector HashList; + typedef std::vector> PluginListSample; private: + PluginListSample getPluginListSample(); std::string serverPassword; static Networking *sThis;