Right now if I tempban a user like this:
Quote!tempban testuser 2h because this_is_a_test
[/size]
the message
this_is_a_test
will ony be displayed once like this:
Quote[15:11] You had been temp banned to: 2 min because: test
[15:11] *** Disconnected
[15:12] *** Connecting to 192.168.240.31...
[15:12] *** Connected
[15:12] You are temporarily banned for 2 min!
[15:12] *** Disconnected
[15:12] *** Connecting to 192.168.240.31...
[15:12] *** Connected
[15:12] You are temporarily banned for 2 min!
[15:12] *** Disconnected
[15:12] *** Connecting to 192.168.240.31...
[15:12] *** Connected
[15:12] You are temporarily banned for 2 min!
[15:12] *** Disconnected
[/size]
is it possible to show the ban message each time the user tries to connect?
.. something like this:
Quote[15:12] *** Connected
[15:12] You are temporarily banned for hr : mins , by user for this reason: Reason would be entered here (if given)
[/size]
Thanks in advance :)
Either the XML files need update, or (and this is better) the whole ban thing should be stored in a database either standalone, or compiled into PtokaX). Scripted solution would kill the hub, since it should run through the banlist every minute to check whether the ban has expired. Imagine a banlist with 1000 people.
QuoteOriginally posted by bastya_elvtars
Scripted solution would kill the hub, since it should run through the banlist every minute to check whether the ban has expired. Imagine a banlist with 1000 people.
Would it?
Cant GetTempBannedItemTime(IP) be used for that?
Use Serialize to create a file...with needed info...
In NewUserConnected, check if tempbanned, and then read from file for op and reason and use GetTempBannedItemTime(IP) to get the time?
My hub is very small... i only have one or two bans in my list ;)
"Cant GetTempBannedItemTime(IP) be used for that?
Use Serialize to create a file...with needed info...
In NewUserConnected, check if tempbanned, and then read from file for op and reason and use GetTempBannedItemTime(IP) to get the time?"
But what about banlist clearing after a loooooooong hub downtime?
But as tempban is parsed before user starts to log in, if an user is banned, there is no user object created.
well u can use SupportsArrival.
btw heres a nice way to find out which arrivals are used when a user tries to login , and the order in which they are processed :
-- ParseArrivals by Dessamator
t ={}
function SupportsArrival(User, Data)
table.insert(t,{os.clock(),"SupportsArrival"})
end
function KeyArrival(User, Data)
table.insert(t,{os.clock(),"KeyArrival"})
end
function ValidateNickArrival(User, Data)
table.insert(t,{os.clock(),"ValidateNickArrival"})
end
function PasswordArrival(User, Data)
table.insert(t,{os.clock(),"PasswordArrival"})
end
function VersionArrival(User, Data)
table.insert(t,{os.clock(),"VersionArrival"})
end
function GetNickListArrival(User, Data)
table.insert(t,{os.clock(),"GetNickListArrival"})
end
function MyINFOArrival(User, Data)
table.insert(t,{os.clock(),"MyINFOArrival"})
end
function GetINFOArrival(User, Data)
table.insert(t,{os.clock(),"GetINFOArrival"})
end
function UserIPArrival(User, Data)
table.insert(t,{os.clock(),"UserIPArrival"})
end
function UnknownArrival(User, Data)
table.insert(t,{os.clock(),"UnknownArrival"})
end
function NewUserConnected(User,Data)
table.insert(t,{os.clock(),"NewUserConnected"})
end
function OpConnected(User,data)
table.insert(t,{os.clock(),"OPConnected"})
end
function SearchArrival(User, Data)
table.insert(t,{os.clock(),"SearchArrival"})
end
function SRArrival(User, Data)
table.insert(t,{os.clock(),"Search Responce Arrival"})
end
function ChatArrival(user,data)
data=string.sub(data,1,-2)
local s,e,cmd = string.find(data,"%b<>%s+(%S+)")
local temp ="\r\n"
if cmd=="!view" then
table.sort(t, function(a, b) return (a[1] < b[1]) end)
for i in ipairs(t) do
temp=temp.."Time taken : "..t[i][1].." --> Name : "..t[i][2].."\r\n"
end
t =nil
t ={}
user:SendData(temp)
return 1
end
end
Easier to view the PtokaX CMDs window. :P
However $Supports cannot be discarded anyway, and therefore it's stil processed by PtokaX. It needs a database, making it easier to process banned users and to store more information. This is something that should not be done by script.
Indeed, but the cmd in ptokax is a bit confusing, that script simplifies it by only showing the arrival which was used, either way it was written for a previous version of ptokax.
But i do agree with you, a database is needed !