The lua script I wrote for McBans works, the problem is if mcbans happens to be down then the server will hang until the lua script is done trying to fetch the url.
Any ideas on how to resolve this?
your using wget right set -T seconds
like -T 1 its the timeout so it will timeout after 1 sec of trying.
Edit:
http://www.gnu.org/software/wget/manual/...tions.html
if the full timeout gives trouble with reading you might just wanna use
--connect-timeout=seconds for just the connection timeout

.
thanks, but I don't like the idea of a busy server hanging up to one second at a time every time someone logs in or DCs. It's better than a 20 second hang though. lol
Use cTCPLink. Can't explain how it works right now

Try to figure it out
haha, thanks, I'll look into it.
I can get this to return true,
Lua__cTCPLink():Connect( "omencraft.com", 80 )
, but that's all I've been able to figure out so far. Any more hints you can give? It seems like once a port is open I need some kind of hook for the plugin to pickup on to send data, and another one to receive data, there aren't any hooks like that in cPluginManager.cpp though.
This always returns a nil value:
Lua__cTCPLink():ReceivedData( data, size )
abd using that as a function in the lua causes a c stack overflow:
function Lua__cTCPLink():ReceivedData( data, size )
print("hello world")
end
Like the plugin, create a new instance of it in Lua
Code:
MyTCPLink = {}
MyTCPLink.__index = MyTCPLink
function MyTCPLink:new()
local t = {}
setmetatable(t, CorePlugin)
local w = Lua__cTCPLink:new()
tolua.setpeer(w, t)
w:tolua__set_instance(w)
return w
end
Then implement the ReceivedData function
Code:
function MyTCPLink:ReceivedData( data, size )
print("hello world")
end
And create the instance
Code:
Link = MyTCPLink:new()
It's not perfect, so I think it needs work

but it should work for really basic things