I tried to add UUID banning from here... http://www.rune-server.org/runescape...d-banning.html
One of the error codes:
Code:
static String uidForUser = null;
public static void getUidForUser(Client c, String name) {
File file = new File("./Data/characters/" + name + ".txt");
StringBuffer contents = new StringBuffer();
BufferedReader reader = null;
boolean error = false;
try {
reader = new BufferedReader(new FileReader(file));
String text = null;
int line = 0;
int done = 0;
// repeat until all lines is read
while ((text = reader.readLine()) != null && done == 0) {
text = text.trim();
line += 1;
if(line >= 6) {
text = text.trim();
int spot = text.indexOf("=");
String token = text.substring(0, spot);
token = token.trim();
String token2 = text.substring(spot + 1);
token2 = token2.trim();
if(token.equalsIgnoreCase("UUID")) {
uidForUser = token2;
done = 1;
}
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
error = true;
c.sendMessage("Could not find the character file "+name+".txt");
} catch (IOException e) {
e.printStackTrace();
error = true;
c.sendMessage("A problem occured while trying to read the character file for "+name+".");
} finally {
try {
if (reader != null) {
reader.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
//System.out.println(macForUser);
if(!error) {
bannedUid.remove(uidForUser);
deleteFromFile("./Data/bans/UUIDBans.txt", uidForUser);
c.sendMessage("@red@Un-UUID banned user "+name+" with the UUID address of "+uidForUser+".");
}
}
Error:
Code:
src\server\model\players\Client.java:472: error: cannot find symbol
UUID = RS2LoginProtocolDecoder.UUID;
^
symbol: variable RS2LoginProtocolDecoder
location: class Client
src\server\Connection.java:142: error: cannot find symbol
File file = new File("./Data/characters/" + name + ".txt");
^
symbol: class File
location: class Connection
src\server\Connection.java:142: error: cannot find symbol
File file = new File("./Data/characters/" + name + ".txt");
^
symbol: class File
location: class Connection
src\server\Connection.java:168: error: cannot find symbol
} catch (FileNotFoundException e) {
^
symbol: class FileNotFoundException
location: class Connection
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
Press any key to continue . . .