MultiInv

359k Downloads

Spectator mode handling

zankia opened this issue ยท 1 comments

commented

Hello,

I have this error when a player in spectator mode goes to another world

[19:04:52 WARN]: java.sql.SQLException: Data truncated for column 'inv_gamemode' at row 1
[19:04:52 WARN]:        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:959)
[19:04:52 WARN]:        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3870)
[19:04:52 WARN]:        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3806)
[19:04:52 WARN]:        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2470)
[19:04:52 WARN]:        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2617)
[19:04:52 WARN]:        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2546)
[19:04:52 WARN]:        at com.mysql.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1541)
[19:04:52 WARN]:        at com.mysql.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2605)
[19:04:52 WARN]:        at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1469)
[19:04:52 WARN]:        at uk.co.tggl.pluckerpluck.multiinv.mysql.SqlConnector.run(SqlConnector.java:800)
[19:04:52 WARN]:        at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftTask.run(CraftTask.java:71)
[19:04:52 WARN]:        at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
[19:04:52 WARN]:        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[19:04:52 WARN]:        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[19:04:52 WARN]:        at java.lang.Thread.run(Thread.java:745)

There is no value SPECTATOR in inv_gamemode column in MySQL

commented

This could be corrected with this in SqlConnector:355

"`inv_gamemode` ENUM('ADVENTURE','CREATIVE','SURVIVAL','SPECTATOR') CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL COMMENT 'ADVENTURE, CREATIVE SURVIVAL or SPECTATOR game mode.', "

note that enum in MySQL is quite bad...