forked from teamnwah/openmw-tes3coop
[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/esm/esmwriter.hpp>
|
||||
#include <components/files/escape.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
|
||||
|
@ -52,6 +53,12 @@ using namespace std;
|
|||
Main *Main::pMain = 0;
|
||||
std::string Main::addr = "";
|
||||
std::string Main::passw = TES3MP_DEFAULT_PASSW;
|
||||
std::string Main::resourceDir = "";
|
||||
|
||||
std::string Main::getResDir()
|
||||
{
|
||||
return resourceDir;
|
||||
}
|
||||
|
||||
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::passw = variables["password"].as<string>();
|
||||
resourceDir = variables["resources"].as<Files::EscapeHashString>().toStdString();
|
||||
}
|
||||
|
||||
static Settings::CategorySettingValueMap saveUserSettings;
|
||||
|
|
|
@ -29,6 +29,7 @@ namespace mwmp
|
|||
static void pressedKey(int key);
|
||||
|
||||
static bool isValidPacketScript(std::string script);
|
||||
static std::string getResDir();
|
||||
|
||||
Networking *getNetworking() const;
|
||||
LocalPlayer *getLocalPlayer() const;
|
||||
|
@ -39,6 +40,7 @@ namespace mwmp
|
|||
void updateWorld(float dt) const;
|
||||
|
||||
private:
|
||||
static std::string resourceDir;
|
||||
static std::string addr;
|
||||
static std::string passw;
|
||||
Main (const Main&);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <SDL_messagebox.h>
|
||||
#include <RakSleep.h>
|
||||
#include <iomanip>
|
||||
#include <components/version/version.hpp>
|
||||
|
||||
#include "Networking.hpp"
|
||||
#include "Main.hpp"
|
||||
|
@ -250,6 +251,7 @@ void Networking::connect(const std::string &ip, unsigned short port, std::vector
|
|||
|
||||
stringstream sstr(TES3MP_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)
|
||||
errmsg = "Connection attempt failed.\n";
|
||||
|
|
Loading…
Reference in a new issue