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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
|
/* */ package NET.worlds.network;
/* */
/* */ import NET.worlds.console.BBChatCommand;
/* */ import NET.worlds.console.BlackBox;
/* */ import NET.worlds.console.Console;
/* */ import NET.worlds.console.GammaTextArea;
/* */ import NET.worlds.console.MuteListPart;
/* */ import NET.worlds.core.IniFile;
/* */ import NET.worlds.scape.Drone;
/* */ import NET.worlds.scape.Pilot;
/* */ import NET.worlds.scape.PosableDrone;
/* */ import java.io.IOException;
/* */ import java.io.PrintStream;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class textCmd
/* */ extends receivedNetPacket
/* */ {
/* */ public static final byte TEXTCMD = 14;
/* */ protected ObjID _senderID;
/* */ protected String _text;
/* */
/* */ public textCmd()
/* */ {
/* 79 */ this._commandType = 14;
/* */ }
/* */
/* */ public textCmd(String text) {
/* 83 */ super(null, 14);
/* */
/* 85 */ this._senderID = new ObjID("");
/* 86 */ this._text = text;
/* */ }
/* */
/* */ void parseNetData(ServerInputStream data) throws IOException
/* */ {
/* 91 */ this._senderID = new ObjID();
/* 92 */ this._senderID.parseNetData(data);
/* 93 */ this._text = data.readUTF();
/* */ }
/* */
/* */ int packetSize()
/* */ {
/* 98 */ return ServerOutputStream.utfLength(this._text) + 1 + this._senderID.packetSize() +
/* 99 */ super.packetSize();
/* */ }
/* */
/* */ void send(ServerOutputStream o) throws IOException
/* */ {
/* 104 */ super.send(o);
/* 105 */ this._senderID.send(o);
/* 106 */ o.writeUTF(this._text);
/* */ }
/* */
/* */ void process(WorldServer _serv) throws Exception {
/* */ String name;
/* */ String name;
/* 112 */ if (this._senderID.longID() == null) {
/* 113 */ name =
/* 114 */ "[Unknown Name (#" + String.valueOf(this._senderID.shortID()) + ")]";
/* */ } else {
/* 116 */ name = this._senderID.longID();
/* 117 */ if (MuteListPart.isMuted(_serv, name)) {
/* 118 */ return;
/* */ }
/* */ }
/* 121 */ handleActionText(_serv, this._text, name, this._senderID);
/* */
/* 123 */ if (!this._text.startsWith("&|+")) {
/* 124 */ displayText(name, this._text);
/* */ }
/* */ }
/* */
/* */ protected void displayText(String name, String text) {
/* 129 */ String filteredName = FilthFilter.get().filterName(name);
/* 130 */ String line = "";
/* */
/* 132 */ if (IniFile.gamma().getIniInt("classicChatBox", 1) == 1) {
/* 133 */ line = filteredName + "> ";
/* 134 */ line = line + FilthFilter.get().filter(text);
/* 135 */ BlackBox.getInstance().submitEvent(new BBChatCommand(line));
/* 136 */ Console.println(line);
/* 137 */ return;
/* */ }
/* */
/* */
/* 141 */ boolean colored = false;
/* */
/* 143 */ if (Drone.isEmployeeAccount(name)) {
/* 144 */ line = GammaTextArea.colorStartBlueTag + " ";
/* 145 */ colored = true;
/* 146 */ } else if (name.toLowerCase().startsWith(Console.message("host"))) {
/* 147 */ line = GammaTextArea.colorStartRedTag + " ";
/* 148 */ colored = true;
/* 149 */ } else if (name.toLowerCase().startsWith(Console.message("guest-"))) {
/* 150 */ line = GammaTextArea.colorStartMagentaTag + " ";
/* 151 */ colored = true;
/* */ }
/* */
/* */
/* 155 */ line = line + "<b> " + filteredName + "> </b> ";
/* */
/* 157 */ if (colored) {
/* 158 */ line = line + " " + GammaTextArea.colorEndTag + " ";
/* */ }
/* */
/* 161 */ line = line + FilthFilter.get().filter(text);
/* */
/* 163 */ BlackBox.getInstance().submitEvent(new BBChatCommand(line));
/* */
/* 165 */ Console.println(line);
/* */ }
/* */
/* */
/* */ public static void handleActionText(WorldServer _serv, String msg, String name, ObjID senderID)
/* */ {
/* 171 */ if (msg.startsWith("&|+action>")) {
/* 172 */ NetworkObject o = _serv.getObject(senderID);
/* 173 */ if (o == null)
/* */ {
/* 175 */ return;
/* */ }
/* */
/* 178 */ String act = msg.substring(10);
/* */
/* 180 */ if (!(o instanceof PosableDrone)) {
/* 181 */ return;
/* */ }
/* */
/* 184 */ ((PosableDrone)o).animate(act);
/* */ }
/* */
/* */
/* */
/* */
/* 190 */ if (msg.startsWith("&|+action2>"))
/* */ {
/* */
/* */
/* */
/* 195 */ int idx = msg.indexOf("|sender|");
/* 196 */ String senderAction = null;
/* 197 */ String receiverAction = null;
/* 198 */ if (idx != -1) {
/* 199 */ senderAction = msg.substring(idx);
/* 200 */ receiverAction = msg.substring(11, idx);
/* */
/* 202 */ NetworkObject o = _serv.getObject(senderID);
/* 203 */ if ((o != null) &&
/* 204 */ ((o instanceof PosableDrone))) {
/* 205 */ ((PosableDrone)o).animate(senderAction);
/* 206 */ Pilot.sendText("&|+action>" + senderAction);
/* */ }
/* */ }
/* */ else {
/* 210 */ receiverAction = msg.substring(11);
/* */ }
/* */ try
/* */ {
/* 214 */ Console.getActive().getPilot().animate(receiverAction);
/* */ }
/* */ catch (Exception e) {
/* 217 */ System.out.println("Error animating pilot " + e.toString());
/* */ }
/* */ }
/* */ }
/* */
/* */
/* */ public String toString(WorldServer serv)
/* */ {
/* 225 */ return "TEXT " + this._senderID.toString(serv) + ": " + this._text;
/* */ }
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\textCmd.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|