适用于东京暴龙的合适lua版本

我需要在东京暴君服务器中使用Lua扩展。我已经尝试了所有从源代码编译出来的Lua版本,每次都只能找到llua,而找不到llua5.1,ldd ttserver显示任何lua库都没有与此二进制文件链接,所以我从Lua网站下载了二进制包,ldd输出正确,但脚本仍不能正常工作,在日志中我只能找到: ERROR scrextnew 失败了。其他所有东西都正常工作,只有Lua扩展不能正常工作。:(

原文链接 https://stackoverflow.com/questions/8074719

点赞
stackoverflow用户416047
stackoverflow用户416047

在代码中,有两个地方产生了您看到的错误信息,都是由于此调用的失败导致的

/*初始化全局脚本语言扩展。*/
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){

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

[更新]

在头文件scrext.h中查看了一下,有一些参数描述 - 有很多需要配置的参数 - path和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);

希望能帮到你

2011-11-10 12:20:35