东京暴君正确的lua版本

发布于 2024-12-14 09:02:57 字数 215 浏览 0 评论 0原文

我需要在 tokyo tyrant 服务器中使用 lua 扩展。我已经尝试过从源代码构建的所有 lua 版本,每次找到 llua 而 llua5.1 没有时,ldd ttserver 说任何 lua 库都没有与这个二进制文件链接,所以我从 lua 网站下载了二进制包,ldd 给出了正确的输出,但是脚本仍然无法正常工作,在日志中我只能找到: 错误 scrextnew 失败。其他一切都正常,只有 lua 扩展不会:(

i need to use lua extension in tokyo tyrant server. I have tried all lua versions build from source, everytime llua was found and llua5.1 not, ldd ttserver said that any lua library isnt linked with this binary, so i downloaded binary package from lua website, and ldd gave correct output, but scripting still does not work as it should , in logs i can find only :
ERROR scrextnew failed. everything else works fine, only lua extension wont :(

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

漆黑的白昼 2024-12-21 09:02:57

在代码中,有两个点会产生您看到的错误消息,这两个点都是由于此调用失败而导致的,

/* Initialize the global scripting language extension. */
void *scrextnew(void **screxts, int thnum, int thid, const char *path,
                TCADB *adb, TCULOG *ulog, uint32_t sid, TCMDB *stash, TCMDB *lock,
                void (*logger)(int, const char *, void *), void *logopq){

这似乎是脚本语言的加载器,并且有一个路径作为第四个参数 - 所以我查看一些配置,看看是否需要将 dll/so 放在某处,或者它在错误的位置?我从未使用过它(但现在很好奇:-))所以只是一个猜测。

[更新]

查看了标头 - scrext.h,其中有一些参数描述 - 有许多参数需要配置 - 路径和 sid

/* Initialize the scripting language extension.
   `screxts' specifies an array of the scripting language extension objects.
   `thnum' specifies the number of the native threads.
   `thid' specifies the thread ID number.
   `path' specifies the path of the initilizing script.
   `adb' specifies the abstract database object.
   `ulog' specifies the update log object.
   `sid' specifies the server ID.
   `stash' specifies the global stash object.
   `lock' specifies the global lock object.
   `logger' specifies the pointer to a function to do with a log message.
   `logopq' specifies the opaque pointer for the logging function.
   The return value is the scripting object or `NULL' on failure. */
void *scrextnew(void **screxts, int thnum, int thid, const char *path,
                TCADB *adb, TCULOG *ulog, uint32_t sid, TCMDB *stash, TCMDB *lock,
                void (*logger)(int, const char *, void *), void *logopq);

脱颖而出

In the code there are two spots that produce the error message you see and both are as a result of a failure to this call

/* Initialize the global scripting language extension. */
void *scrextnew(void **screxts, int thnum, int thid, const char *path,
                TCADB *adb, TCULOG *ulog, uint32_t sid, TCMDB *stash, TCMDB *lock,
                void (*logger)(int, const char *, void *), void *logopq){

This seems to be the loader for the scripting language and there is a path as the 4th parameter - so I'd have a look at some config to see if you need to put a dll/so somewhere, or it's looking in the wrong place? I've never used it (but curious about it now :-)) so just a guess.

[Update]

Had a look in the header - scrext.h and there's some parameter descriptions - there are a number of parameters that need config - path and sid stand out

/* Initialize the scripting language extension.
   `screxts' specifies an array of the scripting language extension objects.
   `thnum' specifies the number of the native threads.
   `thid' specifies the thread ID number.
   `path' specifies the path of the initilizing script.
   `adb' specifies the abstract database object.
   `ulog' specifies the update log object.
   `sid' specifies the server ID.
   `stash' specifies the global stash object.
   `lock' specifies the global lock object.
   `logger' specifies the pointer to a function to do with a log message.
   `logopq' specifies the opaque pointer for the logging function.
   The return value is the scripting object or `NULL' on failure. */
void *scrextnew(void **screxts, int thnum, int thid, const char *path,
                TCADB *adb, TCULOG *ulog, uint32_t sid, TCMDB *stash, TCMDB *lock,
                void (*logger)(int, const char *, void *), void *logopq);

hth

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文