diff --git a/apps/openmw-mp/MasterClient.cpp b/apps/openmw-mp/MasterClient.cpp index dcb787e69..3742b0d6e 100644 --- a/apps/openmw-mp/MasterClient.cpp +++ b/apps/openmw-mp/MasterClient.cpp @@ -10,6 +10,7 @@ #include #include "MasterClient.hpp" #include +#include #include "Networking.hpp" using namespace std; @@ -69,7 +70,9 @@ MasterClient::Send(std::string hostname, std::string modname, unsigned maxPlayer sstr << "\"hostname\": \"" << hostname.c_str() << "\", "; sstr << "\"modname\": \"" << modname.c_str() << "\", "; sstr << "\"players\": " << players << ", "; - sstr << "\"max_players\": " << maxPlayers; + sstr << "\"max_players\": " << maxPlayers << ", "; + sstr << "\"version\": " << TES3MP_VERSION << ", "; + sstr << "\"passw\": " << mwmp::Networking::get().isPassworded(); sstr << "}"; mutexData.unlock(); diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 6fc12a321..17aff7a26 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -64,6 +64,11 @@ void Networking::setServerPassword(std::string passw) noexcept serverPassword = passw.empty() ? TES3MP_DEFAULT_PASSW : passw; } +bool Networking::isPassworded() const +{ + return serverPassword != TES3MP_DEFAULT_PASSW; +} + void Networking::processPlayerPacket(RakNet::Packet *packet) { Player *player = Players::getPlayer(packet->guid); diff --git a/apps/openmw-mp/Networking.hpp b/apps/openmw-mp/Networking.hpp index 6aa8e1f77..046e46471 100644 --- a/apps/openmw-mp/Networking.hpp +++ b/apps/openmw-mp/Networking.hpp @@ -41,6 +41,7 @@ namespace mwmp MasterClient *getMasterClient(); void InitQuery(std::string queryAddr, unsigned short queryPort, std::string serverAddr, unsigned short serverPort); void setServerPassword(std::string passw) noexcept; + bool isPassworded() const; static const Networking &get(); static Networking *getPtr();