forked from mirror/openmw-tes3mp
Now server & client sensitive to version
This commit is contained in:
parent
8a5e32c631
commit
a03c2f5019
3 changed files with 16 additions and 5 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <boost/iostreams/concepts.hpp>
|
||||
#include <boost/iostreams/stream_buffer.hpp>
|
||||
#include <boost/filesystem/fstream.hpp>
|
||||
#include <components/openmw-mp/Version.hpp>
|
||||
|
||||
using namespace std;
|
||||
using namespace mwmp;
|
||||
|
@ -140,7 +141,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
vector<string> plugins (Utils::split(mgr.getString("plugins", "Plugins"), ','));
|
||||
|
||||
printVersion("0.0.1b", 1);
|
||||
printVersion(TES3MP_VERSION, TES3MP_PROTO_VERSION);
|
||||
|
||||
|
||||
setenv("AMXFILE", moddir.c_str(), 1);
|
||||
|
@ -153,8 +154,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
RakNet::RakPeerInterface *peer = RakNet::RakPeerInterface::GetInstance();
|
||||
|
||||
const char passw[8] = "1234567";
|
||||
peer->SetIncomingPassword(passw, sizeof(passw));
|
||||
peer->SetIncomingPassword(TES3MP_VERSION, (int)strlen(TES3MP_VERSION));
|
||||
|
||||
if (RakNet::NonNumericHostString(addr.c_str()))
|
||||
{
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "Networking.hpp"
|
||||
#include "../mwstate/statemanagerimp.hpp"
|
||||
#include <components/openmw-mp/Log.hpp>
|
||||
#include <components/openmw-mp/Version.hpp>
|
||||
#include "DedicatedPlayer.hpp"
|
||||
#include "Main.hpp"
|
||||
|
||||
|
@ -100,10 +101,9 @@ void Networking::Connect(const std::string &ip, unsigned short port)
|
|||
RakNet::SystemAddress master;
|
||||
master.SetBinaryAddress(ip.c_str());
|
||||
master.SetPortHostOrder(port);
|
||||
const char passw[8] = "1234567";
|
||||
std::string errmsg = "";
|
||||
|
||||
if (peer->Connect(master.ToString(false), master.GetPort(), passw, sizeof(passw), 0, 0, 3, 500, 0) != RakNet::CONNECTION_ATTEMPT_STARTED)
|
||||
if (peer->Connect(master.ToString(false), master.GetPort(), TES3MP_VERSION, (int) strlen(TES3MP_VERSION), 0, 0, 3, 500, 0) != RakNet::CONNECTION_ATTEMPT_STARTED)
|
||||
errmsg = "Connection attempt failed.\n";
|
||||
|
||||
bool queue = true;
|
||||
|
|
11
components/openmw-mp/Version.hpp
Normal file
11
components/openmw-mp/Version.hpp
Normal file
|
@ -0,0 +1,11 @@
|
|||
//
|
||||
// Created by koncord on 27.08.16.
|
||||
//
|
||||
|
||||
#ifndef OPENMW_VERSION_HPP
|
||||
#define OPENMW_VERSION_HPP
|
||||
|
||||
#define TES3MP_VERSION "0.0.1b"
|
||||
#define TES3MP_PROTO_VERSION 1
|
||||
|
||||
#endif //OPENMW_VERSION_HPP
|
Loading…
Reference in a new issue