-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
66 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Plugins | ||
|
||
## Necessary work | ||
|
||
::: warning | ||
You must place `samp-node` after other plugins in `pawn.legacy_plugins` to ensure that other plugins are loaded first. | ||
::: | ||
|
||
If you need to use legacy plugins, you must place the plugin's `dll/so` file in the `plugins` folder, configure it in the `config.json` file under `pawn.legacy_plugins`, and include the `.inc` files of these plugins through `pawno/qawno`. Then, modify `pawn.main_scripts` to point to the `.amx` file you compiled. | ||
|
||
Due to the various possible combinations of plugins, `infernus-starter` only includes common versions without `raknet` and versions with `raknet`. | ||
|
||
If you are not able to use the plugins correctly, you will usually receive error messages similar to the following during server startup, and some plugins may have runtime issues: | ||
|
||
``` | ||
[Error] Function not registered: CA_DestroyObject | ||
[Error] File or function is not found | ||
``` | ||
|
||
## Wrapper development | ||
|
||
For the implementation of wrappers, please refer to the relevant code of `infernus` and the `samp-node` `wiki`. | ||
|
||
Due to the underlying implementation of plugins or `samp-node` or `sampgdk` or `omp`, you may not be able to directly call `native` functions of `plugins/omp components` using `samp-node`, or directly register callback functions. | ||
|
||
For example, `raknet` cannot be called directly, so `infernus` took a detour and implemented the call through a `polyfill`. | ||
|
||
If you encounter similar issues when developing wrappers, you may need to refer to the `polyfill` implementation for `raknet` to work around the problem, unless someday in the future `samp-node` and other ecosystems become fully compatible with `omp`. |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# 插件 | ||
|
||
## 必要工作 | ||
|
||
::: warning | ||
您必须在`pawn.legacy_plugins`把 `samp-node` 放到其他插件的后面,以确保其他插件先加载。 | ||
::: | ||
|
||
如果您需要用到传统的插件,您必须像传统的原生开发那样,将插件的 `dll/so` 放入 `plugins` 文件夹,然后在`config.json`中配置`pawn.legacy_plugins`,并且通过 `pawno/qawno` 引入这些插件的`.inc` 文件,然后修改`pawn.main_scripts`为您编译的`.amx`文件。 | ||
|
||
由于插件有数种搭配可能性,所以`infernus-starter`只组合了常见的无 `raknet` 和带 `raknet` 的版本。 | ||
|
||
如果您没能以正确的方式使用插件,在服务器启动时通常你会收到类似的错误信息,也有一些插件是由于运行时的问题。 | ||
|
||
``` | ||
[Error] Function not registered: CA_DestroyObject | ||
[Error] File or function is not found | ||
``` | ||
|
||
## 包装开发 | ||
|
||
有关包装的实现请参考 `infernus` 的相关代码和 `samp-node` 的 `wiki`。 | ||
|
||
由于一些可能是插件或`samp-node`,或`sampgdk`,又或是`omp`的底层实现,您有可能无法直接使用 `samp-node` 调用到插件/`omp` 组件的`native`函数,也可能无法直接注册回调函数。 | ||
|
||
例如 `raknet`无法被直接调用,所以`infernus`绕了很大的弯路,通过`polyfill`来实现调用。 | ||
|
||
如果您开发包装遇到类似的问题,可能需要参考 `raknet` 的 `polyfill` 绕弯路来实现,除非未来的某一天 `samp-node`和其他生态可以完全兼容`omp`。 |