From 0b15ccfb8730fc696854df2693c8602b240172d6 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sun, 15 Sep 2024 23:18:47 +0800 Subject: [PATCH] [server] Implement/match `CPlayer::SetSpawnInfo(...)` --- server/player.cpp | 7 +++++++ server/player.h | 24 +++++++++++++++++++++--- server/playerpool.h | 6 ------ 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/server/player.cpp b/server/player.cpp index 11056fe..9f316f7 100644 --- a/server/player.cpp +++ b/server/player.cpp @@ -10,3 +10,10 @@ void CPlayer::Say(unsigned char * szText, BYTE byteTextLen) //---------------------------------------------------- +void CPlayer::SetSpawnInfo(PLAYER_SPAWN_INFO *pSpawn) +{ + memcpy(&m_SpawnInfo,pSpawn,sizeof(PLAYER_SPAWN_INFO)); + m_bHasSpawnInfo = TRUE; +} + +//---------------------------------------------------- diff --git a/server/player.h b/server/player.h index 745fb1a..89ab1a9 100644 --- a/server/player.h +++ b/server/player.h @@ -2,17 +2,35 @@ #ifndef SAMPSRV_PLAYER_H #define SAMPSRV_PLAYER_H +#pragma pack(1) +typedef struct _PLAYER_SPAWN_INFO +{ + char _pad0[46]; +} PLAYER_SPAWN_INFO; + +//---------------------------------------------------- + +#pragma pack(1) class CPlayer { -private: - char _gap0[11486]; - public: + // Size: 11486 + char _pad0[11261]; + + PLAYER_SPAWN_INFO m_SpawnInfo; + BOOL m_bHasSpawnInfo; + + char _pad2C2F[175]; + + void Say(unsigned char * szText, BYTE byteTextLength); + void SetSpawnInfo(PLAYER_SPAWN_INFO *pSpawn); }; +//---------------------------------------------------- + #endif //---------------------------------------------------- diff --git a/server/playerpool.h b/server/playerpool.h index a9ec84e..6cc7380 100644 --- a/server/playerpool.h +++ b/server/playerpool.h @@ -2,12 +2,6 @@ #ifndef SAMPSRV_PLAYERPOOL_H #define SAMPSRV_PLAYERPOOL_H -// TODO: PLAYER_SPAWN_INFO -typedef struct _PLAYER_SPAWN_INFO // size: 46 -{ - char _gap0[46]; -} PLAYER_SPAWN_INFO; - class CPlayerPool // size: WL 199024 { private: