Adds a MaxChatMessageLength config option under [Main.Advanced] that allows
users to override the protocol-defined maximum chat message length. Default is
0 (auto: 100 for MC 1.10 and below, 256 for MC 1.11+). Some servers like
Hypixel support longer messages on older versions, so this lets users set a
custom limit (e.g. 256 on 1.8.9). Includes a warning about potential kicks
if set incorrectly.
Closes#2947
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/39c78e6a-f748-4f41-a905-2f5d27f99eff
Replace all lock object declarations using 'object' type with the C# 13
System.Threading.Lock type across 12 files. The Lock type provides a
more efficient locking mechanism - when used with lock(), the compiler
automatically uses Lock.EnterScope() instead of Monitor.Enter/Exit.
Also made two previously non-readonly lock fields readonly:
- McClient.DigLock
- Protocol18.MessageSigningLock
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Re-implements the changes from PR #2890, adapted for the current codebase
which uses System.Text.Json.Nodes and HttpClient instead of the legacy
Json.JSONData and hand-rolled SslStream HTTP client.
Changes:
- Settings.cs: Convert AuthlibServer from struct to class with
[TomlDoNotInlineObject]; convert Host to a property that parses
'host:port' syntax; add AuthlibInjectorAPIPath (default '/api/yggdrasil')
for servers that use a different prefix (e.g. Drasl uses '/authlib-injector');
add UseHttps (default true) so local/dev auth servers without TLS work.
- ConfigComments.resx: Add descriptive inline comments for the new
AuthlibServer fields (Host, Port, AuthlibInjectorAPIPath, UseHttps).
- ProtocolHandler.cs: Replace three hardcoded '/api/yggdrasil/...' paths
with AuthlibInjectorAPIPath-based paths (authenticate, refresh, join).
Replace hand-rolled TcpClient+SslStream HTTP in DoHTTPSRequest with
HttpClient+SocketsHttpHandler (ConnectCallback routes through ProxyHandler).
Add useHttps parameter so HTTP-only auth servers are supported.
- KeyUtils.cs: Add AuthServerSupportsProfileKeys() that fetches the
authlib-injector metadata endpoint and checks feature.enable_profile_key.
Update GetNewProfileKeys() to skip key fetch when the auth server does not
support profile keys; build the cert URL dynamically using AuthlibInjectorAPIPath
for Yggdrasil; always fetch real certs instead of returning a dummy response.
Remove MakeDummyResponse() which is no longer needed.
Tested against a local Drasl instance with authlib-injector 1.2.7 on a
1.21.11 Minecraft server — full auth flow (login, profile key fetch, session
join) confirmed working end-to-end.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* 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)
Non-vanilla server may have player name other than English, for example Chinese server can have player name in Chinese. This setting allow MCC to display those non-English name in the player list.