Update Sentry libs

- fix Java Property on startup
This commit is contained in:
Anthony Calosa
2024-08-13 20:11:20 +08:00
parent 3541fe1157
commit 4a2991588b
10 changed files with 48 additions and 24 deletions

View File

@@ -32,7 +32,7 @@
<dependency> <dependency>
<groupId>io.sentry</groupId> <groupId>io.sentry</groupId>
<artifactId>sentry-logback</artifactId> <artifactId>sentry-logback</artifactId>
<version>5.7.0</version> <version>7.14.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -6,6 +6,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import forge.util.Lang; import forge.util.Lang;
import io.sentry.Hint;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import forge.card.ColorSet; import forge.card.ColorSet;
@@ -240,7 +241,9 @@ public class ManaEffect extends SpellAbilityEffect {
Breadcrumb bread = new Breadcrumb(msg); Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", card.getName()); bread.setData("Card", card.getName());
bread.setData("SA", sa.toString()); bread.setData("SA", sa.toString());
Sentry.addBreadcrumb(bread, sa); Hint hint = new Hint();
hint.set(sa.toString(), sa);
Sentry.addBreadcrumb(bread, hint);
continue; continue;
} }

View File

@@ -56,6 +56,7 @@ import forge.util.*;
import forge.util.collect.FCollection; import forge.util.collect.FCollection;
import forge.util.collect.FCollectionView; import forge.util.collect.FCollectionView;
import io.sentry.Breadcrumb; import io.sentry.Breadcrumb;
import io.sentry.Hint;
import io.sentry.Sentry; import io.sentry.Sentry;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.mutable.MutableBoolean; import org.apache.commons.lang3.mutable.MutableBoolean;
@@ -2613,7 +2614,9 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
Breadcrumb bread = new Breadcrumb(msg); Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", this.getName()); bread.setData("Card", this.getName());
bread.setData("Keyword", keyword); bread.setData("Keyword", keyword);
Sentry.addBreadcrumb(bread, this); Hint hint = new Hint();
hint.set(this.getName(), this);
Sentry.addBreadcrumb(bread, hint);
throw new RuntimeException("Error in Card " + this.getName() + " with Keyword " + keyword, e); throw new RuntimeException("Error in Card " + this.getName() + " with Keyword " + keyword, e);
} }
@@ -3184,7 +3187,9 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
Breadcrumb bread = new Breadcrumb(msg); Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", this.getName()); bread.setData("Card", this.getName());
bread.setData("Keyword", keyword); bread.setData("Keyword", keyword);
Sentry.addBreadcrumb(bread, this); Hint hint = new Hint();
hint.set(this.getName(), this);
Sentry.addBreadcrumb(bread, hint);
throw new RuntimeException("Error in Card " + this.getName() + " with Keyword " + keyword, e); throw new RuntimeException("Error in Card " + this.getName() + " with Keyword " + keyword, e);
} }

View File

@@ -10,6 +10,7 @@ import forge.game.ability.ApiType;
import forge.game.player.Player; import forge.game.player.Player;
import forge.game.spellability.SpellAbility; import forge.game.spellability.SpellAbility;
import io.sentry.Breadcrumb; import io.sentry.Breadcrumb;
import io.sentry.Hint;
import io.sentry.Sentry; import io.sentry.Sentry;
import java.util.List; import java.util.List;
@@ -214,7 +215,9 @@ public class CardCopyService {
bread.setData("Card", copyFrom.getName()); bread.setData("Card", copyFrom.getName());
bread.setData("CardState", copyFrom.getCurrentStateName().toString()); bread.setData("CardState", copyFrom.getCurrentStateName().toString());
bread.setData("Player", copyFrom.getController().getName()); bread.setData("Player", copyFrom.getController().getName());
Sentry.addBreadcrumb(bread, copyFrom); Hint hint = new Hint();
hint.set(copyFrom.getName(), copyFrom);
Sentry.addBreadcrumb(bread, hint);
final Card newCopy = new Card(copyFrom.getId(), copyFrom.getPaperCard(), copyFrom.getGame(), null); final Card newCopy = new Card(copyFrom.getId(), copyFrom.getPaperCard(), copyFrom.getGame(), null);
cachedMap.put(copyFrom.getId(), newCopy); cachedMap.put(copyFrom.getId(), newCopy);

View File

@@ -51,6 +51,7 @@ import forge.util.Localizer;
import forge.util.TextUtil; import forge.util.TextUtil;
import io.sentry.Breadcrumb; import io.sentry.Breadcrumb;
import io.sentry.Sentry; import io.sentry.Sentry;
import io.sentry.Hint;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.util.*; import java.util.*;
@@ -542,7 +543,9 @@ public class CardFactoryUtil {
Breadcrumb bread = new Breadcrumb(msg); Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", card.getName()); bread.setData("Card", card.getName());
bread.setData("Ability", rawAbility); bread.setData("Ability", rawAbility);
Sentry.addBreadcrumb(bread, card); Hint hint = new Hint();
hint.set(card.getName(), card);
Sentry.addBreadcrumb(bread, hint);
// rethrow the exception with card Name for the user // rethrow the exception with card Name for the user
throw new RuntimeException("crash in raw Ability, check card script of " + card.getName(), e); throw new RuntimeException("crash in raw Ability, check card script of " + card.getName(), e);

View File

@@ -50,6 +50,7 @@ import forge.game.trigger.Trigger;
import forge.util.collect.FCollection; import forge.util.collect.FCollection;
import forge.util.collect.FCollectionView; import forge.util.collect.FCollectionView;
import io.sentry.Breadcrumb; import io.sentry.Breadcrumb;
import io.sentry.Hint;
import io.sentry.Sentry; import io.sentry.Sentry;
public class CardState extends GameObject implements IHasSVars { public class CardState extends GameObject implements IHasSVars {
@@ -303,7 +304,9 @@ public class CardState extends GameObject implements IHasSVars {
Breadcrumb bread = new Breadcrumb(msg); Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", card.getName()); bread.setData("Card", card.getName());
bread.setData("Keyword", s); bread.setData("Keyword", s);
Sentry.addBreadcrumb(bread, this); Hint hint = new Hint();
hint.set(this.name, this);
Sentry.addBreadcrumb(bread, hint);
//rethrow //rethrow
throw new RuntimeException("Error in Keyword " + s + " for card " + card.getName(), e); throw new RuntimeException("Error in Keyword " + s + " for card " + card.getName(), e);

View File

@@ -17,6 +17,7 @@ import forge.game.staticability.StaticAbility;
import forge.game.trigger.Trigger; import forge.game.trigger.Trigger;
import forge.util.Lang; import forge.util.Lang;
import io.sentry.Breadcrumb; import io.sentry.Breadcrumb;
import io.sentry.Hint;
import io.sentry.Sentry; import io.sentry.Sentry;
public abstract class KeywordInstance<T extends KeywordInstance<?>> implements KeywordInterface { public abstract class KeywordInstance<T extends KeywordInstance<?>> implements KeywordInterface {
@@ -106,7 +107,9 @@ public abstract class KeywordInstance<T extends KeywordInstance<?>> implements K
Breadcrumb bread = new Breadcrumb(msg); Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", host.getName()); bread.setData("Card", host.getName());
bread.setData("Keyword", this.original); bread.setData("Keyword", this.original);
Sentry.addBreadcrumb(bread, this); Hint hint = new Hint();
hint.set(this.original, this);
Sentry.addBreadcrumb(bread, hint);
// add Extra for debugging // add Extra for debugging
Sentry.setExtra("Card", host.getName()); Sentry.setExtra("Card", host.getName());
@@ -122,7 +125,9 @@ public abstract class KeywordInstance<T extends KeywordInstance<?>> implements K
Breadcrumb bread = new Breadcrumb(msg); Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", host.getName()); bread.setData("Card", host.getName());
bread.setData("Keyword", this.original); bread.setData("Keyword", this.original);
Sentry.addBreadcrumb(bread, this); Hint hint = new Hint();
hint.set(this.original, this);
Sentry.addBreadcrumb(bread, hint);
//rethrow //rethrow
throw new RuntimeException("Error in Keyword " + this.original + " for card " + host.getName(), e); throw new RuntimeException("Error in Keyword " + this.original + " for card " + host.getName(), e);
@@ -157,7 +162,9 @@ public abstract class KeywordInstance<T extends KeywordInstance<?>> implements K
Breadcrumb bread = new Breadcrumb(msg); Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Player", player.getName()); bread.setData("Player", player.getName());
bread.setData("Keyword", this.original); bread.setData("Keyword", this.original);
Sentry.addBreadcrumb(bread, this); Hint hint = new Hint();
hint.set(this.original, this);
Sentry.addBreadcrumb(bread, hint);
// add Extra for debugging // add Extra for debugging
Sentry.setExtra("Player", player.getName()); Sentry.setExtra("Player", player.getName());
@@ -173,7 +180,9 @@ public abstract class KeywordInstance<T extends KeywordInstance<?>> implements K
Breadcrumb bread = new Breadcrumb(msg); Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Player", player.getName()); bread.setData("Player", player.getName());
bread.setData("Keyword", this.original); bread.setData("Keyword", this.original);
Sentry.addBreadcrumb(bread, this); Hint hint = new Hint();
hint.set(this.original, this);
Sentry.addBreadcrumb(bread, hint);
//rethrow //rethrow
throw new RuntimeException("Error in Keyword " + this.original + " for player " + player.getName(), e); throw new RuntimeException("Error in Keyword " + this.original + " for player " + player.getName(), e);

View File

@@ -43,6 +43,7 @@ import forge.game.zone.ZoneType;
import forge.util.FileSection; import forge.util.FileSection;
import forge.util.Visitor; import forge.util.Visitor;
import io.sentry.Breadcrumb; import io.sentry.Breadcrumb;
import io.sentry.Hint;
import io.sentry.Sentry; import io.sentry.Sentry;
public class TriggerHandler { public class TriggerHandler {
@@ -135,7 +136,9 @@ public class TriggerHandler {
Breadcrumb bread = new Breadcrumb(msg); Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", host.getName()); bread.setData("Card", host.getName());
bread.setData("Trigger", trigParse); bread.setData("Trigger", trigParse);
Sentry.addBreadcrumb(bread, host); Hint hint = new Hint();
hint.set(host.getName(), host);
Sentry.addBreadcrumb(bread, hint);
//rethrow //rethrow
throw new RuntimeException("Error in Trigger for Card: " + host.getName(), e); throw new RuntimeException("Error in Trigger for Card: " + host.getName(), e);
@@ -163,7 +166,9 @@ public class TriggerHandler {
Breadcrumb bread = new Breadcrumb(msg); Breadcrumb bread = new Breadcrumb(msg);
bread.setData("Card", host.getName()); bread.setData("Card", host.getName());
bread.setData("Params", mapParams.toString()); bread.setData("Params", mapParams.toString());
Sentry.addBreadcrumb(bread, host); Hint hint = new Hint();
hint.set(host.getName(), host);
Sentry.addBreadcrumb(bread, hint);
//rethrow //rethrow
throw new RuntimeException("Error in Trigger for Card: " + host.getName(), e); throw new RuntimeException("Error in Trigger for Card: " + host.getName(), e);

View File

@@ -133,7 +133,7 @@
<dependency> <dependency>
<groupId>io.sentry</groupId> <groupId>io.sentry</groupId>
<artifactId>sentry-android</artifactId> <artifactId>sentry-android</artifactId>
<version>5.7.0</version> <version>7.14.0</version>
<type>aar</type> <type>aar</type>
<exclusions> <exclusions>
<exclusion> <exclusion>
@@ -150,7 +150,7 @@
<dependency> <dependency>
<groupId>io.sentry</groupId> <groupId>io.sentry</groupId>
<artifactId>sentry-android-core</artifactId> <artifactId>sentry-android-core</artifactId>
<version>5.7.0</version> <version>7.14.0</version>
<type>aar</type> <type>aar</type>
<exclusions> <exclusions>
<exclusion> <exclusion>
@@ -170,7 +170,7 @@
<dependency> <dependency>
<groupId>io.sentry</groupId> <groupId>io.sentry</groupId>
<artifactId>sentry-android-ndk</artifactId> <artifactId>sentry-android-ndk</artifactId>
<version>5.7.0</version> <version>7.14.0</version>
<type>aar</type> <type>aar</type>
<exclusions> <exclusions>
<exclusion> <exclusion>
@@ -191,12 +191,6 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!-- runtime dependency of sentry -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.9.0</version>
</dependency>
<dependency> <dependency>
<groupId>com.badlogicgames.gdx-controllers</groupId> <groupId>com.badlogicgames.gdx-controllers</groupId>
<artifactId>gdx-controllers-android</artifactId> <artifactId>gdx-controllers-android</artifactId>

View File

@@ -110,8 +110,7 @@ public final class FModel {
if (GuiBase.isAndroid()) //todo get device on other mobile platforms if (GuiBase.isAndroid()) //todo get device on other mobile platforms
System.out.println(GuiBase.getDeviceName() + " (RAM: " + GuiBase.getDeviceRAM() + "MB, Android " + GuiBase.getAndroidRelease() + " API Level " + GuiBase.getAndroidAPILevel() + ")"); System.out.println(GuiBase.getDeviceName() + " (RAM: " + GuiBase.getDeviceRAM() + "MB, Android " + GuiBase.getAndroidRelease() + " API Level " + GuiBase.getAndroidAPILevel() + ")");
else { else {
System.out.println(System.getProperty("os.name") + " (" + System.getProperty("os.version") + " " + System.getProperty("os.arch") + ")"); System.out.println(System.getProperty("os.name") + " (" + System.getProperty("os.version") + " " + System.getProperty("os.arch") + ")\n" + System.getProperty("java.vendor") + " (Java " + System.getProperty("java.runtime.version") + ", " + System.getProperty("java.vm.name") + ")");
System.out.println("Java Version - " + RuntimeVersion.of(System.getProperty("java.version")).toString());
} }
ImageKeys.initializeDirs( ImageKeys.initializeDirs(
ForgeConstants.CACHE_CARD_PICS_DIR, ForgeConstants.CACHE_CARD_PICS_SUBDIR, ForgeConstants.CACHE_CARD_PICS_DIR, ForgeConstants.CACHE_CARD_PICS_SUBDIR,