[Release] Ban Selected IP's

09/12/2008 19:32 Ultimatum#1
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);
Please comment, iv been awake for 3 days in a row so theres bound to be some spelling errors XD :pimp:
09/12/2008 19:40 glupkotrup#2
Nice :handsdown: You earned one thanks :D
09/12/2008 19:51 Ultimatum#3
Thanks for the comment =D Well.. the thanks =o
09/12/2008 20:06 _Emme_#4
Great contribution!
Thanks

Emme
09/12/2008 20:14 Ultimatum#5
HOW TO:

If you want to say IP Ban someone, check the ServerLog for there acc, General.WriteLine("Successful login for account " + ThisAcc + "-IP-" + Ip); will show lets say
"Successfull login for account Ultimatum -IP- 81.934.392.12" <--- youll find something like that

Put 81.934.392.12 in the IPBanning txt doc in debug/release and your done, ip = denied =)
09/12/2008 20:15 _Emme_#6
Yeah,didnt read through whole post. Sorry and thanks
09/12/2008 20:19 _Emme_#7
edit :

Now it throws an error message,like an exeption error. Any ideas?
09/12/2008 20:32 Ultimatum#8
UPDATED
09/12/2008 21:33 glupkotrup#9
@Emme "Edit:" is for edited post and you just wrote another one -_-
@Ultimatum So nice ;)
09/12/2008 22:27 taguro#10
Awesome release, thanks alot.
09/12/2008 22:43 YukiXian#11
Nice job!
09/12/2008 23:24 Zanzibar#12
Eh n1
09/13/2008 16:40 Bottingpunk#13
okay for this General.WriteLine("Successful login for Account " + ":" ThisAcc + "-IP-" + Ip); okay for ThisAcc it wants me to make it ) and in ip); it wants me to take away the ) what should i do just do that lol
09/13/2008 19:58 Mouse>Pro#14
nice
09/13/2008 20:46 Ultimatum#15
Quote:
Originally Posted by Bottingpunk View Post
okay for this General.WriteLine("Successful login for Account " + ":" ThisAcc + "-IP-" + Ip); okay for ThisAcc it wants me to make it ) and in ip); it wants me to take away the ) what should i do just do that lol
If i could understand wtf your talking about i may be able to help o.0