1.21 fabric 分支 增加自动续播音乐功能#67
Open
1499501762 wants to merge 32 commits into
Open
Conversation
- Added skipToProgress method in NetMusicAudioStream to allow skipping to a specific playback position. - Enhanced NetMusicSound to support starting playback from a specified progress. - Introduced PlayProgressMessage and UpdatePlayProgressC2SMessage for syncing playback progress between client and server. - Implemented PlayProgressMessageReceiver and UpdatePlayProgressC2SReceiver to handle incoming progress messages. - Updated TileEntityMusicPlayer to manage and synchronize playback progress. - Added logging for progress updates and playback state changes for better debugging.
…and prevent duplicate playback - Added ClientMusicPlaybackManager to track currently playing sounds at specific BlockPos. - Introduced deduplication logic to avoid rapid replays of the same sound. - Updated MusicPlayManager to utilize ClientMusicPlaybackManager for sound registration and playback. - Modified NetMusicSound to register and unregister sounds with ClientMusicPlaybackManager. - Enhanced TileEntityMusicPlayer to handle playback recovery and progress synchronization with the server. - Implemented StopMusicMessage and StopMusicMessageReceiver to handle stopping sounds on the client side. - Removed unnecessary progress update messages from the client to the server, centralizing progress calculation on the server.
…into 1.21-fabric
…eck logic when players join refactor: Optimize music playback management to avoid duplicate message processing
… when entering the servers
…ere is a 'net_cusic_list' mod present
- Added detailed logging in MusicPlayManager for sound instance creation and playback. - Implemented defensive cleanup in MusicToClientMessageReceiver to handle rapid reconnections. - Introduced a delay mechanism for sound creation to ensure audio system readiness. - Added configuration option ENABLE_AUTO_STOP_ON_END in GeneralConfig to control auto-stop behavior. - Improved server event handling for player join and disconnect events, including cleanup of notified flags. - Enhanced TileEntityMusicPlayer with optimizations for player notifications and playback progress synchronization. - Updated language files for new configuration options. fix: Fixed two resume playback failure issues - Fixed an issue where a TE was not added to the ActivePlayersPerWorld map after server restart, resulting in a second resume playback without continuity after server restart - Fixed a rare issue where the world used for loading in single player mode was too long, resulting in a failed resume playback
Author
|
…anagement - Added `EntityMusicPersistentState` to handle persistent storage of entity music sessions. - Introduced `EntityMusicPlayerManager` for managing associations between entities and music players. - Implemented atomic registration and unregistration methods to prevent duplicate playback instances. - Enhanced network messaging to prioritize entity ID lookups for efficient playback restoration. - Updated broadcasting strategy to reduce network noise by notifying only nearby players. - Ensured compatibility with existing data structures during migration. - Comprehensive logging for debugging and monitoring playback sessions.
Author
|
… management during playback
Author
|
|
@1499501762 我看到你的移植是fork的fabric版本的播放列表,但是那个版本是个半成品,不推荐使用(就一个正式版),目前活跃的是1.21.1neoforge,你可以试试移植这个版本的(而且歌曲缓存我已经写了),同版本应该会好移植一点。 |
… during world initialization.
…n backend/entity NBT recovery or health check mechanisms
… prevent race conditions with audio thread readiness
…session management and cleanup mechanism
…and audio stream pre-warming
Author
|
Author
已计划移植,目前看到你这个模组的依赖里面有create和flywheel, |
…allow pending creations
Change/1.21 fabric recovery
Author
|
…ate playWithKey signature and callers
…o reduce lyric desync
…e delays; improve pending creation handling
Author
|
…io probes until voicechat is connected
…ize the handling and retry strategy of playback requests
Author
|
…set behavior of voicechat during non-world initialization condition
Owner
|
不好意思前段时间有点忙没来得及处理,我先看看,然后把这部分代码同步到其他三个版本 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
酒石酸佬好,
根据自己的想法在1.21 fabric分支里增加了根据距离自动管理和续播音乐的功能,
在远离唱片机96格自动停止唱片,靠近时续播的功能(应对区块卸载加载环境)
重新载入世界时检查唱片机96格内的玩家并尝试续播
在服务端环境下增加了登入时通过重置玩家标记的简单实现方法完成了服务端环境下在范围内登入的自动续播(因为1tick内清除和重新添加到notified标记的原因还加了对于瞬态标记变化导致音乐异常停止的防护,酒石酸佬也可以改为登出时在所有notified标记内清除,登入时重新检查并加入到notified标记内,目前因为未知原因我这样写notified标记内对应的玩家的UUID不会更新,只能改用现在的比较蠢的实现方法了)
增加了在弹出和更换CD时停止播放并重置进度,以适配机械动力等潜在模组的自动化换唱片结构
另外增加了与net_music_list扩展的支持,会在环境中存在net_music_list模组时在服务端播放一首歌完成后归零播放进度和停止音乐(歌曲结束后停止音乐可能在多个卡顿的环境下可能是不必要的,所以只在安装了扩展的时候向客户端发送停止播放消息以免出现多播的问题)
另外计划加入歌曲缓存功能以便减少网络请求和歌曲加载时间,请问酒石酸佬缓存网易云歌曲和元数据在本地客户端是否是被允许的合法PR?
以下所有PR均已在我本地build和单机/服务端环境测试
再次感谢酒石酸佬创建和维护这个模组!
谢谢!