package NET.worlds.network; import NET.worlds.console.Console; import NET.worlds.console.FriendsListPart; import NET.worlds.console.MuteListPart; import NET.worlds.scape.WorldScriptManager; import java.text.MessageFormat; public class whisperCmd extends textCmd { public static final byte WHISPERCMD = 17; private static String rejectMsg = Console.message("not-whispers"); public whisperCmd() { this._commandType = 17; } public whisperCmd(String who, String text) { super(text); WorldScriptManager.getInstance().onConversation(who, text); this._commandType = 17; this._objID = new ObjID(who); } @Override void process(WorldServer _serv) throws Exception { String name; if (this._senderID.longID() == null) { Object[] arguments = new Object[]{new String(String.valueOf(this._senderID.shortID()))}; name = MessageFormat.format(Console.message("Unknown-Name"), arguments); } else { name = this._senderID.longID(); if (MuteListPart.isMuted(_serv, name)) { try { _serv.sendNetworkMsg(new whisperCmd(name, Console.message("have-you-muted"))); } catch (InfiniteWaitException var4) { } catch (PacketTooLargeException var5) { } return; } if (!this._text.startsWith("&|+") && MuteListPart.isRejecting(_serv)) { try { if (!this._text.equals(rejectMsg)) { Object[] arguments = new Object[]{new String(name)}; Console.println(MessageFormat.format(Console.message("You-rejected"), arguments)); _serv.sendNetworkMsg(new whisperCmd(name, rejectMsg)); } } catch (InfiniteWaitException var6) { } catch (PacketTooLargeException var7) { } return; } } FriendsListPart.processWhisper(_serv, name, this._text); handleActionText(_serv, this._text, name, this._senderID); Console.printWhisper(name, FilthFilter.get().filter(this._text)); } @Override public String toString(WorldServer serv) { return Console.message("WHISPER") + " " + this._senderID.toString(serv) + " --> " + this._objID.toString(serv) + ": " + this._text; } }