-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Former-commit-id: 34ce93f
- Loading branch information
Showing
18 changed files
with
191 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
# altv-js-module | ||
JS module for alt:V Multiplayer. Powered by NodeJS & v8 | ||
|
||
## Troubleshooting | ||
**Problem**: I want to build a native Node.js addon with | ||
[node-gyp](https://github.com/nodejs/node-gyp) but the alt:V server can not load | ||
it and responds with following error: | ||
``` | ||
./altv-server: symbol lookup error: /usr/share/addon/binding.node: undefined symbol: node_module_register | ||
``` | ||
**Solution**: Add a C++ file to your project with following content and include | ||
it the ```sources``` in your ```binding.gyp``` file. | ||
```cpp | ||
#include <node.h> | ||
#include <dlfcn.h> | ||
|
||
extern "C" NODE_EXTERN void node_module_register(void* mod) { | ||
auto base_ptr = dlopen("libnode.so.72", RTLD_NOW | RTLD_GLOBAL); | ||
if (base_ptr == nullptr) { | ||
return; | ||
} | ||
auto register_func = reinterpret_cast<decltype(&node_module_register)>(dlsym(base_ptr, "node_module_register")); | ||
if (register_func == nullptr) { | ||
return; | ||
} | ||
register_func(mod); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule cpp-sdk
updated
34 files
+2 −0 | CRefCountable.h | |
+108 −31 | ICore.h | |
+19 −0 | IDiscordManager.h | |
+3,571 −0 | IGFX.h | |
+21 −0 | ILocalStorage.h | |
+17 −10 | IPackage.h | |
+45 −13 | IResource.h | |
+8 −8 | SDK.h | |
+24 −0 | events/CCreateBaseObjectEvent.h | |
+7 −0 | events/CEvent.h | |
+32 −0 | events/CNetOwnerChangeEvent.h | |
+32 −0 | events/CPlayerEnteringVehicleEvent.h | |
+24 −0 | events/CRemoveBaseObjectEvent.h | |
+28 −0 | events/CVehicleAttachEvent.h | |
+28 −0 | events/CVehicleDetachEvent.h | |
+9 −11 | events/CWebViewEvent.h | |
+7 −6 | objects/IBaseObject.h | |
+6 −3 | objects/IEntity.h | |
+14 −0 | objects/ILocalPlayer.h | |
+36 −34 | objects/IPlayer.h | |
+78 −116 | objects/IVehicle.h | |
+4 −3 | objects/IWorldObject.h | |
+69 −7 | script-objects/IBlip.h | |
+9 −0 | script-objects/ICheckpoint.h | |
+5 −3 | script-objects/IColShape.h | |
+148 −0 | script-objects/IHandlingData.h | |
+26 −0 | script-objects/IMapData.h | |
+80 −0 | script-objects/INative.h | |
+52 −0 | script-objects/IStatData.h | |
+5 −3 | script-objects/IVoiceChannel.h | |
+25 −0 | script-objects/IWebView.h | |
+2 −0 | types/MValue.h | |
+7 −7 | types/RGBA.h | |
+40 −52 | types/String.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.