上一页 1 2 3 4 5 6 7 ··· 48 下一页
摘要: 安装vscode和emmylua插件看这边: vscode+emmylua搭建lua开发环境 Attack方式调试 1) 这种调试方式作者已经不推荐使用,该调试器也不再更新以及修复bug,那这边为啥还要介绍呢? 个人使用下来感觉更快更稳定些,也没遇到创建协程coroutine调试器失效,调试过程中改 阅读全文
posted @ 2025-07-09 22:46 yanghui01 阅读(739) 评论(0) 推荐(0)
摘要: local MaskUtil = {} function MaskUtil.Value(maskBit) return 2 ^ (maskBit) end 是否包含某个mask值 function MaskUtil.HasValue(allMasks, mask) return allMasks % 阅读全文
posted @ 2025-07-08 23:07 yanghui01 阅读(11) 评论(0) 推荐(0)
摘要: lua5.1默认只提供了number类型来存放整数,如果用它来计算比较大的整数值,需要注意number的最大安全整数,超过的话建议使用xlua提供的64位整数类型(uint64)来计算。 number最大安全整数 lua5.1中的number默认是按 IEEE 754 双精度浮点数标准来存放的,即: 阅读全文
posted @ 2025-07-08 23:06 yanghui01 阅读(257) 评论(0) 推荐(0)
摘要: writerCallback回调函数 static size_t writerCallback(void *ptr, size_t size, size_t nmemb, void *stream) { curlT* c=(curlT*)stream; //stream参数是一个自定义数据, 通过s 阅读全文
posted @ 2025-07-08 22:56 yanghui01 阅读(22) 评论(0) 推荐(0)
摘要: luacurl.c文件定义处的ALL_CURL_OPT展开 /* wrap curl option with simple option type */ #define C_OPT(n, t) /* wrap curl option with string list type */ #define 阅读全文
posted @ 2025-07-06 14:07 yanghui01 阅读(21) 评论(0) 推荐(0)
摘要: 注册在curlT表下,可以看作curlT类的成员函数 static const struct luaL_reg luacurl_meths[] = { {"close", lcurl_easy_close}, {"setopt", lcurl_easy_setopt}, {"perform", lc 阅读全文
posted @ 2025-07-06 13:28 yanghui01 阅读(21) 评论(0) 推荐(0)
摘要: 注册在curl表下,可以看作curl类的static函数 static const struct luaL_reg luacurl_funcs[] = { {"new", lcurl_easy_init}, {"escape", lcurl_escape}, {"unescape", lcurl_u 阅读全文
posted @ 2025-07-05 15:52 yanghui01 阅读(19) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <curl/curl.h> #include <lauxlib.h> // 回调函数,用于处理响应数据 size_t write_callback(void *contents, size_t size, size_t nmemb, char 阅读全文
posted @ 2025-07-05 08:38 yanghui01 阅读(72) 评论(0) 推荐(0)
摘要: 从入口函数开始 LUACURL_API int luaopen_luacurl (lua_State *L) { printf("luaopen_luacurl begin: %d, %s\n", lua_gettop(L), lua_typename(L, lua_type(L, -1))); / 阅读全文
posted @ 2025-07-05 08:22 yanghui01 阅读(31) 评论(0) 推荐(0)
摘要: 目的:能在lua中像下面这样方便的使用协程 public class CoTest : MonoBehaviour { void Start() { var enu = MyCo(); StartCoroutine(enu); } IEnumerator MyCo() { Debug.Log($"f 阅读全文
posted @ 2025-07-01 00:13 yanghui01 阅读(94) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 48 下一页