Yeah probably is. You could add an interface with it too, to make it look better
|
Hello guys,I have been thinking about some commands and Im wondering if this is possible to make,
Lets say a staff member types in a command :howaccs and all of the persons accounts from that ip shows up as a list on the staffs member screen?is this possible to code,so for example some kid gets mad on someone and he makes a new account and starts flaming,so staff could see do :howaccs and all accounts from the persons ip shows up,so they would be able to know whos the main,is this possible to code?
Yeah probably is. You could add an interface with it too, to make it look better
Make an interface hook it up to a command then hook other shit with it. I don't know how too do it but it would be a sick idea.
check the ip the player is connected to, then check the accounts for the ip they were last logged in with
Not testedCode:PlayerSave.java charafterfile.write("ip-address = ", 0, 13); characterfile.write(p.connectedFrom, 0, p.connectedFrom.length()); Commands.java if (playerCommand.equalsIgnoreCase("showaccounts")) { String[] args = playerCommand.split(" "); String name = args[1]; for (int i = 0; i < Server.playerHandler.players.length; i++) { Client o = (Client) Server.playerHandler.players[i]; if (o != null) { if (o.playerName.equalsIgnoreCase(name)) { String address = o.connectedFrom; c.getPA().showAccounts(address); } } } } PlayerAssistant.java public void showAccounts(String address) { File path = new File(".Data/characters/"); File[] characterFiles = path.listFiles(); for (int i = 0; i < characterFiles.length; i++) { try { String name = characterFiles[i].getName(); BufferedReader b = new BufferedReader(new FileReader(path +""+ name)); String line; try { line = b.readLine(); while (line != null) { if (line.startsWith("ip-address")) { int spot = line.indexOf("="); String ip = line.substring(0, (spot + 1)); if (ip.equalsIgnoreCase(address)) { c.sendMessage(name +" - "+ ip); } } } } finally { b.close(); } } catch (FileNotFoundException e) { e.printStackTrace(); } } }
Code:src\server\model\mobile\players\PlayerAssistant.java:154: error: cannot find sym bol File path = new File(".Data/characters/"); ^ symbol: class File location: class PlayerAssistant src\server\model\mobile\players\PlayerAssistant.java:154: error: cannot find sym bol File path = new File(".Data/characters/"); ^ symbol: class File location: class PlayerAssistant src\server\model\mobile\players\PlayerAssistant.java:155: error: cannot find sym bol File[] characterFiles = path.listFiles(); ^ symbol: class File location: class PlayerAssistant src\server\model\mobile\players\PlayerAssistant.java:159: error: cannot find sym bol BufferedReader b = new BufferedReader(new FileRe ader(path +""+ name)); ^ symbol: class BufferedReader location: class PlayerAssistant src\server\model\mobile\players\PlayerAssistant.java:159: error: cannot find sym bol BufferedReader b = new BufferedReader(new FileRe ader(path +""+ name)); ^ symbol: class BufferedReader location: class PlayerAssistant src\server\model\mobile\players\PlayerAssistant.java:159: error: cannot find sym bol BufferedReader b = new BufferedReader(new FileRe ader(path +""+ name)); ^ symbol: class FileReader location: class PlayerAssistant src\server\model\mobile\players\PlayerAssistant.java:175: error: cannot find sym bol } catch (FileNotFoundException e) { ^ symbol: class FileNotFoundException location: class PlayerAssistant Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 7 errors Trykk en tast for ĺ fortsette...
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |