Hi guys,
I have one issue.
I run PtokaX DC Hub 0.3.3.0 build 15.18 [debug]
I have one script that checks for the dc++ version and that checks for extra slots dc++ function.
If dc++ version is wrong or if any extraslot is found a user disconnect happen.
Well: the disconnection is as much fast that no user is able to read the disconnet explanation message, nor the ptokax built in messages for minimum sharing size and or hub/slot ratio... nothing.
only the disconnected string
If I remove the disconnect code line, the message is correctly sent to the user.
How to overcome this issue?
I have tried to make a loop before the disconnect line, but it doesn't work.
My idea now is to send a warning every 15 seconds to the user that explain what is goign to happen and only after the 3rd warning as last the disconnection should happen.
Well, any idea of how to store and count the warnings amount? I'm not so strong with lua, so thank you for any idea.
Naturally, if you know a way to delay enough the disconnection in such a way that the message may arrive to the user client, instead of the warnings sequence.. thank you aswell.
Regards to all of you
Robert (??Corsari??)
well that shouldnt be a problem , u just have to write in the correct order, curUser:Disconnect() (or something like it), and then curUser:SendData("info")
or just search the forum for "disconnect delay", u should find some info to help u with that !
order is correct, time it is not enough.
How to setup a delay before the disconnection with the timer + offset?
Thank you
theres a lot of ways of doing so,
1. use a timer, something like this :
function Main()
SetTimer(1000)
StartTimer()
end
table1 = {}
function NewUserConnected(user)
if --min version then -- do stuff,
table1[curUser.sName] = msg
end
end
function Ontimer()
for i,v in table1 do
GetItemByName(i):SendData(v)
GetItemByName(i):Disconnect()
end
table1 =nil
table1 ={}
end
2. other way is using a clock()
search the forum for info on how to use that !
3. OR send a PM to the user, instead of senddata use SendPM, might work
as for storing warns, u can use tables for that, something like :
warns = {}
function NewUserConnected(user)
if -- then --
warns[user.sName] = 1
end
end