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!

[Release] Banning IPs

Skilled Illusionist
Joined
Feb 19, 2008
Messages
320
Reaction score
0
Thought id release it here aswell as elitepvpers

Here you may stop unwanted ips from getting into your server (LOTF) since the majority are using it,
Yes you may not need it but eh i might aswell release it XD

In your release/debug folder make a txt doc where the ips will be stored

Now in General.cs find public static
Code:
System.IO.StreamWriter sw = new System.IO.StreamWriter(Application.StartupPath + @"ServerLog.txt", true);
Replace with
Code:
public static string BannedIP = System.IO.File.ReadAllText(Application.StartupPath + @"IPTEXTFILLYOUMADE.txt");
System.IO.StreamWriter(Application.StartupPath + @"ServerLog.txt", true);
Change IPTEXTFILLYOUMADE.txt to the txt file you made in your debug/release
Now in General.cs again find the AuthPacket void
Search for
Code:
if (Auth != 0)
                        {
General.WriteLin(blahblah)

Replace with
Code:
 if (Auth != 0)
                        {
                            if (BannedIP.Contains(Ip))
                            {
                                Sock.Disconnect(true);
                            }
                            General.WriteLine("Successful login for Account " + ":" ThisAcc + "-IP-" + Ip);
 
Back
Top