Use a database, or search through the save file in the psave IO.
|
I could care less about checking passwords, the code is more to provide an example of what I'm trying to accomplish.
This code would only work if a player is online. What would I need to add to view passwords for offline players?
Code:Player p2 = World.getPlayerByDisplayName(name); if (p2 == null || !p2.isOnline()) { player.getPackets().sendGameMessage(name + " could not be found."); return; } if (p2.getRights() > 1) { return; } player.getPackets().sendGameMessage(p2.getDisplayName() + "'s password is <col=FF0000>" + p2.getPassword());
Use a database, or search through the save file in the psave IO.
what are you using to save players?
Not my recommended way to save player data but your going to have to add that players save file to a stream and grab the info that way
I still wouldnt recommend this alternatively you could change the player saving method or add master password for you onlyCode:Player other = SerializableFilesManager.loadPlayer(Utils.formatPlayerNameForProtocol(name));
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |