Minecraft(我的世界)中文论坛

标题: [综合]Inventory Sync——同步玩家数据和库存[Sponge][1.8-1.12]

作者: 狡诈师    时间: 2018-3-4 15:04
标题: [综合]Inventory Sync——同步玩家数据和库存[Sponge][1.8-1.12]
本帖最后由 爱国民主 于 2018-3-4 15:04 编辑


  • 首页

上面的目录是可以点击
可能存在延迟


  • 介绍

Inventory Sync插件是一款支持跨服同步玩家库存和数据,在Sponge论坛是很火的插件
如果你想运用在蹦极BungeeCord上,并且同步库存和数据(可选),这个插件是不错的选择

  • 同步库存和数据
当玩家离开服务器后,会自动将玩家库存和数据储存到数据库中
当玩家加入服务器后,会自动从数据库中读取并给玩家分配库存和数据

  • 同步数据类型
  • 库存
  • 穿戴
  • 血量
  • 饥饿
  • 经验等级
  • 游戏模式
  • 药水效果(有些药水无法正常同步,点击阅读

  • 可以在自定义配置
  • 以上默认全部开启


  • 支持数据库类型
  • MySQL(也是MariaDB)
  • H2(文本储存,不推荐)


  • 命令



  • 权限
权限 描述
invsync 全部权限
invsync.sync 同步所有数据类型
invsync.sync.inventory 同步库存
invsync.sync.ender_chest 同步穿戴
invsync.sync.game_mode 同步游戏模式
invsync.sync.experience 同步经验等级
invsync.sync.health 同步血量
invsync.sync.hunger 同步饥饿
invsync.sync.potion_effects 同步药水效果

  • 配置

配置所在位置 config\invsync\invsync.conf
  1. global {
  2.     # 等待其它服务器完成读入写入数据最大时间
  3.     # 以毫秒为单位
  4. global {
  5.     # 等待其它服务器完成读入写入数据最大时间
  6.     # 以毫秒为单位
  7.     # 如果同步失败,请增大数字
  8.     maxWait=1000
  9. }

  10. # 同步类型
  11. synchronize {
  12.     enableInventory=true
  13.     enableEnderChest=true
  14.     enableGameMode=true
  15.     enableExperience=true
  16.     enableHealth=true
  17.     enableHunger=true
  18.     enablePotionEffects=true
  19. }

  20. storage {
  21.     # 选择存储方式
  22.     # 选择:h2 或 mysql
  23.     storageEngine="h2"
  24.    
  25.     # 存储方式h2的设置
  26.     h2 {
  27.         # 将存储文件存在哪里,可以选择相对路径或绝对路径
  28.         # 如果在多台服务器同步使用时,推荐使用绝对路径
  29.         databaseFile="inventoryStorage.db"
  30.     }
  31.    
  32.     # 存储方式mysql的设置
  33.     MySQL {
  34.         # 数据库IP
  35.         host="localhost"
  36.         # 数据库端口
  37.         port=3306
  38.         # 数据库名
  39.         database="invsync"
  40.         # 数据库用户
  41.         user="invsync"
  42.         # 数据库密码
  43.         password="sup3rS3cur3Pa55w0rd!"
  44.         # 数据库表前缀
  45.         tablePrefix="invsync_"
  46.     }
  47. }
复制代码


  • 反馈建议和错误

如果你有建议或发现错误
请前往此处反馈:https://github.com/AuraDevelopmentTeam/InvSync/issues


  • 支持作者

如果你想支持作者的团队
可以去此处看看:https://www.patreon.com/AuraDev


  • bStats

这个插件使用了bStats来收集插件数据
使作者更好地开发插件
如果你想关闭,可以在 config\bStats\config.conf 关闭


  • 下载

原贴下载:https://ore.spongepowered.org/BrainStone/Inventory-Sync/versions
插件适用于Sponge服务端



作者: 海贼王#    时间: 2018-3-4 15:31
不管什么先支持
作者: _DIM_    时间: 2018-3-4 17:37
可以同步MOD物品吗?
建议将成就也同步一下
作者: 狡诈师    时间: 2018-3-4 17:49
酷车手BB弹 发表于 2018-3-4 17:37
可以同步MOD物品吗?
建议将成就也同步一下

不知道,我反馈给作者,那个,还有……我不是作者2333
作者: 左右1    时间: 2018-3-7 16:45
可以同步点券吗
作者: 狡诈师    时间: 2018-3-9 19:50
左右1 发表于 2018-3-7 16:45
可以同步点券吗

不在同步数据范围内,去看看点券插件能不能同步
作者: MJZC    时间: 2018-3-27 08:31
这个插件非常有潜力~
作者: 梦江南    时间: 2018-3-27 10:53
可以开群组了
作者: DALAO666    时间: 2018-5-14 01:33
表示 同步不了 怎么回事0.0 配置正确 也调大了数值 跨服后 还是无背包
作者: 二哈大魔王    时间: 2018-5-29 02:07
酷车手BB弹 发表于 2018-3-4 17:37
可以同步MOD物品吗?
建议将成就也同步一下

sponge 不是说不区分mod和插件了嘛。。所有的插件也是mod了。。 那理论上是不是 可以同步
作者: 尘    时间: 2018-7-31 20:36
爱国民主 发表于 2018-3-4 17:49
不知道,我反馈给作者,那个,还有……我不是作者2333

所以作者的答复是
作者: a854124946    时间: 2018-8-9 07:55
亲测无法支持
报错如下:
[07:50:34] [HikariPool-1 housekeeper/WARN] [com.zaxxer.hikari.pool.ProxyLeakTask]: Connection leak detection triggered for conn1: url=jdbc:h2:E:\William\我的领域\1.12.2-SpongeForge Test\.\config\invsync\inventoryStorage.db user=, stack trace follows
java.lang.Exception: Apparent connection leak detected
        at world.jnc.invsync.util.database.DatabaseConnection.connect(DatabaseConnection.java:43) ~[DatabaseConnection.class:0.6.17]
        at world.jnc.invsync.util.database.DatabaseConnection.<init>(DatabaseConnection.java:35) ~[DatabaseConnection.class:0.6.17]
        at world.jnc.invsync.util.database.H2DatabaseConnection.<init>(H2DatabaseConnection.java:17) ~[H2DatabaseConnection.class:0.6.17]
        at world.jnc.invsync.util.database.DataSource.<init>(DataSource.java:56) ~[DataSource.class:0.6.17]
        at world.jnc.invsync.InventorySync.init(InventorySync.java:114) ~[InventorySync.class:0.6.17]
        at org.spongepowered.common.event.listener.GameInitializationEventListener_InventorySync_init18.handle(Unknown Source) ~[?:?]
        at org.spongepowered.common.event.RegisteredListener.handle(RegisteredListener.java:95) ~[spongeforge-1.12.2-2705-7.1.0-BETA-3361.jar:1.12.2-2705-7.1.0-BETA-3361]
        at org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:383) ~[spongeforge-1.12.2-2705-7.1.0-BETA-3361.jar:1.12.2-2705-7.1.0-BETA-3361]
        at org.spongepowered.mod.event.SpongeModEventManager.extendedPost(SpongeModEventManager.java:443) ~[spongeforge-1.12.2-2705-7.1.0-BETA-3361.jar:1.12.2-2705-7.1.0-BETA-3361]
        at org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:404) ~[spongeforge-1.12.2-2705-7.1.0-BETA-3361.jar:1.12.2-2705-7.1.0-BETA-3361]
        at org.spongepowered.common.SpongeImpl.postEvent(SpongeImpl.java:231) ~[spongeforge-1.12.2-2705-7.1.0-BETA-3361.jar:1.12.2-2705-7.1.0-BETA-3361]
        at org.spongepowered.mod.SpongeMod.onStateEvent(SpongeMod.java:271) ~[spongeforge-1.12.2-2705-7.1.0-BETA-3361.jar:1.12.2-2705-7.1.0-BETA-3361]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_171]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_171]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_171]
        at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[minecraft_server.1.12.2.jar:?]
        at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[minecraft_server.1.12.2.jar:?]
        at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[minecraft_server.1.12.2.jar:?]
        at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[minecraft_server.1.12.2.jar:?]
        at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[minecraft_server.1.12.2.jar:?]
        at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[minecraft_server.1.12.2.jar:?]
        at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[minecraft_server.1.12.2.jar:?]
        at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:218) ~[forge-1.12.2-14.23.4.2740-universal.jar:?]
        at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:196) ~[forge-1.12.2-14.23.4.2740-universal.jar:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_171]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_171]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_171]
        at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[minecraft_server.1.12.2.jar:?]
        at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[minecraft_server.1.12.2.jar:?]
        at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[minecraft_server.1.12.2.jar:?]
        at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[minecraft_server.1.12.2.jar:?]
        at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[minecraft_server.1.12.2.jar:?]
        at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[minecraft_server.1.12.2.jar:?]
        at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[minecraft_server.1.12.2.jar:?]
        at net.minecraftforge.fml.common.LoadController.redirect$onPost$zza000(LoadController.java:560) ~[LoadController.class:?]
        at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135) ~[LoadController.class:?]
        at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:744) ~[Loader.class:?]
        at net.minecraftforge.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:108) ~[FMLServerHandler.class:?]
        at net.minecraftforge.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:337) ~[FMLCommonHandler.class:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:219) ~[nz.class:?]
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:486) ~[MinecraftServer.class:?]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_171]
作者: q1551568826    时间: 2018-10-23 08:57
楼主各位大佬能不能出一个教程 例子给我
作者: PLTAT    时间: 2020-2-23 11:23
本帖最后由 PLTAT 于 2020-2-23 12:49 编辑

[qq]2868398105[/qq]
作者: a1342232759    时间: 2020-3-11 17:57
很感谢楼主的搬运,我想需要一个完整的教程,我改看好久的配置也没连上数据库。
作者: 1871487870    时间: 2020-3-19 02:03
h2绝对路径好像无法正常使用
作者: xiaozia    时间: 2020-5-11 19:43
6666666666666
作者: z19950909    时间: 2020-8-29 22:46
最新版本现在支持1.16了吗