Add aikar.co url too

This commit is contained in:
md_5 2013-02-23 09:52:23 +11:00
parent 9c7cbd37c9
commit 20d7972801
1 changed files with 9 additions and 7 deletions

View File

@ -1,4 +1,4 @@
From d03d33ba1d6f53a41a2c17fdafa8e8b45653e8f0 Mon Sep 17 00:00:00 2001 From 60bbe254c90b77065770adc852e57e51b0b0ef81 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Wed, 9 Jan 2013 22:18:26 -0500 Date: Wed, 9 Jan 2013 22:18:26 -0500
Subject: [PATCH] Add CustomTimingsHandler for adding new CraftBukkit custom Subject: [PATCH] Add CustomTimingsHandler for adding new CraftBukkit custom
@ -6,9 +6,9 @@ Subject: [PATCH] Add CustomTimingsHandler for adding new CraftBukkit custom
--- ---
.../org/bukkit/command/defaults/ReloadCommand.java | 2 + .../org/bukkit/command/defaults/ReloadCommand.java | 2 +
.../bukkit/command/defaults/TimingsCommand.java | 65 ++++++++++++++++++++-- .../bukkit/command/defaults/TimingsCommand.java | 67 ++++++++++++++++++++--
.../org/bukkit/event/CustomTimingsHandler.java | 60 ++++++++++++++++++++ .../org/bukkit/event/CustomTimingsHandler.java | 60 +++++++++++++++++++
3 files changed, 121 insertions(+), 6 deletions(-) 3 files changed, 123 insertions(+), 6 deletions(-)
create mode 100644 src/main/java/org/bukkit/event/CustomTimingsHandler.java create mode 100644 src/main/java/org/bukkit/event/CustomTimingsHandler.java
diff --git a/src/main/java/org/bukkit/command/defaults/ReloadCommand.java b/src/main/java/org/bukkit/command/defaults/ReloadCommand.java diff --git a/src/main/java/org/bukkit/command/defaults/ReloadCommand.java b/src/main/java/org/bukkit/command/defaults/ReloadCommand.java
@ -32,7 +32,7 @@ index fb3c90f..fffafa5 100644
Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Reload complete."); Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Reload complete.");
diff --git a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java diff --git a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
index 94cd62c..66edad9 100644 index 94cd62c..7c1e601 100644
--- a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java --- a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java +++ b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
@@ -10,6 +10,7 @@ import org.apache.commons.lang.Validate; @@ -10,6 +10,7 @@ import org.apache.commons.lang.Validate;
@ -121,7 +121,7 @@ index 94cd62c..66edad9 100644
if (separate) sender.sendMessage("Names written to " + names.getPath()); if (separate) sender.sendMessage("Names written to " + names.getPath());
} catch (IOException e) { } catch (IOException e) {
} finally { } finally {
@@ -122,4 +141,38 @@ public class TimingsCommand extends BukkitCommand { @@ -122,4 +141,40 @@ public class TimingsCommand extends BukkitCommand {
} }
return ImmutableList.of(); return ImmutableList.of();
} }
@ -152,7 +152,9 @@ index 94cd62c..66edad9 100644
+ con.getInputStream().close(); + con.getInputStream().close();
+ +
+ String location = con.getHeaderField("Location"); + String location = con.getHeaderField("Location");
+ sender.sendMessage(ChatColor.GREEN + "Your timings have been pasted to " + location + ". Upload to http://aikar.co/timings.php to read the results."); + String pasteID = location.substring("http://paste.ubuntu.com/".length(), location.length() - 1);
+ sender.sendMessage(ChatColor.GREEN + "Your timings have been pasted to " + location);
+ sender.sendMessage(ChatColor.GREEN + "You can view the results at http://aikar.co/timings.php?url=" + pasteID);
+ } catch (IOException ex) { + } catch (IOException ex) {
+ sender.sendMessage(ChatColor.RED + "Error pasting timings, check your console for more information"); + sender.sendMessage(ChatColor.RED + "Error pasting timings, check your console for more information");
+ Bukkit.getServer().getLogger().log(Level.WARNING, "Could not paste timings", ex); + Bukkit.getServer().getLogger().log(Level.WARNING, "Could not paste timings", ex);