From ec63982f4dcb9cc1e31f7d6956bbbfeab8473b6c Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Mon, 15 Jan 2024 23:53:36 +0800 Subject: [PATCH] [bot] Update CNetGame::Init --- bot/net/netgame.cpp | 13 +++++++++++-- bot/net/netgame.h | 6 ++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/bot/net/netgame.cpp b/bot/net/netgame.cpp index 3b9b3da..dc32559 100644 --- a/bot/net/netgame.cpp +++ b/bot/net/netgame.cpp @@ -73,8 +73,8 @@ CNetGame::~CNetGame() //---------------------------------------------------- void CNetGame::Init(PCHAR szHostOrIp, int iPort, - PCHAR szPlayerName, PCHAR szPass, - PCHAR szNpcMode) + PCHAR szPlayerName, PCHAR szPass, + PCHAR szNpcMode) { strcpy(m_szHostName, "San Andreas Multiplayer"); strncpy(m_szHostOrIp, szHostOrIp, sizeof(m_szHostOrIp)); @@ -88,6 +88,15 @@ void CNetGame::Init(PCHAR szHostOrIp, int iPort, m_pPlayerPool->SetLocalPlayerName(szPlayerName); m_pVehiclePool = new CVehiclePool(); + m_pRakClient = RakNetworkFactory::GetRakClientInterface(); + + RegisterRPCs(m_pRakClient); + RegisterScriptRPCs(m_pRakClient); + + + + + // TODO: CNetGame::Init (W: 00416490 L: 080AD126) /* diff --git a/bot/net/netgame.h b/bot/net/netgame.h index 3efd426..b77f3c5 100644 --- a/bot/net/netgame.h +++ b/bot/net/netgame.h @@ -6,8 +6,10 @@ class CNetGame // size: 910 bytes { private: - int field_0; // highly m_pRakClient - CPlayerPool* m_pPlayerPool; + RakClientInterface *m_pRakClient; + CPlayerPool *m_pPlayerPool; + + CVehiclePool* m_pVehiclePool; int m_iGameState; int field_10;