diff --git a/raspberryjammod/LICENSE b/raspberryjammod/LICENSE index 8daa3d1..6def647 100644 --- a/raspberryjammod/LICENSE +++ b/raspberryjammod/LICENSE @@ -2,9 +2,9 @@ The MIT License (MIT) RaspberryJamMod Copyright (c) 2015 Alexander R. Pruss Lua Copyright (c) 1994–2015 Lua.org, PUC-Rio. -luasocket Copyright (c) Diego Nehab -tools.lua adapted from lua-websockets Copyright (c) 2012 Gerhard Lipp -base64.lua Copyright (c) 2014 Mark Rogaski and (C) 2012 Paul Moore (changed to MIME encoding) +luasocket Copyright (c) Diego Nehab (with socket.lua changed by ARP to load x64/x86 as needed) +tools.lua adapted from lua-websockets Copyright (c) 2012 Gerhard Lipp (with base64 inactivated) +base64.lua Copyright (c) 2014 Mark Rogaski and (C) 2012 Paul Moore (changed by ARP to MIME encoding) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/raspberryjammod/socket.lua b/raspberryjammod/socket.lua index 211adcd..cc2f827 100644 --- a/raspberryjammod/socket.lua +++ b/raspberryjammod/socket.lua @@ -10,7 +10,12 @@ local base = _G local string = require("string") local math = require("math") -local socket = require("socket.core") +local socket +local status,err = pcall(function() socket = require("socket.core") end) +if not status then + socket = require("socket.cx64") +end + module("socket") ----------------------------------------------------------------------------- diff --git a/raspberryjammod/socket/core-x64.dll b/raspberryjammod/socket/core-x64.dll new file mode 100755 index 0000000..84577e9 Binary files /dev/null and b/raspberryjammod/socket/core-x64.dll differ diff --git a/raspberryjammod/socket/cx64.dll b/raspberryjammod/socket/cx64.dll new file mode 100755 index 0000000..8093655 Binary files /dev/null and b/raspberryjammod/socket/cx64.dll differ diff --git a/raspberryjammod/socket/patch-x64.lua b/raspberryjammod/socket/patch-x64.lua new file mode 100644 index 0000000..ae043d5 --- /dev/null +++ b/raspberryjammod/socket/patch-x64.lua @@ -0,0 +1,14 @@ +-- +-- core-x64.dll is compiled with msvc 12, without any changes to the luasockets +-- source. Unfortunately, this forces it to be named core.dll, which doesn't work +-- well with what I did to socket.lua to make it load the x64 version as needed. +-- So we patch it. +-- + +local f = assert(io.open("core-x64.dll", "rb")) +local data = f:read("*all") +f:close() +data = data:gsub("luaopen_socket_core", "luaopen_socket_cx64") +local f = assert(io.open("cx64.dll", "wb")) +f:write(data) +f:close() diff --git a/raspberryjammod/tools.lua b/raspberryjammod/tools.lua index cf0c47d..f3aebc2 100644 --- a/raspberryjammod/tools.lua +++ b/raspberryjammod/tools.lua @@ -189,9 +189,9 @@ end return { sha1 = sha1_crypto or sha1_wiki, - base64 = { - encode = base64_encode - }, +-- base64 = { +-- encode = base64_encode +-- }, parse_url = parse_url, generate_key = generate_key, read_int8 = read_int8,