24.03.2015, 02:49
(
Последний раз редактировалось SickAttack; 04.07.2016 в 19:18.
)
Anti Advertisement System
Simple, yet effective!
InformationSimple, yet effective!
This filterscript uses a regular expression to detect valid IP Addresses (0-255) to block them later on and prevent them from being sent to other players. However, invalid IP Addresses (not 0, not between 0 and 255, not 255) are sent to other players - That isn't really a problem since it's invalid.
Regular Expression
This is the regular expression used in this filterscript:
Код:
(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.+){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
The filterscript converts all the characters (not numbers, only characters) in the text to points (.) and then uses the regular expression to validate the text, whether a valid IP Address was found or not.
Requirements
To use this filterscript, you will need to get the following, if you don't have it yet: Screenshots
1)
Message sent:

Response from filterscript:

2)
Message sent:

Response from filterscript:

3)
Message sent:

Response from filterscript:

4)
Message sent:

Response from filterscript:

5)
Message sent:

Response from filterscript:

6)
Testing the regular expression used in this filterscript:

Notice
- IP Addresses used in this thread are suppose to be invalid.
- The provided plugin may cause the server to crash, consider using another source.
Anti Advertisement System - Pastebin - #1 paste tool since 2002
Additional
This thread is also available in Spanish / Espaсol, click here and you will be redirected to it automatically!