Combination Xx 317-603
Welcome to Conbination Xx ,please make a free account today to have access to making your own topics,if you are new to Unforgivscape,and do not have a client download can be found at the "announcements/updates" section of the Forums thanks for your time and don't forget to vote for us and you can download the new 317 client at http://www.mediafire.com/?3vdw42jcy511d1l
..::The forum Team::..
Combination Xx 317-603
Welcome to Conbination Xx ,please make a free account today to have access to making your own topics,if you are new to Unforgivscape,and do not have a client download can be found at the "announcements/updates" section of the Forums thanks for your time and don't forget to vote for us and you can download the new 317 client at http://www.mediafire.com/?3vdw42jcy511d1l
..::The forum Team::..
Combination Xx 317-603
Would you like to react to this message? Create an account in a few clicks or log in to continue.


Image
 
PlayHomeUnforgivscapeLatest imagesSearchRegisterLog in
Top posters
Awesome4me (842)
censored words? I_vote_lcapcensored words? I_voting_barcensored words? I_vote_rcap 
Sinji (502)
censored words? I_vote_lcapcensored words? I_voting_barcensored words? I_vote_rcap 
Abel (270)
censored words? I_vote_lcapcensored words? I_voting_barcensored words? I_vote_rcap 
Eh Im God (260)
censored words? I_vote_lcapcensored words? I_voting_barcensored words? I_vote_rcap 
Blue Phat (228)
censored words? I_vote_lcapcensored words? I_voting_barcensored words? I_vote_rcap 
Mikenike (227)
censored words? I_vote_lcapcensored words? I_voting_barcensored words? I_vote_rcap 
Travis (223)
censored words? I_vote_lcapcensored words? I_voting_barcensored words? I_vote_rcap 
©I Am G0d I (202)
censored words? I_vote_lcapcensored words? I_voting_barcensored words? I_vote_rcap 
AskingAle (186)
censored words? I_vote_lcapcensored words? I_voting_barcensored words? I_vote_rcap 
๖̶ۣۜMєlaηiє™♥ (136)
censored words? I_vote_lcapcensored words? I_voting_barcensored words? I_vote_rcap 
Latest topics
» NOSTALGIA 2017
censored words? Icon_minitimeSun Jul 22, 2018 11:00 pm by dronza

» Looking for Developers \ Beta Testers \ Coders
censored words? Icon_minitimeMon Sep 04, 2017 9:33 pm by Liam

» I'm back, bitches.
censored words? Icon_minitimeThu Dec 26, 2013 1:33 pm by Liam

» Hey been awhile
censored words? Icon_minitimeThu Dec 26, 2013 12:35 pm by Liam

» Sweet Nostalgia
censored words? Icon_minitimeSat Dec 07, 2013 4:23 am by Abel

» Hello ! [2013]
censored words? Icon_minitimeSun Apr 28, 2013 5:31 am by Abel

» The hell happened?
censored words? Icon_minitimeTue Jan 22, 2013 7:02 pm by MADBRO

» isaac abusing powers
censored words? Icon_minitimeMon Dec 24, 2012 5:52 pm by Travis

» Hello :-)
censored words? Icon_minitimeFri Dec 21, 2012 9:53 pm by dronza


 

 censored words?

Go down 
AuthorMessage
Eh Im God
Legendary Member
Legendary Member
Eh Im God


Posts : 260
Unforgivscape Reputation : 0
Join date : 2011-04-29
Age : 29
Location : united kingdom

censored words? Empty
PostSubject: censored words?   censored words? Icon_minitimeWed May 18, 2011 9:50 pm

This may help stop players cussing.



package org.hyperion.rs2.util;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;

public class Censor {

private static Logger logger = Logger.getLogger(Censor.class.getName());

private static ArrayList<FilterWord> filter = new ArrayList<FilterWord>();

public static void load() {
try {
BufferedReader reader = new BufferedReader(new FileReader("data/censor.txt"));
String line;
while((line = reader.readLine()) != null) {
if(line.equals(""))
continue;
String[] split = line.split(":");
String word = split[0];
String replacement = "";
if(split.length == 2) {
replacement = split[2];
} else if(split.length == 1) {
for(int i = 0; i < word.length(); i++) {
replacement += "*";
}
}
filter.add(new FilterWord(word, replacement, Pattern.compile("(.*)(?i)"+split[0]+"(.*)")));
}
} catch(Exception e) {
logger.log(Level.SEVERE, "Error loading censored words!", e);
}
}

public String filter(String s) {
for(FilterWord word : filter) {
if(word.matches(s)) {
s = word.filter(s);
}
}
return s;
}

public static class FilterWord {

private String replacement;

private String word;

private Pattern pattern;

public FilterWord(String string, String replacement, Pattern pattern) {
this.word = string;
this.replacement = replacement;
this.pattern = pattern;
}

public String filter(String s) {
return s.replaceAll("(?i)"+word, replacement);
}

public String getWord() {
return word;
}

public String getReplacement() {
return replacement;
}

public boolean matches(String s) {
return pattern.matcher(s).matches();
}
}
}


Contact me if this doesn't work but it works for quite a lot of sources ~Eh Im God
Back to top Go down
Guest
Guest




censored words? Empty
PostSubject: Re: censored words?   censored words? Icon_minitimeWed May 18, 2011 9:52 pm

If Your taking this from other websites u Might wanna Give them Credit, + Abel Already has this Thats why When U Say Mom, It makes u Say "I Suck dick A Lot" He just Didn't use it Right -_-
Back to top Go down
Eh Im God
Legendary Member
Legendary Member
Eh Im God


Posts : 260
Unforgivscape Reputation : 0
Join date : 2011-04-29
Age : 29
Location : united kingdom

censored words? Empty
PostSubject: Re: censored words?   censored words? Icon_minitimeWed May 18, 2011 9:55 pm

I have this information stored in my files, from when i've used it for my server, but I thought i would share with others Very Happy
Back to top Go down
Sponsored content





censored words? Empty
PostSubject: Re: censored words?   censored words? Icon_minitime

Back to top Go down
 
censored words?
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Combination Xx 317-603 ::  Coders zone-
Jump to: