Skip to content

Commit

Permalink
cleanup protocol_zt
Browse files Browse the repository at this point in the history
- get rid of current_ms
- implement and call zerotier_network_stop in the destructor
  • Loading branch information
pionere committed Nov 19, 2023
1 parent d0278ce commit 402ccc1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 2 additions & 5 deletions Source/dvlnet/protocol_zt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ void protocol_zt::close_all()
protocol_zt::~protocol_zt()
{
close_all();

zerotier_network_stop();
}

void protocol_zt::endpoint::from_string(const std::string& str)
Expand All @@ -311,11 +313,6 @@ void protocol_zt::endpoint::to_addr(unsigned char* dest_addr) const
memcpy(dest_addr, addr.data(), sizeof(addr));
}

uint64_t protocol_zt::current_ms()
{
return 0;
}

void protocol_zt::make_default_gamename(char (&gamename)[NET_MAX_GAMENAME_LEN + 1])
{
int i;
Expand Down
1 change: 0 additions & 1 deletion Source/dvlnet/protocol_zt.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class protocol_zt {
int fd_tcp = -1;
int fd_udp = -1;

static uint64_t current_ms();
void close_all();

static void set_nonblock(int fd);
Expand Down
5 changes: 5 additions & 0 deletions Source/dvlnet/zerotier_native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ void zerotier_network_start()
zts_node_start();
}

void zerotier_network_stop()
{
zts_node_stop();
}

} // namespace net
DEVILUTION_END_NAMESPACE
#endif // ZEROTIER

0 comments on commit 402ccc1

Please sign in to comment.