Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Batch: If the IP is in the IP range

Be a kicker than cheater.
Joined
Dec 17, 2009
Messages
726
Reaction score
25
I don't know how to make a code lines for checking "if an IP Address is in the IP range"

I know it might need VBS (file) language or something, please help me.

This is the example of IP range (IP/mask):
162.158.0.0/15
 
Last edited:
Junior Spellweaver
Joined
Jun 1, 2018
Messages
105
Reaction score
40
I don't know how to make a code lines for checking if IP is in the IP range

I know it need VBS file/code, please help me.

This is the example of IP range (IP/mask):
162.158.0.0/15
You could use an enum to declare reserved IP's such as 127.0.0.1 and 000.000.000 etc.
Then you could read the IP you need to check as a string, split it around "." and stick the segments into an array, then check that each part is between 0 and 255 as those are the valid values of an IPv4 address.
Obviously this is a very generic way to solve the problem and many languages like Java and C# will have built in tools for this that may prove to be easier.
 
Back
Top