From 7fe0cca7ded92dfd713b67ddf0bd0180ef478e55 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Thu, 23 Nov 2023 23:56:11 +0800 Subject: [PATCH] [saco] Update CNetGame constructor --- saco/net/netgame.cpp | 16 ++++++++++++++-- saco/net/netgame.h | 12 ++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/saco/net/netgame.cpp b/saco/net/netgame.cpp index 74fd9fe..b226e5d 100644 --- a/saco/net/netgame.cpp +++ b/saco/net/netgame.cpp @@ -1,7 +1,19 @@ -#include "netgame.h" +#include "../main.h" -CNetGame::CNetGame(char *a2, int a3, char *a4, char *a5) +CNetGame::CNetGame(PCHAR szHostOrIp, int iPort, + PCHAR szPlayerName, PCHAR szPass) { + field_3D5 = (struc_41*)calloc(1,sizeof(struc_41)); + + memset(m_szHostName,0,256); + memset(m_szHostOrIp,0,256); + + strcpy(m_szHostName, "SA-MP"); + strncpy(m_szHostOrIp, szHostOrIp, sizeof(m_szHostOrIp)); + m_iPort = iPort; + + m_iGameState = GAMESTATE_WAIT_CONNECT; + // TODO: CNetGame::CNetGame(...) .text:1000B930 } diff --git a/saco/net/netgame.h b/saco/net/netgame.h index 460c2e1..6419a86 100644 --- a/saco/net/netgame.h +++ b/saco/net/netgame.h @@ -1,4 +1,8 @@ +#pragma once + +#define GAMESTATE_WAIT_CONNECT 1 + struct struc_41 { char field_0; @@ -26,15 +30,15 @@ class CNetGame // size: 994 private: int field_0; char _gap4[44]; - char field_30[257]; - char field_131[257]; + char m_szHostOrIp[257]; + char m_szHostName[257]; char field_232; char field_233; char field_234; - int field_235; + int m_iPort; int field_239; char field_23D[400]; - int field_3CD; + int m_iGameState; int field_3D1; struc_41 *field_3D5; char field_3D9;