mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 02:45:32 +00:00
[General] Move password of master server to header
This commit is contained in:
parent
056ec2d434
commit
a9fc096c9a
4 changed files with 8 additions and 3 deletions
|
@ -6,6 +6,7 @@
|
|||
#include <RakSleep.h>
|
||||
#include <components/openmw-mp/NetworkMessages.hpp>
|
||||
#include <iostream>
|
||||
#include <components/openmw-mp/Version.hpp>
|
||||
|
||||
using namespace RakNet;
|
||||
using namespace std;
|
||||
|
@ -124,7 +125,8 @@ MASTER_PACKETS QueryClient::GetAnswer()
|
|||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <components/openmw-mp/Master/PacketMasterQuery.hpp>
|
||||
#include <components/openmw-mp/Master/PacketMasterUpdate.hpp>
|
||||
#include <components/openmw-mp/Master/PacketMasterAnnounce.hpp>
|
||||
#include <components/openmw-mp/Version.hpp>
|
||||
|
||||
using namespace RakNet;
|
||||
using namespace std;
|
||||
|
@ -23,7 +24,7 @@ MasterServer::MasterServer(unsigned short maxConnections, unsigned short port)
|
|||
peer->Startup(maxConnections, &sockdescr, 1, 1000);
|
||||
|
||||
peer->SetMaximumIncomingConnections(maxConnections);
|
||||
peer->SetIncomingPassword("pass", (int) strlen("pass"));
|
||||
peer->SetIncomingPassword(TES3MP_MASTERSERVER_PASSW, (int) strlen(TES3MP_MASTERSERVER_PASSW));
|
||||
run = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -155,7 +155,8 @@ bool MasterClient::Process(RakNet::Packet *packet)
|
|||
|
||||
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;
|
||||
while (waitForConnect)
|
||||
{
|
||||
|
|
|
@ -9,5 +9,6 @@
|
|||
#define TES3MP_PROTO_VERSION 7
|
||||
|
||||
#define TES3MP_DEFAULT_PASSW "SuperPassword"
|
||||
#define TES3MP_MASTERSERVER_PASSW "12345"
|
||||
|
||||
#endif //OPENMW_VERSION_HPP
|
||||
|
|
Loading…
Reference in a new issue