PDA

View Full Version : [317]Fully Working Ip-Ban[317]



Coder Chris
July 20th, 2010, 15:15
Here is a fully working ipban tutorial for 317's
Tested Source: Project Czar
Difficulty: 1/10 (if you dont know how to C&P then its gonna be hard)
Modified Files: Client.Java

First off open the Client.Java and search:


public boolean banned(String host)

and you should see something like this:


public boolean banned(String host)
{
try
{
BufferedReader in = new BufferedReader(new FileReader("data/bannedusers.dat"));
String data = null;
while ((data = in.readLine()) != null)
{
if (host.equalsIgnoreCase(data))
{
return true;
}
}
}
catch (IOException e)
{
System.out.println("Critical error while checking banned");
e.printStackTrace();
}
return false;
}
Under that code leave a space and put this in:


public void appendToBannedIps(String player) {

BufferedWriter bw = null;

try {
bw = new BufferedWriter(new FileWriter("data/bannedips.txt", true));
bw.write(player);
bw.newLine();
bw.flush();
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (bw != null) {
try {
bw.close();
} catch (IOException ioe2) {
sendMessage("Error ip banning user!");
}
}
}
}
Then after that search for "banuser" and above the code add this command:


if (command.startsWith("ipban")
&& (playerRights >= 3 || playerName.equalsIgnoreCase("Your Name Here"))) {
String victim = command.substring(6);
int index = PlayerHandler.getPlayerID(victim);
client v = (client) server.playerHandler.players[index];

appendToBannedIps(v.connectedFrom);
v.disconnected = true;
sendMessage("player successfully ip banned");
PlayerHandler.messageToAll = playerName
+ ": HAS IP BANNED THE PLAYER: " + command.substring(5);
BufferedWriter bw = null;

try {
bw = new BufferedWriter(
new FileWriter("logs/ipbanlogs.txt", true));
bw.write(playerName + " banned" + victim);
bw.newLine();
bw.flush();
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (bw != null) {
try {
bw.close();
} catch (IOException ioe2) {
sendMessage("Error logging ip bans!");
}
}
}
}
Then you save and compile....
THEN WOLA! Fully working ipban


*Let me know if it doesnt work*
Also let me know if this has been posted before

Emily
July 20th, 2010, 15:18
1. No Credits
2. Almost every 317 source has this.

Coder Chris
July 20th, 2010, 15:19
1. No Credits
2. Almost every 317 source has this.

As i said... its project czar and project czar doesnt have a fully working ipban!

Emily
July 20th, 2010, 15:21
As i said... its project czar and project czar doesnt have a fully working ipban!

Actually what you said was

Tested Source: Project Czar

You did not say anything about you copying the code from another source, and putting it into Project Czar.

Coder Chris
July 20th, 2010, 15:25
Actually what you said was


You did not say anything about you copying the code from another source, and putting it into Project Czar.

where is the proof of me copying a code... ur just one of those people who isnt happy unless you've made it yourself so go fuck yourself

Emily
July 20th, 2010, 15:32
where is the proof of me copying a code... ur just one of those people who isnt happy unless you've made it yourself so go fuck yourself

Actually this is the same code that is in 98% of 317's is how i know, and I wouldn't be happy coding this myself, because 1. 317's are like the most basic and easiest sources to code, and 2. it only takes at tops 3 mins to write. When you learn to program without leeching, and post appropriate credits, you may eventually become somewhat good some day.

Coder Chris
July 20th, 2010, 15:37
Actually this is the same code that is in 98% of 317's is how i know, and I wouldn't be happy coding this myself, because 1. 317's are like the most basic and easiest sources to code, and 2. it only takes at tops 3 mins to write. When you learn to program without leeching, and post appropriate credits, you may eventually become somewhat good some day.

so if im as bad as you say then how come im working on a massive project right now with czar without the use of fucking tutorials. i only code for something to do that actually helps people to enjoy 317's and have fun. I code so that people arent playing shit 317's like allstar scape and reapage scape and shit like that. I dont code other client versions yet cause im working on something big. I have been in rsps for like 3 years and i used to have an account on here but i forgot the name so i made a new one. (like 1 year ago or less i posted alot of tuts that were respected) You dont need to act all serious because its a fricken game.

Lighten up.

Emily
July 20th, 2010, 15:43
so if im as bad as you say then how come im working on a massive project right now with czar without the use of fucking tutorials. i only code for something to do that actually helps people to enjoy 317's and have fun. I code so that people arent playing shit 317's like allstar scape and reapage scape and shit like that. I dont code other client versions yet cause im working on something big. I have been in rsps for like 3 years and i used to have an account on here but i forgot the name so i made a new one. (like 1 year ago or less i posted alot of tuts that were respected) You dont need to act all serious because its a fricken game.

Lighten up.

Hello I'm Emily, I'm currently making the best 562, with all the mini games that have never been completed before. I don't use tutorials because 98% of these forums can't program correctly, or if they do, very poorly. I program solo, because teaming up means that you are not experienced enough to do it yourself. I've been in rsps since i was 13ish, and been into 562's for two months. I think it's bull shit about 90% of what you've said above, because Allstarscape and Reapage scape, are not shit, but great basic sources to use on 317 projects. "like 1 year ago or less i posted alot of tuts tat were respected" like the fuck anyone cares, honestly this is now, past doesn't matter at all when you are programing, and yes it's a freaking game, so don't steal other peoples work and post it as your own, because that just proves how sad you really are.

Coder Chris
July 20th, 2010, 15:45
Hello I'm Emily, I'm currently making the best 562, with all the mini games that have never been completed before. I don't use tutorials because 98% of these forums can't program correctly, or if they do, very poorly. I program solo, because teaming up means that you are not experienced enough to do it yourself. I've been in rsps since i was 13ish, and been into 562's for two months. I think it's bull shit about 90% of what you've said above, because Allstarscape and Reapage scape, are not shit, but great basic sources to use on 317 projects. "like 1 year ago or less i posted alot of tuts tat were respected" like the fuck anyone cares, honestly this is now, past doesn't matter at all when you are programing, and yes it's a freaking game, so don't steal other peoples work and post it as your own, because that just proves how sad you really are.

i could show you how much of a pile of shit reapage-scape and allstar is. and you wouldnt believe how much shit there is in it.

Emily
July 20th, 2010, 15:47
i could show you how much of a pile of shit reapage-scape and allstar is. and you wouldnt believe how much shit there is in it.

Yeah i know it's not the best 317 source in the world, i will agree with you on that. But that's why it's a decent source for projects. Since most of the shit they have in it, can be taken out to create a plain simple source for a good base.

Coder Chris
July 20th, 2010, 15:49
oh well....good luck with your 562's and keep up the good work....i only posted it cause most people who want to start off with a blank czar source cant do the ipban
also ima take up a real challenge with 562's idk.... would you be able to help if i go wrong somewhere?

Emily
July 20th, 2010, 15:51
oh well....good luck with your 562's and keep up the good work....i only posted it cause most people who want to start off with a blank czar source cant do the ipban
also ima take up a real challenge with 562's idk.... would you be able to help if i go wrong somewhere?

Yeah I'm basically in charge of the 562 help section, so if you get errors just post the error's that you see in the compiler, and I'll help.

Tunechi
March 15th, 2011, 22:05
Hello I'm Emily, I'm currently making the best 562, with all the mini games that have never been completed before. I don't use tutorials because 98% of these forums can't program correctly, or if they do, very poorly. I program solo, because teaming up means that you are not experienced enough to do it yourself. I've been in rsps since i was 13ish, and been into 562's for two months. I think it's bull shit about 90% of what you've said above, because Allstarscape and Reapage scape, are not shit, but great basic sources to use on 317 projects. "like 1 year ago or less i posted alot of tuts tat were respected" like the fuck anyone cares, honestly this is now, past doesn't matter at all when you are programing, and yes it's a freaking game, so don't steal other peoples work and post it as your own, because that just proves how sad you really are.

Hello, my names Emily. I'm a guy irl. Joking haha. But OT:
Half of what your said isn't true.. "I program solo, because teaming up means that you are not experienced enough to do it yourself.". So graham, canownueasy, emperor.. all of them aren't experienced enough to do it themselves? All of them have done recent projects that they have teamed on.. So think and research before causing a commotion.

Zein
March 22nd, 2012, 21:18
Please Help I dont have public boolean banned(String host)
What i do!!

Zein
March 22nd, 2012, 21:18
Help I dont have public boolean banned(String host)
What do i do?!?