Network fixes suggested by glebm

This commit is contained in:
Xadhoom 2021-04-28 11:46:50 +00:00 committed by Anders Jenbo
commit b4f2beed6d
4 changed files with 6 additions and 9 deletions

View file

@ -403,7 +403,6 @@ if(NOT NONET)
Source/dvlnet/tcp_client.cpp
Source/dvlnet/tcp_server.cpp
Source/dvlnet/protocol_zt.cpp
Source/dvlnet/base_protocol.cpp
Source/dvlnet/zerotier_native.cpp
Source/dvlnet/zerotier_lwip.cpp)
endif()

View file

@ -1,8 +0,0 @@
#include "dvlnet/base_protocol.h"
#include <SDL.h>
#include <algorithm>
#ifdef USE_SDL1
#include "utils/sdl2_to_1_2_backports.h"
#endif

View file

@ -190,6 +190,7 @@ void base_protocol<P>::recv()
for (plr_t i = 0; i < MAX_PLRS; ++i) {
if (peers[i] == sender) {
disconnect_net(i);
break;
}
}
}

View file

@ -39,6 +39,11 @@ public:
return addr == rhs.addr;
}
bool operator!=(const endpoint &rhs) const
{
return !(*this == rhs);
}
bool operator<(const endpoint &rhs) const
{
return addr < rhs.addr;