mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-21 05:44:06 +00:00
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/concepts.hpp>
|
||||||
#include <boost/iostreams/stream_buffer.hpp>
|
#include <boost/iostreams/stream_buffer.hpp>
|
||||||
#include <boost/filesystem/fstream.hpp>
|
#include <boost/filesystem/fstream.hpp>
|
||||||
|
#include <components/openmw-mp/Version.hpp>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace mwmp;
|
using namespace mwmp;
|
||||||
|
@ -140,7 +141,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
vector<string> plugins (Utils::split(mgr.getString("plugins", "Plugins"), ','));
|
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);
|
setenv("AMXFILE", moddir.c_str(), 1);
|
||||||
|
@ -153,8 +154,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
RakNet::RakPeerInterface *peer = RakNet::RakPeerInterface::GetInstance();
|
RakNet::RakPeerInterface *peer = RakNet::RakPeerInterface::GetInstance();
|
||||||
|
|
||||||
const char passw[8] = "1234567";
|
peer->SetIncomingPassword(TES3MP_VERSION, (int)strlen(TES3MP_VERSION));
|
||||||
peer->SetIncomingPassword(passw, sizeof(passw));
|
|
||||||
|
|
||||||
if (RakNet::NonNumericHostString(addr.c_str()))
|
if (RakNet::NonNumericHostString(addr.c_str()))
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include "Networking.hpp"
|
#include "Networking.hpp"
|
||||||
#include "../mwstate/statemanagerimp.hpp"
|
#include "../mwstate/statemanagerimp.hpp"
|
||||||
#include <components/openmw-mp/Log.hpp>
|
#include <components/openmw-mp/Log.hpp>
|
||||||
|
#include <components/openmw-mp/Version.hpp>
|
||||||
#include "DedicatedPlayer.hpp"
|
#include "DedicatedPlayer.hpp"
|
||||||
#include "Main.hpp"
|
#include "Main.hpp"
|
||||||
|
|
||||||
|
@ -100,10 +101,9 @@ void Networking::Connect(const std::string &ip, unsigned short port)
|
||||||
RakNet::SystemAddress master;
|
RakNet::SystemAddress master;
|
||||||
master.SetBinaryAddress(ip.c_str());
|
master.SetBinaryAddress(ip.c_str());
|
||||||
master.SetPortHostOrder(port);
|
master.SetPortHostOrder(port);
|
||||||
const char passw[8] = "1234567";
|
|
||||||
std::string errmsg = "";
|
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";
|
errmsg = "Connection attempt failed.\n";
|
||||||
|
|
||||||
bool queue = true;
|
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