Add GetPlayerInfo and GetPlayerForUserID to IVEngineClient.

* Move CRC32_t typedef from CUserCmd.h to PlayerInfo.h.

Signed-off-by: aixxe <me@aixxe.net>
This commit is contained in:
aixxe 2016-12-19 20:49:14 +00:00
parent e8e7f1d4ae
commit fd60cdc93b
4 changed files with 29 additions and 2 deletions

View File

@ -1,7 +1,5 @@
#pragma once
typedef unsigned long CRC32_t;
class CUserCmd {
virtual ~CUserCmd() {};

View File

@ -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

View File

@ -6,6 +6,14 @@ class IVEngineClient {
return GetVirtualFunction<void(*)(IVEngineClient*, int&, int&)>(this, 5)(this, width, height);
}
bool GetPlayerInfo(int index, player_info_t* infoptr) {
return GetVirtualFunction<bool(*)(IVEngineClient*, int, player_info_t*)>(this, 8)(this, index, infoptr);
}
int GetPlayerForUserID(int userid) {
return GetVirtualFunction<int(*)(IVEngineClient*, int)>(this, 9)(this, userid);
}
bool Con_IsVisible() {
return GetVirtualFunction<bool(*)(IVEngineClient*)>(this, 11)(this);
}

View File

@ -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;