From fd60cdc93b2f6455d33c476db69c5d6afb1ea11f Mon Sep 17 00:00:00 2001 From: aixxe Date: Mon, 19 Dec 2016 20:49:14 +0000 Subject: [PATCH] Add GetPlayerInfo and GetPlayerForUserID to IVEngineClient. * Move CRC32_t typedef from CUserCmd.h to PlayerInfo.h. Signed-off-by: aixxe --- include/cstrike/Classes/CUserCmd.h | 2 -- include/cstrike/Definitions/Const.h | 5 +++++ include/cstrike/Interfaces/IVEngineClient.h | 8 ++++++++ include/cstrike/Structures/PlayerInfo.h | 16 ++++++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 include/cstrike/Structures/PlayerInfo.h diff --git a/include/cstrike/Classes/CUserCmd.h b/include/cstrike/Classes/CUserCmd.h index eca0037..537c3fa 100644 --- a/include/cstrike/Classes/CUserCmd.h +++ b/include/cstrike/Classes/CUserCmd.h @@ -1,7 +1,5 @@ #pragma once -typedef unsigned long CRC32_t; - class CUserCmd { virtual ~CUserCmd() {}; diff --git a/include/cstrike/Definitions/Const.h b/include/cstrike/Definitions/Const.h index 2a47389..247702e 100644 --- a/include/cstrike/Definitions/Const.h +++ b/include/cstrike/Definitions/Const.h @@ -1,5 +1,10 @@ #pragma once +#define SIGNED_GUID_LEN 32 + +#define MAX_PLAYER_NAME_LENGTH 32 +#define MAX_CUSTOM_FILES 4 + #define LIFE_ALIVE 0 #define LIFE_DYING 1 #define LIFE_DEAD 2 diff --git a/include/cstrike/Interfaces/IVEngineClient.h b/include/cstrike/Interfaces/IVEngineClient.h index 02fec91..9946f81 100644 --- a/include/cstrike/Interfaces/IVEngineClient.h +++ b/include/cstrike/Interfaces/IVEngineClient.h @@ -6,6 +6,14 @@ class IVEngineClient { return GetVirtualFunction(this, 5)(this, width, height); } + bool GetPlayerInfo(int index, player_info_t* infoptr) { + return GetVirtualFunction(this, 8)(this, index, infoptr); + } + + int GetPlayerForUserID(int userid) { + return GetVirtualFunction(this, 9)(this, userid); + } + bool Con_IsVisible() { return GetVirtualFunction(this, 11)(this); } diff --git a/include/cstrike/Structures/PlayerInfo.h b/include/cstrike/Structures/PlayerInfo.h new file mode 100644 index 0000000..68886c1 --- /dev/null +++ b/include/cstrike/Structures/PlayerInfo.h @@ -0,0 +1,16 @@ +#pragma once + +typedef unsigned long CRC32_t; + +typedef struct player_info_s { + char name[MAX_PLAYER_NAME_LENGTH]; + int userID; + char guid[SIGNED_GUID_LEN + 1]; + uint32_t friendsID; + char friendsName[MAX_PLAYER_NAME_LENGTH]; + bool fakeplayer; + bool ishltv; + //bool isreplay; + CRC32_t customFiles[MAX_CUSTOM_FILES]; + unsigned char filesDownloaded; +} player_info_t; \ No newline at end of file