Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALTV-469 Add new method GetHwidProtHash #159

Merged
merged 5 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions c-api/cache/CachedPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ namespace cache
_socialID(base->GetSocialID()),
_hwidHash(base->GetHwidHash()),
_hwidExHash(base->GetHwidExHash()),
_hwId3(base->GetHwid3()),
_authToken(base->GetAuthToken()),
_discordId(base->GetDiscordId()),
_invincible(base->GetInvincible()),
Expand Down Expand Up @@ -327,6 +328,11 @@ namespace cache
return _hwidExHash;
}

std::string _hwId3;
std::string GetHwid3() const override {
return _hwId3;
}

std::string _authToken;
std::string GetAuthToken() const override {
return _authToken;
Expand Down
4 changes: 4 additions & 0 deletions c-api/entities/connection_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ uint64_t ConnectionInfo_GetHwIdExHash(alt::IConnectionInfo* connectionInfo) {
return connectionInfo->GetHwIdExHash();
}

const char* ConnectionInfo_GetHwid3(alt::IConnectionInfo* connectionInfo, int32_t& size) {
return AllocateString(connectionInfo->GetHwid3(), size);
}

const char* ConnectionInfo_GetAuthToken(alt::IConnectionInfo* connectionInfo, int32_t& size) {
return AllocateString(connectionInfo->GetAuthToken(), size);
}
Expand Down
1 change: 1 addition & 0 deletions c-api/entities/connection_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ EXPORT_SERVER uint64_t ConnectionInfo_GetSocialId(alt::IConnectionInfo* connecti
EXPORT_SERVER const char* ConnectionInfo_GetSocialName(alt::IConnectionInfo* connectionInfo, int32_t& size);
EXPORT_SERVER uint64_t ConnectionInfo_GetHwIdHash(alt::IConnectionInfo* connectionInfo);
EXPORT_SERVER uint64_t ConnectionInfo_GetHwIdExHash(alt::IConnectionInfo* connectionInfo);
EXPORT_SERVER const char* ConnectionInfo_GetHwid3(alt::IConnectionInfo* connectionInfo, int32_t& size);
EXPORT_SERVER const char* ConnectionInfo_GetAuthToken(alt::IConnectionInfo* connectionInfo, int32_t& size);
EXPORT_SERVER uint8_t ConnectionInfo_GetIsDebug(alt::IConnectionInfo* connectionInfo);
EXPORT_SERVER const char* ConnectionInfo_GetBranch(alt::IConnectionInfo* connectionInfo, int32_t& size);
Expand Down
4 changes: 4 additions & 0 deletions c-api/entities/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ uint64_t Player_GetHwidExHash(alt::IPlayer* player) {
return player->GetHwidExHash();
}

const char* Player_GetHwid3(alt::IPlayer* player, int32_t& size) {
return AllocateString(player->GetHwid3(), size);
}

const char* Player_GetAuthToken(alt::IPlayer* player, int32_t& size) {
return AllocateString(player->GetAuthToken(), size);
}
Expand Down
1 change: 1 addition & 0 deletions c-api/entities/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ EXPORT_SERVER void Player_SetModel(alt::IPlayer* player, uint32_t model);
EXPORT_SERVER uint64_t Player_GetSocialID(alt::IPlayer* player);
EXPORT_SERVER uint64_t Player_GetHwidHash(alt::IPlayer* player);
EXPORT_SERVER uint64_t Player_GetHwidExHash(alt::IPlayer* player);
EXPORT_SERVER const char* Player_GetHwid3(alt::IPlayer* player, int32_t& size);
EXPORT_SERVER const char* Player_GetAuthToken(alt::IPlayer* player, int32_t& size);

EXPORT_SERVER void Player_SetHealth(alt::IPlayer* player, uint16_t health);
Expand Down
6 changes: 5 additions & 1 deletion c-api/func_table.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "func_table.h"

inline uint64_t capiHash = 10075699596264467259UL;
inline uint64_t capiHash = 2737407539021183714UL;
inline uint64_t capiHashes[] = {
0,
#ifdef ALT_CLIENT_API
Expand Down Expand Up @@ -1366,6 +1366,7 @@ inline uint64_t capiHashes[] = {
7415605567391116903UL,
7998061229071288348UL,
4175744399917476392UL,
3230557606089997547UL,
3151831504154255688UL,
11409383581668438027UL,
8080268107975854795UL,
Expand Down Expand Up @@ -1525,6 +1526,7 @@ inline uint64_t capiHashes[] = {
12996031514192232278UL,
6875264309357036667UL,
18242810182906526031UL,
13686597780873033455UL,
424368865670330442UL,
9546723288515311389UL,
16961931856292652951UL,
Expand Down Expand Up @@ -3183,6 +3185,7 @@ inline void* capiPointers[] = {
(void*) ConnectionInfo_GetCloudAuthResult,
(void*) ConnectionInfo_GetCloudID,
(void*) ConnectionInfo_GetDiscordUserID,
(void*) ConnectionInfo_GetHwid3,
(void*) ConnectionInfo_GetHwIdExHash,
(void*) ConnectionInfo_GetHwIdHash,
(void*) ConnectionInfo_GetID,
Expand Down Expand Up @@ -3342,6 +3345,7 @@ inline void* capiPointers[] = {
(void*) Player_GetHeadBlendData,
(void*) Player_GetHeadBlendPaletteColor,
(void*) Player_GetHeadOverlay,
(void*) Player_GetHwid3,
(void*) Player_GetHwidExHash,
(void*) Player_GetHwidHash,
(void*) Player_GetInteriorLocation,
Expand Down
2 changes: 1 addition & 1 deletion cpp-sdk
Loading