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 Update cpp-sdk #330

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions server/src/bindings/ConnectionInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ static void HwidExHashGetter(v8::Local<v8::String>, const v8::PropertyCallbackIn
V8_RETURN_STRING(std::to_string(con->GetHwIdExHash()));
}

static void HwId3Getter(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
V8_GET_ISOLATE_CONTEXT_RESOURCE();
V8_GET_THIS_BASE_OBJECT(con, alt::IConnectionInfo);
V8_RETURN_STRING(con->GetHwId3());
}

static void AuthTokenGetter(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
V8_GET_ISOLATE_CONTEXT_RESOURCE();
Expand Down
8 changes: 8 additions & 0 deletions server/src/bindings/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ static void HwidExHashGetter(v8::Local<v8::String> name, const v8::PropertyCallb
V8_RETURN_STRING(std::to_string(_this->GetHwidExHash()));
}

static void HwId3Getter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
V8_GET_ISOLATE();
V8_GET_THIS_BASE_OBJECT(_this, IPlayer);
V8_RETURN_STRING(_this->GetHwId3());
}

static void SetClothes(const v8::FunctionCallbackInfo<v8::Value>& info)
{
V8_GET_ISOLATE_CONTEXT();
Expand Down Expand Up @@ -1513,6 +1520,7 @@ extern V8Class v8Player("Player",
V8Helpers::SetAccessor(isolate, tpl, "socialID", &SocialIDGetter);
V8Helpers::SetAccessor(isolate, tpl, "hwidHash", &HwidHashGetter);
V8Helpers::SetAccessor(isolate, tpl, "hwidExHash", &HwidExHashGetter);
V8Helpers::SetAccessor(isolate, tpl, "hwId3", &HwId3Getter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
V8Helpers::SetAccessor(isolate, tpl, "hwId3", &HwId3Getter);
V8Helpers::SetAccessor(isolate, tpl, "hwid3", &HwId3Getter);

V8Helpers::SetAccessor<IPlayer, std::string, &IPlayer::GetSocialClubName>(isolate, tpl, "socialClubName");

V8Helpers::SetAccessor<IPlayer, std::string, &IPlayer::GetAuthToken>(isolate, tpl, "authToken");
Expand Down
2 changes: 1 addition & 1 deletion shared/deps/cpp-sdk
Loading