1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.xnap.plugin.opennap.net.msg.server;
21
22
23 import org.xnap.util.QuotedStringTokenizer;
24
25 public class ServerLinksMessage extends ServerMessage {
26
27
28
29 public static final int TYPE = 10112;
30
31
32
33 public String host1;
34 public String host2;
35 public int hops;
36
37
38
39 public ServerLinksMessage(String data) throws InvalidMessageException
40 {
41 super(TYPE, data, 0);
42 }
43
44
45
46 protected void parse(QuotedStringTokenizer t)
47 {
48 host1 = (t.hasMoreTokens()) ? t.nextToken() : null;
49 host2 = (t.hasMoreTokens()) ? t.nextToken() : null;
50 hops = (t.hasMoreTokens()) ? Integer.parseInt(t.nextToken()) : 0;
51 }
52
53 public void received()
54 {
55 StringBuffer sb = new StringBuffer();
56 sb.append(server.getHost());
57 sb.append(": linked ");
58 sb.append(host1);
59 sb.append(", ");
60 sb.append(host2);
61 sb.append(", ");
62 sb.append(hops);
63 sb.append(" hops");
64
65 }
66
67 }