Skip to content

Commit

Permalink
server: Add Player blooddamage getter / setter
Browse files Browse the repository at this point in the history
  • Loading branch information
xLuxy committed Oct 18, 2023
1 parent 5d57a56 commit f6abb79
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion server/src/bindings/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,26 @@ static void GetCloudAuthResultGetter(v8::Local<v8::String>, const v8::PropertyCa
V8_RETURN_UINT(_this->GetCloudAuthResult());
}

static void DiscordIDGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
static void GetBloodDamageBase64(const v8::FunctionCallbackInfo<v8::Value>& info)
{
V8_GET_ISOLATE();
V8_GET_THIS_BASE_OBJECT(_this, IPlayer);

V8_RETURN_STRING(_this->GetBloodDamageBase64());
}

static void SetBloodDamageBase64(const v8::FunctionCallbackInfo<v8::Value>& info)
{
V8_GET_ISOLATE_CONTEXT();
V8_GET_THIS_BASE_OBJECT(_this, IPlayer);
V8_CHECK_ARGS_LEN(1);

V8_ARG_TO_STRING(1, base64);

_this->SetBloodDamageBase64(base64);
}

static void DiscordIDGetter(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
V8_GET_ISOLATE();
V8_GET_THIS_BASE_OBJECT(_this, IPlayer);
Expand Down Expand Up @@ -1411,6 +1430,9 @@ extern V8Class v8Player("Player",
V8Helpers::SetAccessor<IPlayer, std::string, &IPlayer::GetCloudID>(isolate, tpl, "cloudID");
V8Helpers::SetAccessor(isolate, tpl, "cloudAuthResult", &GetCloudAuthResultGetter);

V8Helpers::SetMethod(isolate, tpl, "getBloodDamageBase64", &GetBloodDamageBase64);
V8Helpers::SetMethod(isolate, tpl, "setBloodDamageBase64", &SetBloodDamageBase64);

V8Helpers::SetAccessor<IPlayer, std::string, &IPlayer::GetIP>(isolate, tpl, "ip");
V8Helpers::SetAccessor<IPlayer, std::string, &IPlayer::GetName>(isolate, tpl, "name");
V8Helpers::SetAccessor<IPlayer, IVehicle*, &IPlayer::GetVehicle>(isolate, tpl, "vehicle");
Expand Down

0 comments on commit f6abb79

Please sign in to comment.