mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-06 16:50:39 +00:00
[TASK] Added filters for bugsnag
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
package org.parabot.core;
|
package org.parabot.core;
|
||||||
|
|
||||||
|
import com.bugsnag.BeforeNotify;
|
||||||
import com.bugsnag.Client;
|
import com.bugsnag.Client;
|
||||||
|
import com.bugsnag.Error;
|
||||||
import org.json.simple.JSONObject;
|
import org.json.simple.JSONObject;
|
||||||
import org.json.simple.parser.ParseException;
|
import org.json.simple.parser.ParseException;
|
||||||
import org.parabot.Landing;
|
import org.parabot.Landing;
|
||||||
@@ -301,11 +303,21 @@ public class Core {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setBugsnagVersion(){
|
public static void setBugsnagVersion(){
|
||||||
Core.bugsnagInstance.setReleaseStage(currentVersion.compareTo(latestVersion) >= 0 ? "development" : "production");
|
Core.bugsnagInstance.setReleaseStage(currentVersion != latestVersion ? "development" : "production");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setBugsnagUser(String id, String email, String username){
|
public static void setBugsnagUser(String id, String email, String username){
|
||||||
Core.bugsnagInstance.setUser(id, email, username);
|
// TODO Check order of parameters
|
||||||
|
Core.bugsnagInstance.setUser(username, email, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setBugsnagServer(String server){
|
||||||
|
Core.setBugsnagInformation("Server", "Server", server);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setBugsnagInformation(String tab, String key, String value){
|
||||||
|
// TODO Should be checked if correct
|
||||||
|
Core.bugsnagInstance.addToTab(tab, key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void debug(int i) {
|
public static void debug(int i) {
|
||||||
|
|||||||
@@ -11,9 +11,10 @@ import java.io.*;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds parabot's used directories
|
* Holds and manages Parabot's used directories
|
||||||
*
|
*
|
||||||
* @author Everel
|
* @author Everel
|
||||||
|
* @author JKetelaar
|
||||||
* @author Matt
|
* @author Matt
|
||||||
*/
|
*/
|
||||||
public class Directories {
|
public class Directories {
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ public class Script implements Runnable {
|
|||||||
if(state < 0 || state > 2) {
|
if(state < 0 || state > 2) {
|
||||||
throw new IllegalArgumentException("Illegal state");
|
throw new IllegalArgumentException("Illegal state");
|
||||||
}
|
}
|
||||||
|
Core.setBugsnagInformation("Script", "State", String.valueOf(state));
|
||||||
this.state = state;
|
this.state = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,5 +181,6 @@ public class Script implements Runnable {
|
|||||||
|
|
||||||
public void setScriptID(int scriptID){
|
public void setScriptID(int scriptID){
|
||||||
this.scriptID = scriptID;
|
this.scriptID = scriptID;
|
||||||
|
Core.setBugsnagInformation("Script", "State", String.valueOf(scriptID));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.parabot.environment.servers.executers;
|
package org.parabot.environment.servers.executers;
|
||||||
|
|
||||||
import org.parabot.core.Context;
|
import org.parabot.core.Context;
|
||||||
|
import org.parabot.core.Core;
|
||||||
import org.parabot.core.parsers.randoms.RandomParser;
|
import org.parabot.core.parsers.randoms.RandomParser;
|
||||||
import org.parabot.core.ui.components.PaintComponent;
|
import org.parabot.core.ui.components.PaintComponent;
|
||||||
import org.parabot.environment.servers.ServerProvider;
|
import org.parabot.environment.servers.ServerProvider;
|
||||||
@@ -23,6 +24,8 @@ public abstract class ServerExecuter {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
|
Core.setBugsnagServer(serverName);
|
||||||
|
|
||||||
Context context = Context.getInstance(provider);
|
Context context = Context.getInstance(provider);
|
||||||
context.load();
|
context.load();
|
||||||
PaintComponent.getInstance().startPainting(context);
|
PaintComponent.getInstance().startPainting(context);
|
||||||
|
|||||||
Reference in New Issue
Block a user