YiC200333 / XConomy

An economy plugin that supports data synchronization between multiple servers
GNU General Public License v3.0
92 stars 32 forks source link

[mysql] strange withdraw/deposit within a second #107

Closed hkkongou closed 10 months ago

hkkongou commented 11 months ago

Version of XConomy
XConomy-Bukkit-2.22.1

Server version
purpur 1.20.1

Storage-type
MySQL

Describe the issues
mysql is behaving strange, within a second, withdraw and deposit happen, and then player report their money got reset to 0


(option)XConomy's config.yml

https://paste.denizenscript.com/View/113296

(option)Screenshots image

YiC200333 commented 11 months ago

Do u install XConomy in the BungeeCord?

hkkongou commented 11 months ago

Do u install XConomy in the BungeeCord?

Yes I have installed xconomy in the bungeecord this time (last time you reminded me) The plugin show message in bungeecord xconomy enabled.

YiC200333 commented 11 months ago

Is it still strange? Do all the xconomy configuration files are the same on these server including database.yml?

hkkongou commented 11 months ago

Is it still strange? Do all the xconomy configuration files are the same on these server including database.yml?

no players report problem to me so far, so i am not sure whether it happened again. All configuration are same including database.yml , except config.yml SyncData.sign , I got different server different value, is that correct or i should have all server having same value of SyncData.sign?

YiC200333 commented 11 months ago

Sign is used for grouping. If these two servers need to synchronize data, it's best to directly copy the configuration file.

hkkongou commented 11 months ago

Sign is used for grouping. If these two servers need to synchronize data, it's best to directly copy the configuration file.

now i have all files the same, running for a 1week, another player reported another case of money got reset to 0 when login, server have no crashes within the entire week.

Mysql mode record 1200003 is previous log off , after log in again(next record) he see himself have 0 money, then he ask other player to give 10000, so that you see next record have 10000 due to pay.

Any clues?

这个星期也遇到同样情况,另一个玩家回报了另外一个同类的事件,连线时候金钱变为0,服务器整个月没有发生过崩溃

mysql 模式 记录1200003是上次离线前的记录,再次上线(下次记录),该玩家发现自己的自己的身上金钱是0,之后他找其他玩家给钱10000,所以纪录显示下一个记录有$10000来自pay

有什么解决方法吗

image

YiC200333 commented 11 months ago

最新的版本试了吗?

hkkongou commented 11 months ago

最新的版本试了吗?

刚刚更新了,或许看一至两个礼拜怎样吧谢谢

另外想问一下新版本支援的mariadb连接要怎样做,我db是mariadb的,我直接改连接模式做mariadb无法连接,有报错。那个DatabaseDrivers要怎样安装?

[10:11:57 INFO]: [XConomy] 數據保存方式 - MariaDB
[10:11:57 INFO]: [me.yic.xc_libs.zaxxer.hikari.HikariDataSource] [XConomy] - Starting...
[10:11:57 ERROR]: Error occurred while enabling XConomy v2.24.4 (Is it up to date?)
java.lang.RuntimeException: Failed to get driver instance for jdbcUrl=jdbc:mariadb://localhost:3306/main_xc?characterEncoding=utf8&useSSL=false
    at me.yic.xc_libs.zaxxer.hikari.util.DriverDataSource.<init>(DriverDataSource.java:114) ~[XConomy-Paper-2.24.4.jar:?]
    at me.yic.xc_libs.zaxxer.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:326) ~[XConomy-Paper-2.24.4.jar:?]
    at me.yic.xc_libs.zaxxer.hikari.pool.PoolBase.<init>(PoolBase.java:112) ~[XConomy-Paper-2.24.4.jar:?]
    at me.yic.xc_libs.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:93) ~[XConomy-Paper-2.24.4.jar:?]
    at me.yic.xc_libs.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[XConomy-Paper-2.24.4.jar:?]
    at me.yic.xconomy.utils.DatabaseConnection.getConnection(DatabaseConnection.java:183) ~[XConomy-Paper-2.24.4.jar:?]
    at me.yic.xconomy.utils.DatabaseConnection.setGlobalConnection(DatabaseConnection.java:125) ~[XConomy-Paper-2.24.4.jar:?]
    at me.yic.xconomy.data.sql.SQL.con(SQL.java:54) ~[XConomy-Paper-2.24.4.jar:?]
    at me.yic.xconomy.data.DataLink.create(DataLink.java:67) ~[XConomy-Paper-2.24.4.jar:?]
    at me.yic.xconomy.XConomy.onEnable(XConomy.java:103) ~[XConomy-Paper-2.24.4.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[purpur-1.20.1.jar:git-Purpur-2017]
    at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[purpur-1.20.1.jar:git-Purpur-2017]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:653) ~[purpur-1.20.1.jar:git-Purpur-2017]
    at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:564) ~[purpur-1.20.1.jar:git-Purpur-2017]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:311) ~[purpur-1.20.1.jar:git-Purpur-2017]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1117) ~[purpur-1.20.1.jar:git-Purpur-2017]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[purpur-1.20.1.jar:git-Purpur-2017]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.sql.SQLException: No suitable driver
    at java.sql.DriverManager.getDriver(DriverManager.java:299) ~[java.sql:?]
    at me.yic.xc_libs.zaxxer.hikari.util.DriverDataSource.<init>(DriverDataSource.java:106) ~[XConomy-Paper-2.24.4.jar:?]
    ... 19 more
[10:11:57 INFO]: [XConomy] Disabling XConomy v2.24.4
[10:11:57 INFO]: [XConomy] XConomy已成功卸載
YiC200333 commented 11 months ago

https://github.com/YiC200333/DatabaseDrivers/releases 这里下载

hkkongou commented 11 months ago

https://github.com/YiC200333/DatabaseDrivers/releases 这里下载

这个是好像插件那样放在 /plugins 里面吗? 想问一下我mariadb 的话设定用 mysql 和 mariadb 模式有什么分别吗

YiC200333 commented 11 months ago

听说最新版本的mariadb, mysql驱动连不上去,所以添加了一个mariadb

hkkongou commented 11 months ago

听说最新版本的mariadb, mysql驱动连不上去,所以添加了一个mariadb

不好意思,我好奇想了解一下的地方是,xconomy mysql模式也可以连接mariadb,那有什么原因要用这个新的插件配搭xconomy 的 mariadb模式连接mariadb吗,xconomy 会比较快吗还是?

YiC200333 commented 11 months ago

之前有人反馈不兼容的问题,所以我加了mariadb模式,如果你没有需求,用MySQL模式就行