[Problem] Anti-Spam Lite (Edited version) BUG
Hi guys&girls,
I wanted to find the simplest and smallest anti-spam plugin for my server. That search led me to this plugin -> https://forums.alliedmods.net/showthread.php?t=137697 And as you can see that plugin is now old and the author has "abandoned" it. So i read those few codes he wrote in that 4 different versions of the plugin, and in the end i basically rearranged the lines/paragraphs so I would get what i needed. Below in the spoiler is what i wanted and have edited:
Spoiler
So I combined it and edited few lines to get a plugin which would restrict access to those who connect to my server with any IP address in their nickname and it would also restrict to the players to send IP addresses of any other servers into my server's chat. Tested it a few times, and i was satisfied until i found a small problem. The plugin restricts connection to the server to those who have word "depres" in their nickname. I don't understand how that happens or why that word or combination of letters is exactly the problem, so if there is anyone who would read this novel of mine and help me out a bit i would be very grateful! Thanx in advance and sorry if I've done anything that breaks the rules of this board 'cause I'm relatively new here and this is my first topic, be gentle to the new guy! :) Greet's! |
Re: [Problem] Anti-Spam Lite (Edited version) BUG
Quote:
|
Re: [Problem] Anti-Spam Lite (Edited version) BUG
Man , i see that the regex in useless here because its check numbers & point & If there is 3 num in the last address of the ip . Anyway my point is if its checking the ip like this it should match at least it should detect space in IP etc .. Why doing it like this if you can do something like this
Ps : im right now phone but i will do my best add stock bool for _IpCheck[] ( as string ) for (new i = 0; _IpCheck[i]; i++) if (’0’ <= _IpCheck[i] <= ’9') Or just loop { 9 , 8 , ... } and do contains ( its like a countdown ( 9 8 7 .. 0 ) it will check all num And retrun it true and then return the final statement ( return false ) And add a check if ~contains( bitwise . Flip num ) string with "." . Anyway for your problem regex will be the better way if i remember as well . I have done it before in a 8 ( len ) with regex of course just check the digit \d all add a + and check the space \s and so one . So just search for regular expressions and create yours . And then try to match result in a online regex compiler . then just hook say & say_team and check if ( _IpCheck(argHERE) ) and then the same think in Infochanged event . Hope i help you ( im really aorry if i didnt make it clear for you , as i said im phone ) ... Any Q just post . |
Re: [Problem] Anti-Spam Lite (Edited version) BUG
@Depresie
Unfortunately yes, the plugin hates you :'D @Freezo Begin First of all thanks for the response and your time. As I said I'm not the original author of the plugin. So why the code was written like that or which method the author used I really don't know :/ I liked that one among many others because it's really light for the server, almost invisible.. No errors also and it really does exactly what I need except for that small bug where it kicks players who have "depres" in that order in their nickname, that's why I turned it off.. Amxx compiling isn't my domain really, i have learnt a bit of c++ and c# but have no experience with amxx+C So if this was a request for a plugin i would have requested a fix for that word bug and i guess a safety switch, like those who have immunity (a flag), that plugin ignores them if it's possible. But then again I guess I'm asking too much, anyway i understood what you're saying but I'm unexperienced to apply that :) |
Re: [Problem] Anti-Spam Lite (Edited version) BUG
This is my fast edit :
Code:
|
Re: [Problem] Anti-Spam Lite (Edited version) BUG
Again thank you for this, tested it on my private server, gotta say it works nice with no errors.
Also does what i needed but has a few flaws. For example any 2+ digit numbers written like 12 13 won't be displayed or if someone has nickname "Player.92" he will also be kicked, while in the last plugin that wasn't the case and those small things impressed me in a good way. I don't know if it's because of the regex or as you said it's just a fast edit, but anyway it's also very good and thanks once again. Those flaws are maybe minor but for a public server and 30 players it makes a difference unfortunately, I really don't want to harrass you with this but that's my honest review :) Best regards! |
Re: [Problem] Anti-Spam Lite (Edited version) BUG
Alright !
I made this simple one replace it in the regex_match Code:
\b(?:\d{1,3}(\,|\<|\>|\~|\«|\»|\=|\.|\s|\*|\')){3}\d{1,3}\bPlayer.127.0.0.1 Player.127.13=12-13 127 0 0 1 Undetect more than 4 regrp {4} 127.0.0.0.1 = invalid |
Re: [Problem] Anti-Spam Lite (Edited version) BUG
PHP Code:
|
Re: [Problem] Anti-Spam Lite (Edited version) BUG
Code:
Edit : Or just use this Code:
\d+(\.|\s|\+|_|\:|,)\d(\.|\s|\+|_|\:|,)\d(\.|\s|\+|_|\:|,)\d(\.|\s|\+|_|\:|,)\d+ |
Re: [Problem] Anti-Spam Lite (Edited version) BUG
Works fine when I edit it like this
Spoiler
But when i try out your last edit it doesn't work, I can send IP addresses to chat in any way. I see that you deleted the second part of regex, so I'm guessing the problem is in that part :/ But anyway it works edited like in the code above, I can't stress enough how thankful I am..! Appreciate it! |
| All times are GMT -4. The time now is 20:05. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.