--- miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/web/StatusListener.java 2011/12/28 13:20:43 1675 +++ miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/web/StatusListener.java 2012/03/13 17:41:56 1732 @@ -13,10 +13,14 @@ import org.bukkit.configuration.Configuration; -import org.kokakiwi.apicraft.events.ApiEvent; -import org.kokakiwi.apicraft.events.ApiListener; +/*import org.kokakiwi.apicraft.events.ApiEvent; +import org.kokakiwi.apicraft.events.ApiListener;*/ +import de.codeinfection.quickwango.ApiBukkit.ApiBukkit; +import de.codeinfection.quickwango.ApiBukkit.ApiServer.*; -public class StatusListener extends ApiListener { + +@Controller( name = "webstatus", authenticate = false, serializer = "plain" ) +public class StatusListener extends ApiController { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @@ -27,7 +31,10 @@ long cachedTime = 0; String cachedXml = ""; - public StatusListener(Server server, Configuration loginConfig, Configuration homeConfig) { + public StatusListener(Plugin plugin, Server server, Configuration loginConfig, Configuration homeConfig) { + + super( new de.codeinfection.quickwango.Abstraction.Implementations.Bukkit.BukkitPlugin(plugin) ); + this.server = server; this.loginConfig = loginConfig; this.homeConfig = homeConfig; @@ -42,10 +49,10 @@ } @Override - public void onApiEvent(ApiEvent event) { - if(!event.path[0].equalsIgnoreCase("webstatus")) { + public void defaultAction(String action, ApiRequest request, ApiResponse response) { +/* if(!event.path[0].equalsIgnoreCase("webstatus")) { return; - } + }*/ String xml; @@ -61,8 +68,10 @@ } - event.setResponse(xml); - event.setActionTaken(true); +/* event.setResponse(xml); + event.setActionTaken(true);*/ + + response.setContent( xml); } private String buildXML() {