Skip to content

Commit

Permalink
Merge branch 'dev' into rc
Browse files Browse the repository at this point in the history
  • Loading branch information
emcifuntik committed Sep 16, 2023
2 parents 755d9f1 + d2a7830 commit e72fc31
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 23 deletions.
8 changes: 1 addition & 7 deletions c-api/cache/CachedPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ namespace cache
_dlcProps(13, { 0, 0, 0 }),
_headOverlays(13, { 0, 0, 0, 0, 0 }),
_faceFeatures(20, 0.0f),
_socialClubName(base->GetSocialClubName()),
_cloudAuthHash(base->GetCloudAuthHash())
_socialClubName(base->GetSocialClubName())
#elif ALT_CLIENT_API
_talking(base->IsTalking()),
_micLevel(base->GetMicLevel()),
Expand Down Expand Up @@ -512,11 +511,6 @@ namespace cache
return _socialClubName;
}

std::string _cloudAuthHash;
std::string GetCloudAuthHash() const override {
return _cloudAuthHash;
}

std::vector<std::pair<IEntity*, int32_t>> GetStreamedEntities() const override { return {}; }

uint16_t GetAmmo(uint32_t ammoHash) const override {
Expand Down
6 changes: 4 additions & 2 deletions c-api/entities/connection_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ const char* ConnectionInfo_GetSocialName(alt::IConnectionInfo* connectionInfo, i
return AllocateString(connectionInfo->GetSocialName(), size);
}

const char* ConnectionInfo_GetCloudAuthHash(alt::IConnectionInfo* connectionInfo, int32_t& size)
void ConnectionInfo_RequestCloudID(alt::IConnectionInfo* connectionInfo, RequestAuthCallback_t delegate)
{
return AllocateString(connectionInfo->GetCloudAuthHash(), size);
connectionInfo->RequestCloudID([delegate](uint8_t ok, const std::string& result) {
delegate(ok, result.c_str());
});
}

uint8_t ConnectionInfo_IsAccepted(alt::IConnectionInfo* connectionInfo)
Expand Down
4 changes: 3 additions & 1 deletion c-api/entities/connection_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ EXPORT_SERVER const char* ConnectionInfo_GetCdnUrl(alt::IConnectionInfo* connect
EXPORT_SERVER uint64_t ConnectionInfo_GetPasswordHash(alt::IConnectionInfo* connectionInfo);
EXPORT_SERVER const char* ConnectionInfo_GetIp(alt::IConnectionInfo* connectionInfo, int32_t& size);
EXPORT_SERVER int64_t ConnectionInfo_GetDiscordUserID(alt::IConnectionInfo* connectionInfo);
EXPORT_SERVER const char* ConnectionInfo_GetCloudAuthHash(alt::IConnectionInfo* connectionInfo, int32_t& size);
EXPORT_SERVER const char* ConnectionInfo_GetText(alt::IConnectionInfo* connectionInfo, int32_t& size);
EXPORT_SERVER void ConnectionInfo_SetText(alt::IConnectionInfo* connectionInfo, const char* text);

typedef void (* RequestAuthCallback_t)(bool ok, const char* result);
EXPORT_SERVER void ConnectionInfo_RequestCloudID(alt::IConnectionInfo* connectionInfo, /** ServerEvents.RequestAuthCallbackDelegate */ RequestAuthCallback_t delegate);

EXPORT_SERVER void ConnectionInfo_Accept(alt::IConnectionInfo* connectionInfo, uint8_t sendNames);
EXPORT_SERVER void ConnectionInfo_Decline(alt::IConnectionInfo* connectionInfo, const char* reason);
EXPORT_SERVER uint8_t ConnectionInfo_IsAccepted(alt::IConnectionInfo* connectionInfo);
5 changes: 0 additions & 5 deletions c-api/entities/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,6 @@ const char* Player_GetSocialClubName(alt::IPlayer* player, int32_t& size)
return AllocateString(player->GetSocialClubName(), size);
}

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

void Player_SetAmmo(alt::IPlayer* player, uint32_t ammoHash, uint16_t ammo)
{
player->SetAmmo(ammoHash, ammo);
Expand Down
2 changes: 0 additions & 2 deletions c-api/entities/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ EXPORT_SHARED uint8_t Player_IsInCover(alt::IPlayer* player);

EXPORT_SERVER const char* Player_GetSocialClubName(alt::IPlayer* player, int32_t& size);

EXPORT_SERVER const char* Player_GetCloudAuthHash(alt::IPlayer* player, int32_t& size);

EXPORT_SERVER void Player_SetAmmo(alt::IPlayer* player, uint32_t ammoHash, uint16_t ammo);
EXPORT_SERVER uint16_t Player_GetAmmo(alt::IPlayer* player, uint32_t ammoHash);
EXPORT_SERVER void Player_SetWeaponAmmo(alt::IPlayer* player, uint32_t weaponHash, uint16_t ammo);
Expand Down
8 changes: 3 additions & 5 deletions 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 = 10796895324229959904UL;
inline uint64_t capiHash = 10494575567167650847UL;
inline uint64_t capiHashes[] = {
0,
#ifdef ALT_CLIENT_API
Expand Down Expand Up @@ -1288,7 +1288,6 @@ inline uint64_t capiHashes[] = {
1577439110274874884UL,
14204191833155309704UL,
5988681596904693572UL,
3511183830329804829UL,
4175744399917476392UL,
3151831504154255688UL,
11409383581668438027UL,
Expand All @@ -1301,6 +1300,7 @@ inline uint64_t capiHashes[] = {
12079559810042444284UL,
15232547943166326905UL,
8806505177995284480UL,
1770482245441276749UL,
13680172646316204766UL,
16420035482870248864UL,
6946126881626778655UL,
Expand Down Expand Up @@ -1422,7 +1422,6 @@ inline uint64_t capiHashes[] = {
8762610273524807230UL,
1189077145064378629UL,
5651306477145172672UL,
14978378563138317365UL,
11764387330920927539UL,
7011145495489366030UL,
4212976016289999495UL,
Expand Down Expand Up @@ -3012,7 +3011,6 @@ inline void* capiPointers[] = {
(void*) ConnectionInfo_GetBranch,
(void*) ConnectionInfo_GetBuild,
(void*) ConnectionInfo_GetCdnUrl,
(void*) ConnectionInfo_GetCloudAuthHash,
(void*) ConnectionInfo_GetDiscordUserID,
(void*) ConnectionInfo_GetHwIdExHash,
(void*) ConnectionInfo_GetHwIdHash,
Expand All @@ -3025,6 +3023,7 @@ inline void* capiPointers[] = {
(void*) ConnectionInfo_GetSocialName,
(void*) ConnectionInfo_GetText,
(void*) ConnectionInfo_IsAccepted,
(void*) ConnectionInfo_RequestCloudID,
(void*) ConnectionInfo_SetText,
(void*) Core_CreateBlip,
(void*) Core_CreateBlipAttached,
Expand Down Expand Up @@ -3146,7 +3145,6 @@ inline void* capiPointers[] = {
(void*) Player_GetAmmoSpecialType,
(void*) Player_GetAuthToken,
(void*) Player_GetClothes,
(void*) Player_GetCloudAuthHash,
(void*) Player_GetCurrentWeaponTintIndex,
(void*) Player_GetDecorations,
(void*) Player_GetDiscordId,
Expand Down
2 changes: 1 addition & 1 deletion cpp-sdk

0 comments on commit e72fc31

Please sign in to comment.