Add Sentry Error Tracking (#2670)

* Add Sentry Error Tracking

* Omit personally identifiable information and add additional sentry context

* Remove debug message

* Make sentry opt-out and add related notices and strings

Also add Minecraft Version to error context

* Update build to send release info to sentry

* Adjust sentry error tracking

- Send the user-friendly Minecraft Version in the error logs
- Capture exceptions in more parts of the application

We now capture exceptions from the following locations:
- Protocol18 (1.8+) Packet errors
- Errors during client initialization phase (When client is about to start, session keys are NEVER sent to sentry)

* Make Sentry DSN configurable and repository-specific

The Sentry DSN will automatically be filled out on the main repository through the Github Actions build.

* Update build-and-release.yml

Update sed command

* style: change variable name

nitpick, just to make it a little bit more descriptive

* Add Sentry branding in README.

* remove old code (merge conflict)
This commit is contained in:
breadbyte 2024-06-22 06:41:13 +08:00 committed by GitHub
parent 8756ff5b3c
commit 08551097c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 148 additions and 24 deletions

View file

@ -1,7 +1,6 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@ -165,8 +164,8 @@ namespace MinecraftClient {
/// <summary>
/// Looks up a localized string similar to Send a command on a regular or random basis or make the bot walk around randomly to avoid automatic AFK disconnection
////!\ Make sure your server rules do not forbid anti-AFK mechanisms!
////!\ Make sure you keep the bot in an enclosure to prevent it wandering off if you&apos;re using terrain handling! (Recommended size 5x5x5).
/// /!\ Make sure your server rules do not forbid anti-AFK mechanisms!
/// /!\ Make sure you keep the bot in an enclosure to prevent it wandering off if you&apos;re using terrain handling! (Recommended size 5x5x5).
/// </summary>
internal static string ChatBot_AntiAfk {
get {
@ -231,8 +230,8 @@ namespace MinecraftClient {
/// <summary>
/// Looks up a localized string similar to Automatically attack hostile mobs around you
///You need to enable Entity Handling to use this bot
////!\ Make sure server rules allow your planned use of AutoAttack
////!\ SERVER PLUGINS may consider AutoAttack to be a CHEAT MOD and TAKE ACTION AGAINST YOUR ACCOUNT so DOUBLE CHECK WITH SERVER RULES!.
/// /!\ Make sure server rules allow your planned use of AutoAttack
/// /!\ SERVER PLUGINS may consider AutoAttack to be a CHEAT MOD and TAKE ACTION AGAINST YOUR ACCOUNT so DOUBLE CHECK WITH SERVER RULES!.
/// </summary>
internal static string ChatBot_AutoAttack {
get {
@ -501,7 +500,7 @@ namespace MinecraftClient {
/// Looks up a localized string similar to Automatically catch fish using a fishing rod
///Guide: https://mccteam.github.io/g/bots/#auto-fishing
///You can use &quot;/fish&quot; to control the bot manually.
////!\ Make sure server rules allow automated farming before using this bot.
/// /!\ Make sure server rules allow automated farming before using this bot.
/// </summary>
internal static string ChatBot_AutoFishing {
get {
@ -628,7 +627,7 @@ namespace MinecraftClient {
/// <summary>
/// Looks up a localized string similar to Automatically relog when disconnected by server, for example because the server is restating
////!\ Use Ignore_Kick_Message=true at own risk! Server staff might not appreciate if you auto-relog on manual kicks.
/// /!\ Use Ignore_Kick_Message=true at own risk! Server staff might not appreciate if you auto-relog on manual kicks.
/// </summary>
internal static string ChatBot_AutoRelog {
get {
@ -675,7 +674,7 @@ namespace MinecraftClient {
/// <summary>
/// Looks up a localized string similar to Run commands or send messages automatically when a specified pattern is detected in chat
///Server admins can spoof chat messages (/nick, /tellraw) so keep this in mind when implementing AutoRespond rules
////!\ This bot may get spammy depending on your rules, although the global messagecooldown setting can help you avoiding accidental spam.
/// /!\ This bot may get spammy depending on your rules, although the global messagecooldown setting can help you avoiding accidental spam.
/// </summary>
internal static string ChatBot_AutoRespond {
get {
@ -707,7 +706,7 @@ namespace MinecraftClient {
///Documentation: https://mccteam.github.io/g/bots/#discord-bridge
///Setup:
///First you need to create a Bot on the Discord Developers Portal, here is a video tutorial: https://www.youtube.com/watch?v=2FgMnZViNPA .
////!\ IMPORTANT /!\: When creating a bot, you MUST ENABLE &quot;Message Content Intent&quot;, &quot;Server Members Intent&quot; and &quot;Presence Intent [rest of string was truncated]&quot;;.
/// /!\ IMPORTANT /!\: When creating a bot, you MUST ENABLE &quot;Message Content Intent&quot;, &quot;Server Members Intent&quot; and &quot;Presence Intent [rest of string was truncated]&quot;;.
/// </summary>
internal static string ChatBot_DiscordBridge {
get {
@ -799,8 +798,7 @@ namespace MinecraftClient {
///NOTE: This is an experimental feature, the bot can be slow at times, you need to walk with a normal speed and to sometimes stop for it to be able to keep up with you
///It&apos;s similar to making animals follow you when you&apos;re holding food in your hand.
///This is due to a slow pathfinding algorithm, we&apos;re working on getting a better one
///You can tweak the update limit and find what works best for you. (NOTE: Do not but a very low one, because you might achieve the opposite,
/// [rest of string was truncated]&quot;;.
///You can tweak the update limit and find what works best for you. (NOTE: Do not but a very low one, because you might achieve the opposite, /// [rest of string was truncated]&quot;;.
/// </summary>
internal static string ChatBot_FollowPlayer {
get {
@ -829,7 +827,7 @@ namespace MinecraftClient {
/// <summary>
/// Looks up a localized string similar to A small game to demonstrate chat interactions. Players can guess mystery words one letter at a time.
///You need to have ChatFormat working correctly and add yourself in botowners to start the game with /tell &lt;bot username&gt; start
////!\ This bot may get a bit spammy if many players are interacting with it.
/// /!\ This bot may get a bit spammy if many players are interacting with it.
/// </summary>
internal static string ChatBot_HangmanGame {
get {
@ -903,7 +901,7 @@ namespace MinecraftClient {
/// <summary>
/// Looks up a localized string similar to Relay messages between players and servers, like a mail plugin
///This bot can store messages when the recipients are offline, and send them when they join the server
////!\ Server admins can spoof PMs (/tellraw, /nick) so enable this bot only if you trust server admins.
/// /!\ Server admins can spoof PMs (/tellraw, /nick) so enable this bot only if you trust server admins.
/// </summary>
internal static string ChatBot_Mailer {
get {
@ -917,7 +915,7 @@ namespace MinecraftClient {
///The maps are rendered into Rendered_Maps folder if the Save_To_File is enabled.
///NOTE:
///If some servers have a very short time for solving captchas, enabe Auto_Render_On_Update to see them immediatelly in the console.
////!\ Make sure server rules allow bots to be used on the server, or you risk being punished..
/// /!\ Make sure server rules allow bots to be used on the server, or you risk being punished..
/// </summary>
internal static string ChatBot_Map {
get {
@ -1020,7 +1018,7 @@ namespace MinecraftClient {
/// <summary>
/// Looks up a localized string similar to Send MCC console commands to your bot through server PMs (/tell)
///You need to have ChatFormat working correctly and add yourself in botowners to use the bot
////!\ Server admins can spoof PMs (/tellraw, /nick) so enable RemoteControl only if you trust server admins.
/// /!\ Server admins can spoof PMs (/tellraw, /nick) so enable RemoteControl only if you trust server admins.
/// </summary>
internal static string ChatBot_RemoteControl {
get {
@ -1031,7 +1029,7 @@ namespace MinecraftClient {
/// <summary>
/// Looks up a localized string similar to Enable recording of the game (/replay start) and replay it later using the Replay Mod (https://www.replaymod.com/)
///Please note that due to technical limitations, the client player (you) will not be shown in the replay file
////!\ You SHOULD use /replay stop or exit the program gracefully with /quit OR THE REPLAY FILE MAY GET CORRUPT!.
/// /!\ You SHOULD use /replay stop or exit the program gracefully with /quit OR THE REPLAY FILE MAY GET CORRUPT!.
/// </summary>
internal static string ChatBot_ReplayCapture {
get {
@ -1060,7 +1058,7 @@ namespace MinecraftClient {
/// <summary>
/// Looks up a localized string similar to This bot allows you to send and receive messages and commands via a Telegram Bot DM or to receive messages in a Telegram channel.
////!\ NOTE: You can&apos;t send messages and commands from a group channel, you can only send them in the bot DM, but you can get the messages from the client in a group channel.
/// /!\ NOTE: You can&apos;t send messages and commands from a group channel, you can only send them in the bot DM, but you can get the messages from the client in a group channel.
///-----------------------------------------------------------
///Setup:
///First you need to create a Telegram bot and obtain an API key, to do so, go to Telegram and find @botfather
@ -1451,6 +1449,15 @@ namespace MinecraftClient {
}
}
/// <summary>
/// Looks up a localized string similar to Set to false to opt-out of Sentry error logging..
/// </summary>
internal static string Main_Advanced_enable_sentry {
get {
return ResourceManager.GetString("Main.Advanced.enable_sentry", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Toggle entity handling..
/// </summary>
@ -1844,7 +1851,7 @@ namespace MinecraftClient {
/// Looks up a localized string similar to Connect to a server via a proxy instead of connecting directly
///If Mojang session services are blocked on your network, set Enabled_Login=true to login using proxy.
///If the connection to the Minecraft game server is blocked by the firewall, set Enabled_Ingame=true to use a proxy to connect to the game server.
////!\ Make sure your server rules allow Proxies or VPNs before setting enabled=true, or you may face consequences!.
/// /!\ Make sure your server rules allow Proxies or VPNs before setting enabled=true, or you may face consequences!.
/// </summary>
internal static string Proxy {
get {
@ -2005,4 +2012,4 @@ namespace MinecraftClient {
}
}
}
}
}

View file

@ -852,4 +852,7 @@ If the connection to the Minecraft game server is blocked by the firewall, set E
<data name="Main.General.AuthlibServer" xml:space="preserve">
<value>Yggdrasil authlib server domain name and port.</value>
</data>
<data name="Main.Advanced.enable_sentry" xml:space="preserve">
<value>Set to false to opt-out of Sentry error logging.</value>
</data>
</root>

View file

@ -1,7 +1,6 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@ -5782,6 +5781,15 @@ namespace MinecraftClient {
}
}
/// <summary>
/// Looks up a localized string similar to MCC uses Sentry to log errors. You can opt-out by setting the EnableSentry option in the configuration file to false..
/// </summary>
internal static string mcc_sentry_logging {
get {
return ResourceManager.GetString("mcc.sentry_logging", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Server is in offline mode..
/// </summary>

View file

@ -2130,4 +2130,7 @@ Logging in...</value>
<data name="mcc.select_profile" xml:space="preserve">
<value>Select a profile from available profiles:</value>
</data>
<data name="mcc.sentry_logging" xml:space="preserve">
<value>MCC uses Sentry to log errors. You can opt-out by setting the EnableSentry option in the configuration file to false.</value>
</data>
</root>