feat: add MeshPort overlay networking, item actions window, and AVA2 client enhancements
- add MeshPort peer-to-peer overlay networking SDK, C++ integration, and Python bindings - add item actions quick use/split/delete/lock overlay window (mt_item_actions) - add shop name range and NPC name visibility settings to system display options - support battlepass ticket activation and month validation in mt_battlepass - support boss tracking teleport destination button in mt_bosses - support asynchronous account registration cancellation and pending login cancellation - update AVA2 item conversion for attr lock scrolls and battlepass tickets - update .gitignore for local build outputs and caches
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
#include "StdAfx.h"
|
||||
#include "NetStream.h"
|
||||
#ifdef MT_HAS_MESHPORT
|
||||
#include "transport.h" // PORT: application-only mesh transport, including account/warp/mark sockets.
|
||||
#endif
|
||||
//#include "eterCrypt.h"
|
||||
|
||||
#ifndef _IMPROVED_PACKET_ENCRYPTION_
|
||||
@@ -288,6 +291,19 @@ void CNetworkStream::Process()
|
||||
if (m_sock == INVALID_SOCKET)
|
||||
return;
|
||||
|
||||
#ifdef MT_HAS_MESHPORT
|
||||
if (!m_isOnline && mt::meshport::pending(m_sock))
|
||||
{
|
||||
const int state = mt::meshport::poll_socket(m_sock);
|
||||
if (state < 0 || time(NULL) > m_connectLimitTime)
|
||||
{
|
||||
Clear();
|
||||
OnConnectFailure();
|
||||
return;
|
||||
}
|
||||
if (state == 0) return;
|
||||
}
|
||||
#endif
|
||||
fd_set fdsRecv;
|
||||
fd_set fdsSend;
|
||||
|
||||
@@ -373,6 +389,9 @@ void CNetworkStream::Clear()
|
||||
m_cipher.CleanUp();
|
||||
#endif
|
||||
|
||||
#ifdef MT_HAS_MESHPORT
|
||||
mt::meshport::forget_socket(m_sock); // PORT: discard partial SOCKS negotiation before fd reuse.
|
||||
#endif
|
||||
closesocket(m_sock);
|
||||
m_sock = INVALID_SOCKET;
|
||||
|
||||
@@ -416,7 +435,12 @@ bool CNetworkStream::Connect(const CNetworkAddress& c_rkNetAddr, int limitSec)
|
||||
DWORD arg = 1;
|
||||
ioctlsocket(m_sock, FIONBIO, &arg); // Non-blocking mode
|
||||
|
||||
if (connect(m_sock, (PSOCKADDR)&m_addr, m_addr.GetSize()) == SOCKET_ERROR)
|
||||
#ifdef MT_HAS_MESHPORT
|
||||
const int connectResult = mt::meshport::connect_socket(m_sock, static_cast<const SOCKADDR_IN&>(m_addr), this);
|
||||
#else
|
||||
const int connectResult = connect(m_sock, (PSOCKADDR)&m_addr, m_addr.GetSize());
|
||||
#endif
|
||||
if (connectResult == SOCKET_ERROR)
|
||||
{
|
||||
int error = WSAGetLastError();
|
||||
|
||||
@@ -430,6 +454,9 @@ bool CNetworkStream::Connect(const CNetworkAddress& c_rkNetAddr, int limitSec)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MT_HAS_MESHPORT
|
||||
if (mt::meshport::pending(m_sock) && limitSec < 75) limitSec = 75; // PORT: DHCP/routes plus remote SOCKS connect.
|
||||
#endif
|
||||
m_connectLimitTime = time(NULL) + limitSec;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user