just another unknown arrival handler
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

just another unknown arrival handler

Started by UwV, 11 July, 2006, 10:28:52

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

UwV

--[[
				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
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

UwV

#1
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

\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

SMF spam blocked by CleanTalk