PtokaX forum

Archive => Archived 5.1 boards => Finished Scripts => Topic started by: UwV on 11 July, 2006, 10:28:52

Title: just another unknown arrival handler
Post by: UwV on 11 July, 2006, 10:28:52

--[[
this one sends:
user a message on unkown arrivals and lets the user know the hub don't understand it
disconnects on incoming $UserIPv1  (not on other unknown arrivals)
and a report to nicks in tReportsTo  ( not on $UserIPv1 we now that one now..)

--]]

------------------------------------------------------------------------------------------------------
sReports = 1

sBotname = "Unknown-Bot"

tReportsTo = {
"yournick",
"anothernick",
"etc."
}

-------------------------------------------------------------------------------------------------------
function UnknownArrival(curUser, sData)
local sUnknown = string.gsub(sData, "|", "?")
if string.find(sData,"UserIP") then
local sReason = "$UserIPv1"
local sMsg = "\r\n\r\n\r\n"..
"\t[ NB! ]\r\n"..
"\tSince our hub software no longer supports $UserIP (v1) you will be disconnected immediately.\r\n"..
"\tIn your client, please disable sending $UserIP for users or use regular DC++ to enter this hub\r\n\r\n"
curUser:SendData(sBotname, sMsg)
SendPmToNick(curUser.sName, sBotname, sMsg)
curUser:Disconnect()
return 1;
else
sReason = " ??? "
local sMsg = "\r\n\r\n\r\n\t"..
"\t [ NB! ]\r\n"..
"\t you are sending us useless data, some kind of command wich our hubsoft does not understand....\r\n"..
"\t it looks like this: "..sUnknown.."\r\n\r\n"..
"\t In your client, please disable/change something or use regular DC++ to enter this hub\r\n\r\n"
curUser:SendData(sBotname, sMsg)
SendPmToNick(curUser.sName, sBotname, sMsg)
end
if sReports then
sProfileName = GetProfileName(curUser.iProfile) or "Unregistered"
sSpacer = string.rep(" ", 15 - string.len(curUser.sIP))
sReport = string.char(166).." "..curUser.sIP..""..sSpacer.."\t"..curUser.sName.." ("..sProfileName..")  is sending : "..sUnknown.." "
for i, v in pairs(tReportsTo) do
SendPmToNick(v, sBotName, string.char(166).."  "..sReason.."\t "..sReport)
end
end
collectgarbage("collect")
end
Title: Re: just another unknown arrival handler
Post by: UwV on 13 July, 2006, 15:34:17
one linux client uses this :
[16:26:44] <Unknown-Bot> ?   ??? ? xxx.xxx.xxx.xxx  UserName (Unregistered)  is sending : $Capabilities MD4x?

haven't seen any other unkown arrivals here yet ..  (besides  $UserIPv1 )
ptokax "knows" em all  ;D