Skip to content

Comments

fix: Prevent DiscordRPC crash when text exceeds 128 bytes (#38)#39

Open
kriYamiHikari wants to merge 9 commits intoKxnrl:masterfrom
kriYamiHikari:master
Open

fix: Prevent DiscordRPC crash when text exceeds 128 bytes (#38)#39
kriYamiHikari wants to merge 9 commits intoKxnrl:masterfrom
kriYamiHikari:master

Conversation

@kriYamiHikari
Copy link

  • Added string truncation to handle text overflow and prevent crashes.
  • Fixed a bug where text longer than 128 bytes would cause the program to crash or behave unexpectedly.
  • Ensured that all text sent to DiscordRPC is truncated to the 128-byte limit.

kriYamiHikari and others added 8 commits December 15, 2024 21:57
- Added string truncation to handle text overflow and prevent crashes.
- Fixed a bug where text longer than 128 bytes would cause the program to crash or behave unexpectedly.
- Ensured that all text sent to DiscordRPC is truncated to the 128-byte limit.
- Improved memory access performance by introducing caching mechanisms to avoid redundant queries
- Added debounce logic for state updates to prevent potential RPC API throttling and outdated music info display (Kxnrl#44)

TODO: Refactor
- Extracted core RPC update logic into a dedicated `RpcManager` class
- Simplified the flow in `Program.cs`
- Added caching mechanism for NetEase Cloud Music to reduce memory pressure
- Modified info display to show a small pause icon when playback is stopped instead of clearing the Presence
@Panrium
Copy link

Panrium commented Oct 23, 2025

你好,可以让discord成员列表中的

“Listening to Netease Music"字样

变成 ”Listening to [歌曲名]“吗?

image

@kriYamiHikari
Copy link
Author

你好,可以让discord成员列表中的

“Listening to Netease Music"字样

变成 ”Listening to [歌曲名]“吗?

image

我在新维护的库中发布的版本3.0.2加入了这个支持,可以下载来测试一下。

相关DicordRPC API可以参考该issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants