Mattie

Untitled

Dec 20th, 2010
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.36 KB | None | 0 0
  1. //ZET DIT BIJ PROCESSERVERRESPONSE IN PIRCBOT.JAVA
  2.  
  3. else if (code == RPL_USERHOST)//in gebruik om de userhost te krijgen DOOR MATTIE GEMAAKT
  4.         {
  5.             //get nickname
  6.             String nickFromMessage = response.substring(response.indexOf(" :"), response.indexOf("="));
  7.             //get rid of some characters
  8.             nickFromMessage = nickFromMessage.replace(" :", "");
  9.             //get rid of a '*' sometimes (oper???)
  10.             nickFromMessage = nickFromMessage.replace("*", "");
  11.             //get the userhost
  12.             String hostfail = response.substring(response.indexOf("="), response.length());
  13.             //hostfail= everything from "=+...........nl"
  14.             String host = hostfail.substring(2, hostfail.length());
  15.             //remove the '+'
  16.             host = host.replace("+", "");
  17.             //get the realname from the hostname
  18.             String realname = host.substring(0, host.indexOf("@"));
  19.             //get rid of the realname in the hostname
  20.             host = host.substring(host.indexOf("@"), host.length());
  21.             //get rid of the "@" in the hostname
  22.             host = host.replace("@", "");
  23.  
  24.             User[] users = this.getUsers(chantemp);
  25.             for (int i = 0; i < users.length; i++)
  26.             {
  27. //  //DEBUG     System.out.println("nick from message: " + nickFromMessage + "    nick from nick: " + users[i].getNick());
  28.                 if (users[i].getNick().equals(nickFromMessage))
  29.                 {
  30.                     users[i].setHost(host);
  31.                     users[i].setRealName(realname);
  32.                 }
  33.             }
  34. //          chantemp = "";
  35.         }
Advertisement
Add Comment
Please, Sign In to add comment