dockfries / infernus

Node.js library for scripting Open Multiplayer.
https://dockfries.github.io/infernus/
MIT License
21 stars 2 forks source link

Add samp-cef #34

Closed cha5e369 closed 5 months ago

cha5e369 commented 6 months ago

Is it possible that in the not too distant future samp-cef will be added in Infernus? It would be very useful in terms of new interfaces that we could develop.

dockfries commented 6 months ago

It doesn't seem to be working properly at the moment. :(

In fact, it is relatively simple to implement these API calls.

but it's not clear what's wrong with sampgdk and other plugins, such as RakNet's natives can't be called through sampgdk_InvokeNativeArray , and samp-cef doesn't even seem to use sampgdk, but is written directly in the Rust language (I'm not sure).

It seems that calling through samp.callNative always fails (return 0 and nothing happened)?


I think there will be some changes in the workflow of cef_subscribe, because the callback of cef_subscribe must exist in the .pwn code, and different event correspond to different callbacks and cannot be aggregated in the same callback, so cef_emit_event still needs to be executed in .pwn code.

in the corresponding callback, through the samp_node api SAMPNode_CallEvent, into the callback that we manually registered through samp.on, and then cef_emit_event at the javascript layer?

Since streamer is used to manage object directly inside infernus, and native CreatePlayerObject is recommended by samp-cef, there may be compatibility problems.

I tried to write the following code only through documentation See here

dockfries commented 5 months ago

try using the latest @infernus/cef@^0.1.0 with the polyfill of cef available in infernus-starter.