[General] Move password of master server to header

0.6.1
Koncord 8 years ago
parent 056ec2d434
commit a9fc096c9a

@ -6,6 +6,7 @@
#include <RakSleep.h> #include <RakSleep.h>
#include <components/openmw-mp/NetworkMessages.hpp> #include <components/openmw-mp/NetworkMessages.hpp>
#include <iostream> #include <iostream>
#include <components/openmw-mp/Version.hpp>
using namespace RakNet; using namespace RakNet;
using namespace std; using namespace std;
@ -124,7 +125,8 @@ MASTER_PACKETS QueryClient::GetAnswer()
ConnectionState QueryClient::Connect() ConnectionState QueryClient::Connect()
{ {
ConnectionAttemptResult car = peer->Connect(masterAddr.ToString(false), masterAddr.GetPort(), "pass", strlen("pass"), 0, 0, 5, 500); ConnectionAttemptResult car = peer->Connect(masterAddr.ToString(false), masterAddr.GetPort(), TES3MP_MASTERSERVER_PASSW,
strlen(TES3MP_MASTERSERVER_PASSW), 0, 0, 5, 500);
while (true) while (true)
{ {

@ -11,6 +11,7 @@
#include <components/openmw-mp/Master/PacketMasterQuery.hpp> #include <components/openmw-mp/Master/PacketMasterQuery.hpp>
#include <components/openmw-mp/Master/PacketMasterUpdate.hpp> #include <components/openmw-mp/Master/PacketMasterUpdate.hpp>
#include <components/openmw-mp/Master/PacketMasterAnnounce.hpp> #include <components/openmw-mp/Master/PacketMasterAnnounce.hpp>
#include <components/openmw-mp/Version.hpp>
using namespace RakNet; using namespace RakNet;
using namespace std; using namespace std;
@ -23,7 +24,7 @@ MasterServer::MasterServer(unsigned short maxConnections, unsigned short port)
peer->Startup(maxConnections, &sockdescr, 1, 1000); peer->Startup(maxConnections, &sockdescr, 1, 1000);
peer->SetMaximumIncomingConnections(maxConnections); peer->SetMaximumIncomingConnections(maxConnections);
peer->SetIncomingPassword("pass", (int) strlen("pass")); peer->SetIncomingPassword(TES3MP_MASTERSERVER_PASSW, (int) strlen(TES3MP_MASTERSERVER_PASSW));
run = false; run = false;
} }

@ -155,7 +155,8 @@ bool MasterClient::Process(RakNet::Packet *packet)
void MasterClient::Send(mwmp::PacketMasterAnnounce::Func func) void MasterClient::Send(mwmp::PacketMasterAnnounce::Func func)
{ {
peer->Connect(masterServer.ToString(false), masterServer.GetPort(), "pass", strlen("pass"), 0, 0, 5, 500); peer->Connect(masterServer.ToString(false), masterServer.GetPort(), TES3MP_MASTERSERVER_PASSW,
strlen(TES3MP_MASTERSERVER_PASSW), 0, 0, 5, 500);
bool waitForConnect = true; bool waitForConnect = true;
while (waitForConnect) while (waitForConnect)
{ {

@ -9,5 +9,6 @@
#define TES3MP_PROTO_VERSION 7 #define TES3MP_PROTO_VERSION 7
#define TES3MP_DEFAULT_PASSW "SuperPassword" #define TES3MP_DEFAULT_PASSW "SuperPassword"
#define TES3MP_MASTERSERVER_PASSW "12345"
#endif //OPENMW_VERSION_HPP #endif //OPENMW_VERSION_HPP

Loading…
Cancel
Save