i was trying out this small code to check for nicks joining channel and nick changes to check if joining nick or nick change has chanops nick in it and i was wondering if this is the best way to do it or is there another way not to have to loop each time a nick joins or changes nick ?
Basically what I lm asking is will the constant loop through chanlist to find chanops to compare to the joining nick have bad effect on performance and if so is there a better way to achieve the same result without loss of performance?
Those two binds (nick and join) should be more than enough to cover your needs, without the loop over chanlist every time someone joins. Makes no sense really.
Not to mention the code is poorly formatted.. here's a better look to follow things more easily.
Caesar: the reason i have to loop throu chanlist to find chanops halfops on each joining nick is because its ops and halfops nicks that get abused who are currently opped and i dont use flags as their IP is dynamic so i cant rely on that
In reaction to your question crazycat is because we wanted to check the actual nicks with a @ or % in the channel
Those two binds (nick and join) should be more than enough to cover your needs, without the loop over chanlist every time someone joins. Makes no sense really.
how else are we suppose to get the current chanops/halfops in the channel on every join ?
caesar wrote:On a bind mode change? I fail to understand what exactly is happening there and what exactly you want to achieve.
First a bind mode change is not what i used i used a bind join and a bind nick as it's the nicks we want to compare
What we want to achieve is everytime a nick joins or changes nick we want to check it if it has the nick of a chanop/halfop in it (who is currently in the channel and half/opped) wich is mostly used for abuse and if detected to set ban on the abuser and set ban on chanop nick that got abused without getting the actual chanhalf/op banned
And what happens with ghost (often on timeout ?)
Usually the client reconnects with an alternative nick, often a variation of the main nick, while the main is still connected.
You'll ban nick- because it looks like nick ? And nick- is the real op, nick is just a ghost which will disappear in a few seconds.
Thats a good point crazycat i didn't find that the case with most chanops but it may happen once in a long time and if it happens a lot there is something else going on that needs fixing
I didn't do anything, just made his code easier to follow by adding indentations.
I would maintain an active list of the names I want to "protect" via mode change, quit, part, and so on, and upon a regular user joining I would check with that list. I doubt you have 100 names to keep track at any given time, so this approach would be far less memory intensive than looping the entire channel members list for every single trigger by a bind join.
Once the game is over, the king and the pawn go back in the same box.