Include protocol in nodes

This commit is contained in:
momo5502 2016-06-14 15:04:58 +02:00
parent 9c8904d561
commit 66671fa817
4 changed files with 5 additions and 3 deletions

View File

@ -142,6 +142,7 @@ namespace Components
Proto::Node::List list;
list.set_is_dedi(Dedicated::IsDedicated());
list.set_protocol(PROTOCOL);
for (auto node : Node::Nodes)
{
@ -690,10 +691,11 @@ namespace Components
Logger::Print("Received valid node list with %i entries from %s\n", list.address_size(), address.GetCString());
entry->isDedi = list.is_dedi();
entry->protocol = list.protocol();
entry->state = Node::STATE_VALID;
entry->lastTime = Game::Com_Milliseconds();
if (!Dedicated::IsDedicated() && entry->isDedi && ServerList::IsOnlineList())
if (!Dedicated::IsDedicated() && entry->isDedi && ServerList::IsOnlineList() && entry->protocol == PROTOCOL)
{
ServerList::InsertRequest(entry->address, true);
}

View File

@ -46,6 +46,7 @@ namespace Components
// This is only relevant for clients
bool isDedi;
uint32_t protocol;
};
struct ClientSession

View File

@ -14,4 +14,5 @@ message List
{
bool is_dedi = 1;
repeated Network.Address address = 2;
uint32 protocol = 3;
}

View File

@ -60,8 +60,6 @@
#define LTC_NO_PROTOTYPES
#define LTC_NO_RSA_BLINDING
#define ASIO_STANDALONE
#include <zlib.h>
#include <curses.h>
#include <mongoose.h>