From 72ab40c2e297c63f180b26bc8f7e1098438fbe29 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sat, 1 Jun 2024 18:44:36 +0800 Subject: [PATCH] [bot] Implement `CNetGame::Packet_ConnectAttemptFailed(...)` * Update `CNetGame::UpdateNetwork()` --- bot/net/netgame.cpp | 13 ++++++++++++- bot/net/netgame.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/bot/net/netgame.cpp b/bot/net/netgame.cpp index c846717..3c6b804 100644 --- a/bot/net/netgame.cpp +++ b/bot/net/netgame.cpp @@ -303,7 +303,9 @@ void CNetGame::UpdateNetwork() case ID_MODIFIED_PACKET: Packet_ModifiedPacket(pkt); break; - + case ID_CONNECTION_ATTEMPT_FAILED: + Packet_ConnectAttemptFailed(pkt); + break; case ID_CONNECTION_REQUEST_ACCEPTED: Packet_ConnectionSucceeded(pkt); break; @@ -399,6 +401,15 @@ void CNetGame::Packet_ModifiedPacket(Packet* packet) { } +//---------------------------------------------------- +// RST + +void CNetGame::Packet_ConnectAttemptFailed(Packet* packet) +{ + //logprintf("NPC: Connection attempt failed."); + exit(1); +} + //---------------------------------------------------- // Connection Success diff --git a/bot/net/netgame.h b/bot/net/netgame.h index 671a154..b4e81f9 100644 --- a/bot/net/netgame.h +++ b/bot/net/netgame.h @@ -28,6 +28,7 @@ private: void Packet_ConnectionBanned(Packet* packet); void Packet_DisconnectionNotification(Packet* packet); void Packet_ModifiedPacket(Packet* packet); + void Packet_ConnectAttemptFailed(Packet* packet); void Packet_TrailerSync(Packet *p); int m_iSpawnsAvailable;