Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ZET DIT BIJ PROCESSERVERRESPONSE IN PIRCBOT.JAVA
- else if (code == RPL_USERHOST)//in gebruik om de userhost te krijgen DOOR MATTIE GEMAAKT
- {
- //get nickname
- String nickFromMessage = response.substring(response.indexOf(" :"), response.indexOf("="));
- //get rid of some characters
- nickFromMessage = nickFromMessage.replace(" :", "");
- //get rid of a '*' sometimes (oper???)
- nickFromMessage = nickFromMessage.replace("*", "");
- //get the userhost
- String hostfail = response.substring(response.indexOf("="), response.length());
- //hostfail= everything from "=+...........nl"
- String host = hostfail.substring(2, hostfail.length());
- //remove the '+'
- host = host.replace("+", "");
- //get the realname from the hostname
- String realname = host.substring(0, host.indexOf("@"));
- //get rid of the realname in the hostname
- host = host.substring(host.indexOf("@"), host.length());
- //get rid of the "@" in the hostname
- host = host.replace("@", "");
- User[] users = this.getUsers(chantemp);
- for (int i = 0; i < users.length; i++)
- {
- // //DEBUG System.out.println("nick from message: " + nickFromMessage + " nick from nick: " + users[i].getNick());
- if (users[i].getNick().equals(nickFromMessage))
- {
- users[i].setHost(host);
- users[i].setRealName(realname);
- }
- }
- // chantemp = "";
- }
Advertisement
Add Comment
Please, Sign In to add comment