From 5f90bc963303441591cb5e8c74aa52101f05084c Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Fri, 10 May 2024 22:20:46 +0800 Subject: [PATCH] [bot] Implement `CNetGame::Packet_DisconnectionNotification(...)` --- bot/net/netgame.cpp | 13 +++++++++++++ bot/net/netgame.h | 1 + 2 files changed, 14 insertions(+) diff --git a/bot/net/netgame.cpp b/bot/net/netgame.cpp index 34e2560..4738bf1 100644 --- a/bot/net/netgame.cpp +++ b/bot/net/netgame.cpp @@ -261,6 +261,10 @@ void CNetGame::UpdateNetwork() Packet_ConnectionBanned(pkt); break; + case ID_DISCONNECTION_NOTIFICATION: + Packet_DisconnectionNotification(pkt); + break; + case ID_MODIFIED_PACKET: Packet_ModifiedPacket(pkt); break; @@ -344,6 +348,15 @@ void CNetGame::Packet_ConnectionBanned(Packet* packet) //---------------------------------------------------- +void CNetGame::Packet_DisconnectionNotification(Packet* packet) +{ + //OutputDebugString("BOT: Disconnected."); + m_pRakClient->Disconnect(0); + exit(1); +} + +//---------------------------------------------------- + void CNetGame::Packet_ModifiedPacket(Packet* packet) { } diff --git a/bot/net/netgame.h b/bot/net/netgame.h index 648635a..803a81b 100644 --- a/bot/net/netgame.h +++ b/bot/net/netgame.h @@ -21,6 +21,7 @@ private: void Packet_AimSync(Packet *p); void Packet_PassengerSync(Packet *p); void Packet_ConnectionBanned(Packet* packet); + void Packet_DisconnectionNotification(Packet* packet); void Packet_ModifiedPacket(Packet* packet); void Packet_TrailerSync(Packet *p);