@@ -24,6 +24,28 @@ static void ToString(const v8::FunctionCallbackInfo<v8::Value>& info)
24
24
V8_RETURN_STRING (ss.str ().c_str ());
25
25
}
26
26
27
+ static void HasLocalMeta (const v8::FunctionCallbackInfo<v8::Value>& info)
28
+ {
29
+ V8_GET_ISOLATE_CONTEXT ();
30
+ V8_CHECK_ARGS_LEN_MIN (1 );
31
+ V8_GET_THIS_BASE_OBJECT (player, alt::IPlayer);
32
+
33
+ V8_ARG_TO_STD_STRING (1 , key);
34
+
35
+ V8_RETURN (player->HasLocalMetaData (key));
36
+ }
37
+
38
+ static void GetLocalMeta (const v8::FunctionCallbackInfo<v8::Value>& info)
39
+ {
40
+ V8_GET_ISOLATE_CONTEXT ();
41
+ V8_CHECK_ARGS_LEN_MIN (1 );
42
+ V8_GET_THIS_BASE_OBJECT (player, alt::IPlayer);
43
+
44
+ V8_ARG_TO_STD_STRING (1 , key);
45
+
46
+ V8_RETURN_MVALUE (player->GetLocalMetaData (key));
47
+ }
48
+
27
49
static void CurrentWeaponComponentsGetter (v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
28
50
{
29
51
V8_GET_ISOLATE_CONTEXT ();
@@ -128,6 +150,9 @@ extern V8Class v8Player("Player", v8Entity, [](v8::Local<v8::FunctionTemplate> t
128
150
V8Helpers::SetStaticAccessor (isolate, tpl, " streamedIn" , &StreamedInGetter);
129
151
V8Helpers::SetStaticAccessor (isolate, tpl, " local" , &LocalGetter);
130
152
153
+ V8Helpers::SetMethod (isolate, tpl, " hasLocalMeta" , &HasLocalMeta);
154
+ V8Helpers::SetMethod (isolate, tpl, " getLocalMeta" , &GetLocalMeta);
155
+
131
156
// Common getters
132
157
V8Helpers::SetAccessor<IPlayer, std::string, &IPlayer::GetName>(isolate, tpl, " name" );
133
158
V8Helpers::SetAccessor<IPlayer, Ref<IVehicle>, &IPlayer::GetVehicle>(isolate, tpl, " vehicle" );
0 commit comments