Merge pull request 'Fixes and Changes' (#13) from Debug_Changes_and_Fixes into 13.4
Reviewed-on: #13
This commit is contained in:
commit
ee07755493
@ -97,8 +97,7 @@ public class CmdExecuter implements CommandExecutor, TabCompleter {
|
|||||||
if (sender.hasPermission("t2code.admin")) {
|
if (sender.hasPermission("t2code.admin")) {
|
||||||
if (hasPermission(p, arg1.get("debug"))) {
|
if (hasPermission(p, arg1.get("debug"))) {
|
||||||
for (String st : ReportLogStorage.list){
|
for (String st : ReportLogStorage.list){
|
||||||
String[] string = st.split(" - ");
|
if (passend(st,args[2])) list.add(st);
|
||||||
if (passend(st,args[2])) list.add(string[0]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ public class Commands {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
CreateReportLog.delete(args[2]);
|
CreateReportLog.delete(args[2], sender);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ public class CreateReportLog {
|
|||||||
T2Csend.console(Util.getPrefix() + " §6A DebugLog zip has been created. You can download it here: url.\n§6Please enter the following key in the ticket: §e[key].\n§4Do not share the download URL with anyone!\nYou can delte yor Debug-File with the following command: /t2code debug deleteReportLog key.".replace("[key]",fileID).replace("url",downloadURL));
|
T2Csend.console(Util.getPrefix() + " §6A DebugLog zip has been created. You can download it here: url.\n§6Please enter the following key in the ticket: §e[key].\n§4Do not share the download URL with anyone!\nYou can delte yor Debug-File with the following command: /t2code debug deleteReportLog key.".replace("[key]",fileID).replace("url",downloadURL));
|
||||||
} else T2Csend.sender(sender, Util.getPrefix() + " §6A DebugLog zip has been created. You can download it here: url.\n§6Please enter the following key in the ticket: §e[key].\n§4Do not share the download URL with anyone!\nYou can delte yor Debug-File with the following command: /t2code debug deleteReportLog key.".replace("[key]",fileID).replace("url",downloadURL));
|
} else T2Csend.sender(sender, Util.getPrefix() + " §6A DebugLog zip has been created. You can download it here: url.\n§6Please enter the following key in the ticket: §e[key].\n§4Do not share the download URL with anyone!\nYou can delte yor Debug-File with the following command: /t2code debug deleteReportLog key.".replace("[key]",fileID).replace("url",downloadURL));
|
||||||
|
|
||||||
ReportLogStorage.add(fileID +" - "+downloadURL);
|
ReportLogStorage.add(fileID);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void pluginToDebug(String pluginName, ZipOutputStream zip) throws IOException {
|
private static void pluginToDebug(String pluginName, ZipOutputStream zip) throws IOException {
|
||||||
@ -222,10 +222,17 @@ public class CreateReportLog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void delete(String arg) throws IOException {
|
public static void delete(String arg, CommandSender sender) throws IOException {
|
||||||
URL url = new URL("https://debug.t2code.net/delte/" + arg);
|
URL url = new URL("https://debug.t2code.net/delete/" + arg);
|
||||||
HttpURLConnection con = (HttpURLConnection) url.openConnection();
|
HttpURLConnection con = (HttpURLConnection) url.openConnection();
|
||||||
con.setRequestMethod("GET");
|
con.setRequestMethod("GET");
|
||||||
|
int response = con.getResponseCode();
|
||||||
|
if(response == 200){
|
||||||
ReportLogStorage.remove(arg);
|
ReportLogStorage.remove(arg);
|
||||||
|
T2Csend.sender(sender,"<green>Deleted report: <yellow>" + arg);
|
||||||
|
}else {
|
||||||
|
T2Csend.sender(sender,"<green>Error while deleting report: <yellow>" + arg);
|
||||||
|
}
|
||||||
|
con.disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,17 +2,15 @@ package net.t2code.t2codelib.SPIGOT.system.cmd;
|
|||||||
|
|
||||||
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.security.PublicKey;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ReportLogStorage {
|
public class ReportLogStorage {
|
||||||
public static List<String> list = new ArrayList<>();
|
public static List<String> list = new ArrayList<>();
|
||||||
|
|
||||||
protected static File config = new File("T2CodeReportKeys.yml");
|
protected static File config = new File(T2CodeLibMain.getPath(),"T2CodeReportKeys.yml");
|
||||||
protected static YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
protected static YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||||
|
|
||||||
public static void add(String key){
|
public static void add(String key){
|
||||||
@ -26,7 +24,7 @@ public class ReportLogStorage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void save(){
|
public static void save(){
|
||||||
if (list.isEmpty()) return;
|
if (list == null) return;
|
||||||
yamlConfiguration.set("Keys",list);
|
yamlConfiguration.set("Keys",list);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user