45 |
|
|
46 |
@Override |
@Override |
47 |
public void handle(HttpExchange http) throws IOException { |
public void handle(HttpExchange http) throws IOException { |
|
/* if(!event.path[0].equalsIgnoreCase("webstatus")) { |
|
|
return; |
|
|
}*/ |
|
48 |
|
|
49 |
String xml; |
String xml; |
50 |
|
|
60 |
} |
} |
61 |
|
|
62 |
|
|
|
/* event.setResponse(xml); |
|
|
event.setActionTaken(true);*/ |
|
63 |
byte bytes[] = xml.getBytes(); |
byte bytes[] = xml.getBytes(); |
64 |
http.getResponseHeaders().add("Content-Type", "text/plain"); |
http.getResponseHeaders().add("Content-Type", "text/plain"); |
65 |
http.sendResponseHeaders(HttpURLConnection.HTTP_OK, bytes.length ); |
http.sendResponseHeaders(HttpURLConnection.HTTP_OK, bytes.length ); |
98 |
|
|
99 |
sb.append("<player>\n"); |
sb.append("<player>\n"); |
100 |
sb.append("<name>" + player.getName() + "</name>\n" ); |
sb.append("<name>" + player.getName() + "</name>\n" ); |
101 |
|
sb.append("<uuid>" + player.getUniqueId() + "</uuid>\n" ); |
102 |
|
|
103 |
sb.append("<firstseen>" + formatTime(first) + "</firstseen>\n"); |
sb.append("<firstseen>" + formatTime(first) + "</firstseen>\n"); |
104 |
sb.append("<lastseen>" + formatTime(last) + "</lastseen>\n"); |
sb.append("<lastseen>" + formatTime(last) + "</lastseen>\n"); |