1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
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;
}
}
|