HorizonSync
HorizonSync 是一款高性能的 Fabric 1.21.1 模组,旨在使用 MongoDB 保持玩家数据的同步与安全。无论你是运行寻求数据冗余的单服务器,还是要求玩家进度通用的服务器网络,HorizonSync 都能确保无缝的体验。
特性
物品栏与装备同步:主物品栏、护甲、副手物品以及末影箱的全面同步。
经验与状态:你的经验等级、进度条、生命值、饥饿值和饱和度将完全保留在你离开时的状态。
药水效果:玩家加入服务器时,激活的状态效果会自动恢复。
高性能持久化:具备 3 分钟异步自动保存系统,并在服务器关闭时进行同步“强制保存”,以防止任何数据丢失。
模组支持
HorizonSync 针对最重要的 Fabric 1.21.1 API 和模组进行了深度集成:
Accessories API:饰品槽位和外观物品的全面同步。
Trinkets API:对所有 Trinkets 槽位的完整支持。
Sophisticated Backpacks (Unofficial Fabric Port):所有背包内容均被序列化并保持同步。
工作原理
与传统方法不同,HorizonSync 利用 MongoDB(NoSQL),允许极其快速且灵活的数据写入:
加入时:从云端检索数据,并通过同步的网络包注入到玩家中。
游戏过程中:异步计时器每 3 分钟保存一次更改,不会影响服务器的 TPS(每秒刻数)。
离开/关闭时:执行最终保存,以确保记录每一个动作和物品。
入门指南
安装:将 HorizonSync .jar 文件放入 Fabric 1.21.1 服务器的 mods 文件夹中。
MongoDB 配置:首次启动时,会在 /config 文件夹中生成一个配置文件。在那里编辑你的 MongoDB 连接字符串(本地或 Atlas)。
连接:确保你的服务器 IP 已在数据库防火墙中白名单化。
准备就绪:HorizonSync 将自动创建必要的集合并开始保护你的数据。
配置选项
所有设置均通过 /config 目录中的配置文件进行管理。
数据库设置
uri: 你的 MongoDB 连接字符串(例如 mongodb+srv://user:pass@cluster.mongodb.net/)。
database: 数据库名称(默认值:horizonsync)。
collection: 用于玩家数据的具体集合(默认值:playerdata)。
常见问题
问:为什么使用 MongoDB 而不是 MySQL?
答:MongoDB 可以更高效地保存复杂对象(如物品 NBT),在处理大型或模组物品栏时减少延迟。
问:如果服务器崩溃会发生什么?
答:得益于 3 分钟自动保存系统,数据丢失被降至最低。玩家最多只会失去最后几分钟的进度。
问:它兼容单人模式吗?
答:HorizonSync 针对专用服务器环境进行了优化。不建议在本地单人世界中使用。
问:它支持来自其他模组的物品吗?
答:是的。只要模组将其数据存储在游戏标准 Minecraft NBT 中,HorizonSync 就会正确序列化和同步它。
HorizonSync – 你的数据,永远在地平线上,始终安全。
HorizonSync
HorizonSync is a high-performance Fabric 1.21.1 mod designed to keep player data synchronized and secure using MongoDB. Whether you are running a single server looking for data redundancy or a network where player progress must be universal, HorizonSync ensures a seamless experience.
Features
Inventory & Equipment Sync: Full synchronization of the main inventory, armor, offhand items, and Ender Chest.
Experience & Stats: Your XP level, bar progress, health, food, and saturation stay exactly as you left them.
Potion Effects: Active status effects are automatically restored when a player joins the server.
High-Performance Persistence: Features a 3-minute asynchronous auto-save system and a synchronous "force-save" on server shutdown to prevent any data loss.
Mod Support
HorizonSync is built with deep integration for the most essential Fabric 1.21.1 APIs and mods:
Accessories API: Full synchronization of accessory slots and cosmetics.
Trinkets API: Complete support for all Trinkets slots.
Sophisticated Backpacks (Unofficial Fabric Port): All backpack contents are serialized and kept in sync.
How It Works
Unlike traditional methods, HorizonSync leverages MongoDB (NoSQL), allowing for extremely fast and flexible data writing:
On Join: Data is retrieved from the cloud and injected into the player via synchronized network packets.
During Gameplay: An asynchronous timer saves changes every 3 minutes without affecting the server's TPS (Ticks Per Second).
On Leave/Shutdown: A final save is performed to ensure every last movement and item is recorded.
Getting Started
Installation: Place the HorizonSync .jar file into the mods folder of your Fabric 1.21.1 server.
MongoDB Configuration: Upon the first launch, a config file will be generated in the /config folder. Edit your MongoDB connection string (Local or Atlas) there.
Connection: Ensure your server's IP is whitelisted in your database firewall.
Ready to Go: HorizonSync will automatically create the necessary collections and begin protecting your data.
Configuration Options
All settings are managed via the configuration file in the /config directory.
Database Settings
uri: Your MongoDB connection string (e.g., mongodb+srv://user:pass@cluster.mongodb.net/).
database: The name of the database (Default: horizonsync).
collection: The specific collection for player data (Default: playerdata).
FAQ
Q: Why use MongoDB instead of MySQL?
A: MongoDB allows for saving complex objects (like Item NBTs) much more efficiently, reducing lag when processing large or modded inventories.
Q: What happens if the server crashes?
A: Thanks to the 3-minute auto-save system, data loss is minimized. Players will only lose, at most, their last few minutes of progress.
Q: Is it compatible with Singleplayer?
A: HorizonSync is optimized for Dedicated Server environments. It is not recommended for local singleplayer worlds.
Q: Does it support items from other mods?
A: Yes. As long as a mod stores its data within the standard Minecraft NBT, HorizonSync will serialize and sync it correctly.
HorizonSync – Your data, always on the horizon, always secure.
评论 0
登录后参与评分
还没有评论,来抢沙发吧