31.03.2016, 05:42
(
Last edited by Kar; 18/04/2016 at 08:21 PM.
)
Hello everyone, today I want to start a community effort to build an anti advertising function to detect adverts in strings without the use of regex.
I hope people will contribute.
I've started off using RyDer's stringContainsIP function as a base and modified it but I would like help from you guys.
You can contribute here: https://github.com/Kar2k/samp-anti-advertising
Current features:
Actual IP detection (use of numbers ranging from 0-255) with port.
Whitespace skipping.
Detection works with other symbols such as (127_0_0_1:7777).
What are all the things to consider when creating this?
Future plans:
- Allow IP detection without port (only works if a port is used currently). DONE.
- Instead of considering every character in the string.. only look for the numbers and check if they are valid IP numbers (0-255) and use that to consider detection. DONE.
- Ignoring letters between numbers and dots / colons .. E.G:
127aa.0.0zz.1.ff7777 DONE.
- Fixed separation option between ip numbers detection .. E.G: 127 $$$$ 0 $$$$ 0 $$$$ 1. As most advertisers that come in your server usual has a fixed set of characters in between the numbers in this case its " $$$$ ". Adding an option to detect that will greatly decrease false positives. DONE.
- Website detection possibly (maybe not.. too much false positives).
I hope people will contribute.
I've started off using RyDer's stringContainsIP function as a base and modified it but I would like help from you guys.
You can contribute here: https://github.com/Kar2k/samp-anti-advertising
Current features:
Actual IP detection (use of numbers ranging from 0-255) with port.
Whitespace skipping.
Detection works with other symbols such as (127_0_0_1:7777).
What are all the things to consider when creating this?
Future plans:
- Allow IP detection without port (only works if a port is used currently). DONE.
- Instead of considering every character in the string.. only look for the numbers and check if they are valid IP numbers (0-255) and use that to consider detection. DONE.
- Ignoring letters between numbers and dots / colons .. E.G:
127aa.0.0zz.1.ff7777 DONE.
- Fixed separation option between ip numbers detection .. E.G: 127 $$$$ 0 $$$$ 0 $$$$ 1. As most advertisers that come in your server usual has a fixed set of characters in between the numbers in this case its " $$$$ ". Adding an option to detect that will greatly decrease false positives. DONE.
- Website detection possibly (maybe not.. too much false positives).