Posts: 160
Threads: 31
Joined: Oct 2011
Thanks: 0
Given 0 thank(s) in 0 post(s)
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?
Posts: 160
Threads: 31
Joined: Oct 2011
Thanks: 0
Given 0 thank(s) in 0 post(s)
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
Posts: 160
Threads: 31
Joined: Oct 2011
Thanks: 0
Given 0 thank(s) in 0 post(s)
haha, thanks, I'll look into it.
Posts: 160
Threads: 31
Joined: Oct 2011
Thanks: 0
Given 0 thank(s) in 0 post(s)
11-13-2011, 10:18 AM
(This post was last modified: 11-13-2011, 10:22 AM by rs2k.)
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