Advertisement
Guest User

Untitled

a guest
Jun 6th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. public boolean doLogin(String command, PrintStream out) throws Exception {
  2. String[] args = splitCommand(command);
  3. String UserName = args[0];
  4. String PassWord = calcHash(args[1]);
  5. String Address = args[2];
  6. for (User user : Server.getUsers()) {
  7. if (user.getUserName().equals(UserName))
  8. if (user.getPassWord().equals(PassWord)) {
  9. if (user.getAddress().equalsIgnoreCase("Unkown")) {
  10. user.setAddress(Address);
  11. out.println("New Profile activated.");
  12. }
  13. if (user.getAddress().equals(Address)) {
  14. for (IPBan ban : Server.getIPBans()) {
  15. if (ban.matchesAddress(Address)) {
  16. out.println("You are currently banned. Time remaining : " + ban.getTime());
  17. return false;
  18. }
  19. }
  20. return true;
  21. }
  22. }
  23. }
  24. return false;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement