diff --git a/CMakeLists.txt b/CMakeLists.txt index 28b8204f..00cefc74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,7 +62,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows") # 生成lua.exe add_executable(lua skynet/3rd/lua/lua.c) - target_link_libraries(lua liblua) + target_link_libraries(lua liblua ws2_32 libposix) # 定义复制目标 add_custom_command(TARGET liblua POST_BUILD @@ -114,7 +114,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows") # 生成动态库 client.so add_library(client SHARED skynet/lualib-src/lua-crypt.c skynet/lualib-src/lsha1.c) target_include_directories(client PRIVATE skynet/skynet-src) - target_link_libraries(client liblua) + target_link_libraries(client liblua ws2_32 libposix) # 生成动态库 sproto.so aux_source_directory(skynet/lualib-src/sproto SPROTO_SRC) diff --git a/script/lua/encrycode.lua b/script/lua/encrycode.lua index 66797716..dfa7feaf 100644 --- a/script/lua/encrycode.lua +++ b/script/lua/encrycode.lua @@ -52,7 +52,7 @@ for file_name, file_path, file_info in file_util.diripairs('./') do if not isok then print("create dir_path err ", dir_path, err) else - local newfile = io.open(new_path, "w+") + local newfile = io.open(new_path, "w+b") if not newfile then print("can`t openfile >>> ", new_path) else @@ -61,8 +61,13 @@ for file_name, file_path, file_info in file_util.diripairs('./') do newfile:write(size) newfile:write(encode_str) newfile:close() - print("encry file succ:", new_path, #encode_str) - loadfile(new_path) --测试加载 + + local func,err = loadfile(new_path) --测试加载 + if not func then + print("loadfile err ", err) + else + print("encry file succ:", new_path, #encode_str) + end end end end diff --git a/skynet b/skynet index f36c8692..4295f171 160000 --- a/skynet +++ b/skynet @@ -1 +1 @@ -Subproject commit f36c869204ac07dea456b6fa1b55b59dfea4ea68 +Subproject commit 4295f171fc3e811b5c73717d0dad85eac0eca4d1