mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:53:50 +00:00
[Client] Add commit hash to password
This commit is contained in:
parent
bc3612dfe9
commit
565889ccbc
3 changed files with 12 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
||||||
#include <components/openmw-mp/Version.hpp>
|
#include <components/openmw-mp/Version.hpp>
|
||||||
|
|
||||||
#include <components/esm/esmwriter.hpp>
|
#include <components/esm/esmwriter.hpp>
|
||||||
|
#include <components/files/escape.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
|
|
||||||
|
@ -52,6 +53,12 @@ using namespace std;
|
||||||
Main *Main::pMain = 0;
|
Main *Main::pMain = 0;
|
||||||
std::string Main::addr = "";
|
std::string Main::addr = "";
|
||||||
std::string Main::passw = TES3MP_DEFAULT_PASSW;
|
std::string Main::passw = TES3MP_DEFAULT_PASSW;
|
||||||
|
std::string Main::resourceDir = "";
|
||||||
|
|
||||||
|
std::string Main::getResDir()
|
||||||
|
{
|
||||||
|
return resourceDir;
|
||||||
|
}
|
||||||
|
|
||||||
std::string loadSettings (Settings::Manager & settings)
|
std::string loadSettings (Settings::Manager & settings)
|
||||||
{
|
{
|
||||||
|
@ -115,6 +122,7 @@ void Main::configure(const boost::program_options::variables_map &variables)
|
||||||
{
|
{
|
||||||
Main::addr = variables["connect"].as<string>();
|
Main::addr = variables["connect"].as<string>();
|
||||||
Main::passw = variables["password"].as<string>();
|
Main::passw = variables["password"].as<string>();
|
||||||
|
resourceDir = variables["resources"].as<Files::EscapeHashString>().toStdString();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Settings::CategorySettingValueMap saveUserSettings;
|
static Settings::CategorySettingValueMap saveUserSettings;
|
||||||
|
|
|
@ -29,6 +29,7 @@ namespace mwmp
|
||||||
static void pressedKey(int key);
|
static void pressedKey(int key);
|
||||||
|
|
||||||
static bool isValidPacketScript(std::string script);
|
static bool isValidPacketScript(std::string script);
|
||||||
|
static std::string getResDir();
|
||||||
|
|
||||||
Networking *getNetworking() const;
|
Networking *getNetworking() const;
|
||||||
LocalPlayer *getLocalPlayer() const;
|
LocalPlayer *getLocalPlayer() const;
|
||||||
|
@ -39,6 +40,7 @@ namespace mwmp
|
||||||
void updateWorld(float dt) const;
|
void updateWorld(float dt) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
static std::string resourceDir;
|
||||||
static std::string addr;
|
static std::string addr;
|
||||||
static std::string passw;
|
static std::string passw;
|
||||||
Main (const Main&);
|
Main (const Main&);
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <SDL_messagebox.h>
|
#include <SDL_messagebox.h>
|
||||||
#include <RakSleep.h>
|
#include <RakSleep.h>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <components/version/version.hpp>
|
||||||
|
|
||||||
#include "Networking.hpp"
|
#include "Networking.hpp"
|
||||||
#include "Main.hpp"
|
#include "Main.hpp"
|
||||||
|
@ -250,6 +251,7 @@ void Networking::connect(const std::string &ip, unsigned short port, std::vector
|
||||||
|
|
||||||
stringstream sstr(TES3MP_VERSION);
|
stringstream sstr(TES3MP_VERSION);
|
||||||
sstr << TES3MP_PROTO_VERSION;
|
sstr << TES3MP_PROTO_VERSION;
|
||||||
|
sstr << Version::getOpenmwVersion(Main::getResDir()).mCommitHash;
|
||||||
|
|
||||||
if (peer->Connect(master.ToString(false), master.GetPort(), sstr.str().c_str(), (int) sstr.str().size(), 0, 0, 3, 500, 0) != RakNet::CONNECTION_ATTEMPT_STARTED)
|
if (peer->Connect(master.ToString(false), master.GetPort(), sstr.str().c_str(), (int) sstr.str().size(), 0, 0, 3, 500, 0) != RakNet::CONNECTION_ATTEMPT_STARTED)
|
||||||
errmsg = "Connection attempt failed.\n";
|
errmsg = "Connection attempt failed.\n";
|
||||||
|
|
Loading…
Reference in a new issue