altmp / altv-client-js

Official clientside JavaScript runtime for alt:V
6 stars 7 forks source link

Add new export and adapt old export #36

Closed LeonMrBonnie closed 3 years ago

vadzz-dev commented 3 years ago

Lets use ICore::RegisterScriptRuntime instead

LeonMrBonnie commented 3 years ago

Alright, this is a draft then until it is changed in the CPP SDK.

vadzz-dev commented 3 years ago

I looked in the client code and RegisterScriptRuntime should work, can you test it?

LeonMrBonnie commented 3 years ago

Just change the return value and instead of returning the script runtime register it, or do I also need to change the exported function name to altMain like on serverside?

LeonMrBonnie commented 3 years ago

Okay so I tried using RegisterScriptRuntime on client and it works well. So we should now delete the needed GetType export from the module (you specify the type in the RegisterScriptRuntime call) Then we can change the module to use RegisterScriptRuntime instead.

vadzz-dev commented 3 years ago

Shouldn't it be marked as a draft till sdk gets required changes?

LeonMrBonnie commented 3 years ago

How I changed it still works, when its updated in SDK we would only need to remove the GetType export then, but I can mark it as draft for now