Banned
 

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

Banned

Started by bastya_elvtars, 01 June, 2004, 01:00:50

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bastya_elvtars

i need a script that saves reasons of the bans and it displays that when a banned (time or perm) user wants to log in (not just 'your ass is banned'). Thx in advance!
Everything could have been anything else and it would have just as much meaning.

Corayzon

hey bastya_elvtars,

i tried this a while agof or cslave and i came across the following results...

-=Perm IP Bans=-
when a banned ip enters the hub, ptokax itself handles banned ip when a connection is made, and then disconnects them with the message 'your ass...'. This means that side scripts never get any data from ptokax, therefor:- we cant rehandle the banip message. But, ...

-=Perm Nickname Bans=-
when a banned nick enters the hub, ptokax and anyother hub can only handle the banned name when the '$ValNick' command is received. This means that you can acutally handle a banned nick:- sending a ban message and disconnecting the socket, and then returning 1 to the process in ptokax

hope this helps

Corayzon

hey again bastya_elvtars...

There are some problems that will arise when adding this to some large hubscripts:- which is explained below the example.

neway, here's a little example of how to handle to banned nick entering the hub, ...

-- :: Example Banned Nick Handler by Noza

function Main()
	frmHub:EnableFullData(1)
end

function DataArrival(tUser, sData)
	if strsub(sData, 1, 13) == "$ValidateNick" then
		local _,_, sUsername = strfind(sData, "$ValidateNick%s+(%S+)|")
		if checkBanned(sUsername) then
			-- :: this is where you do what you like
			tUser:SendData("*** GotCha!")
			tUser:Disconnect()
			return 1
		end
	end
end

function checkBanned(sUsername)
	readfrom("../PermBan.dat")
	while 1 do
		local sLine = read()
		if sLine == nil or sLine == "" then
			readfrom()
			return
		else
			local _,_, sExpression = strfind(sLine, "(%S+)|")
			if sExpression ~= nil then
				if strlower(sExpression) == strlower(sUsername) then
					readfrom()
					return 1
				end
			end
		end
	end
end

its hard to write a complete script that sends the reason for why a connecting nick banned user was banned, because depending on what hub script you use:- the commands for banning are different. You will have to insert into the ban method, an output to a file.(in english, saving the reason to a file from the ban command in whatever script you may use)

And also aside this...sometimes ptokax wont send hub data after, the pervious send in a script returns 1 (in english, if one script handles "$ValNick" and returns 1, then the next one in line may not get the command sent to it), maybe...im not quite sure, but this seems to be what happens...

However, in the new cslave im writing, its completly based on being compatable with other large scripts:- if you want to use only a few features in cslave they can all be deleted or edited out, and if you want to add another script to cslave, just add the commands it uses, and cslave will pass it on, rather then handling them and then returning.

And there i go, just cant help myself...

neways, i hope ya learnt something new >:|>-<

SMF spam blocked by CleanTalk