Hello,
I am trying to get a mushclient world to load luasocket 2.0.2 instead of Mushclient's built in 2.0.1 because of a certain memory bug in 2.0.1.
I placed the socket.lua in my world's directory, along with the socket folder containing all the sub libraries and the core.dll. Before the requires in my script, I do a ChangeDir(GetInfo(67)) to make my world's directory the current directory.
It correctly loads socket.lua from the world directory, but then loads Mushclient's core.dll, even though it is supposedly lower priority than loading from current directory. When I delete Mushclient's core.dll, it correctly loads the one in my world's socket folder, but while Mushclient's files are in place there seems to be no way to get it to load mine first. It's already higher priority in package.path, so it doesn't look like I can get anywhere by manipulating that.
Here is my package.path
Quote: ;.\lua\?.lua;;.\?.lua;C:\Program Files (x86)\MUSHclient\lua\?.lua;C:\Program Files (x86)\MUSHclient\lua\?\init.lua;C:\Program Files (x86)\MUSHclient\?.lua;C:\Program Files (x86)\MUSHclient\?\init.lua;C:\Program Files (x86)\Lua\5.1\lua\?.luac
Here is my package.cpath
Quote: .\?.dll;C:\Program Files (x86)\MUSHclient\?.dll;C:\Program Files (x86)\MUSHclient\loadall.dll
And here is a traceback for doing a require "socket.x" (the real command is require "socket.core")
Quote: Immediate execution
module 'socket.x' not found:
no field package.preload['socket.x']
no file '.\lua\socket\x.lua'
no file '.\socket\x.lua'
no file 'C:\Program Files (x86)\MUSHclient\lua\socket\x.lua'
no file 'C:\Program Files (x86)\MUSHclient\lua\socket\x\init.lua'
no file 'C:\Program Files (x86)\MUSHclient\socket\x.lua'
no file 'C:\Program Files (x86)\MUSHclient\socket\x\init.lua'
no file 'C:\Program Files (x86)\Lua\5.1\lua\socket\x.luac'
no file '.\socket\x.dll'
no file 'C:\Program Files (x86)\MUSHclient\socket\x.dll'
no file 'C:\Program Files (x86)\MUSHclient\loadall.dll'
no file '.\socket.dll'
no file 'C:\Program Files (x86)\MUSHclient\socket.dll'
no file 'C:\Program Files (x86)\MUSHclient\loadall.dll'
stack traceback:
[C]: in function 'require'
[string "Command line"]:1: in main chunk
Everything seems to say it should load from the socket folder in the current directory first, but this is not the case. Is there anything I can do to work around this without changing Mushclient's files? Alternatively, officially upgrading Mushclient's luasocket to 2.0.2 would be great too. :) |