Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect ScoreBoard-Stats to Database #165

Closed
gladionpvp opened this issue Dec 30, 2016 · 5 comments
Closed

Can't connect ScoreBoard-Stats to Database #165

gladionpvp opened this issue Dec 30, 2016 · 5 comments

Comments

@gladionpvp
Copy link

gladionpvp commented Dec 30, 2016

sql.yml

# These settings aren't required if you disable pvpstats.
# Here can you configurate your sql setting.
# If you don't have or want to use a mysql database you can also use a sqlite database
# MySQL example
# The default port for a mysql database is 3306
#  Username: 'bukkit'
#  Password: 'xyz'
#  Isolation: 'SERIALIZABLE'
#  Driver: 'com.mysql.jdbc.Driver'
#  Url: 'jdbc:mysql://IP:PORT/databaseName'
#  Timeout: 1000

SQL-Settings:
  Username: 'Gladion'
  Password: '*********'
  Isolation: 'SERIALIZABLE'
  Driver: 'com.mysql.jdbc.Driver'
  Url: 'jdbc:mysql://89.163.242.88:3306/Gladion'
  Timeout: 1000
  tablePrefix: ''
uuidUse: true

config.yml

# Main configuration

# Compatible mode for other plugins like HealthBar, ColoredTags, GhostPlayer, McCombatLevel, etc. ......
# or the vanilla scoreboard
# In case you miss the log message: this option requires the plugin called ProtocolLib
# This option will work around the Bukkit API and will send raw packets
compatibilityMode: false

# Should be the node disabled-worlds handled as whitelist or blacklist
disabled-worlds-whitelist: false

disabled-worlds:
  - city

Scoreboard:
  Title: '&a&lDeine Statistiken'
  # seconds
  # For instant updates you can or 1 and it will update every second
  Update-delay: 1
  Items:
    '&9Deine PvP-Kills': '%kills%'
    '&9Dein Geld': '%money%'

# Let ScoreboardStats track stats (kills, deaths, mobkills, killstreak) You need no plugin for this
enable-pvpstats: true

Temp-Scoreboard-enabled: true

Temp-Scoreboard:
  Title: '&5&lDie meisten Kills'
  # %mob% | %kills% | %killstreak%
  Type: '%kills%'
  Color: '&9'
  # How many Players would be displayed
  Items: 8
  Intervall-show: 15
  Intervall-disappear: 15

So first of all: The temporary Scoreboard doesn't even show up, secondarily: The line where it should show the kill count ('&9Dein Geld': '%money%') is also not visible in-game.
The Database password is also correct.

The Log when I start the server up:

[17:20:11 INFO]: [ScoreboardStats] Enabling ScoreboardStats v0.9.16
[17:20:11 INFO]: [ScoreboardStats] Registered replacers: [BungeeCordVariables, BukkitGlobalVariables, PlayerPingVariable, GeneralVariables, VaultVariables, BukkitVariables]
[17:20:11 INFO]: DatabasePlatform name:ScoreboardStats platform:sqlite
[17:20:11 INFO]: SubClassFactory parent ClassLoader [com.github.games647.scoreboardstats.ReloadFixLoader]
[17:20:11 INFO]: Entities enhanced[0] subclassed[1]
[17:20:11 INFO]: runScript
[17:20:11 INFO]: executing 1 of 1 create table IF NOT EXISTS player_stats ( id                        integer AUTO...
[17:20:11 WARN]: [ScoreboardStats] Error creating database
javax.persistence.PersistenceException: Error: Error executing stmt[create table IF NOT EXISTS player_stats ( id                        integer AUTOINCREMENT primary key, uuid                      varchar(40), playername                varchar(16) not null, kills                     integer not null, deaths                    integer not null, mobkills                  integer not null, killstreak                integer not null, last_online               timestamp not null, constraint uq_player_stats_uuid unique (uuid)) ] error[[SQLITE_ERROR] SQL error or missing database (near "AUTOINCREMENT": syntax error)]
at com.avaje.ebeaninternal.server.ddl.DdlGenerator.runScript(DdlGenerator.java:233) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at com.github.games647.scoreboardstats.pvpstats.Database.setupDatabase(Database.java:202) [ScoreboardStats.jar:?]
at com.github.games647.scoreboardstats.ScoreboardStats.onEnable(ScoreboardStats.java:141) [ScoreboardStats.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:271) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.bukkit.craftbukkit.v1_11_R1.CraftServer.enablePlugin(CraftServer.java:373) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.bukkit.craftbukkit.v1_11_R1.CraftServer.enablePlugins(CraftServer.java:323) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.bukkit.craftbukkit.v1_11_R1.CraftServer.reload(CraftServer.java:747) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.bukkit.Bukkit.reload(Bukkit.java:539) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchCommand(CraftServer.java:647) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at net.minecraft.server.v1_11_R1.PlayerConnection.handleCommand(PlayerConnection.java:1335) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:1170) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.java:1) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile:13) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_111]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_111]
at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:739) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:399) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:675) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:574) [spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
Caused by: java.lang.RuntimeException: Error executing stmt[create table IF NOT EXISTS player_stats ( id                        integer AUTOINCREMENT primary key, uuid                      varchar(40), playername                varchar(16) not null, kills                     integer not null, deaths                    integer not null, mobkills                  integer not null, killstreak                integer not null, last_online               timestamp not null, constraint uq_player_stats_uuid unique (uuid)) ] error[[SQLITE_ERROR] SQL error or missing database (near "AUTOINCREMENT": syntax error)]
at com.avaje.ebeaninternal.server.ddl.DdlGenerator.runStatement(DdlGenerator.java:281) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at com.avaje.ebeaninternal.server.ddl.DdlGenerator.runStatements(DdlGenerator.java:246) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at com.avaje.ebeaninternal.server.ddl.DdlGenerator.runScript(DdlGenerator.java:224) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
... 25 more
Caused by: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (near "AUTOINCREMENT": syntax error)
at org.sqlite.core.DB.newSQLException(DB.java:909) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.sqlite.core.DB.newSQLException(DB.java:921) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.sqlite.core.DB.throwex(DB.java:886) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.sqlite.core.NativeDB.prepare_utf8(Native Method) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.sqlite.core.NativeDB.prepare(NativeDB.java:127) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.sqlite.core.DB.prepare(DB.java:227) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.sqlite.core.CorePreparedStatement.(CorePreparedStatement.java:41) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.sqlite.jdbc3.JDBC3PreparedStatement.(JDBC3PreparedStatement.java:30) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.sqlite.jdbc4.JDBC4PreparedStatement.(JDBC4PreparedStatement.java:19) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.sqlite.jdbc4.JDBC4Connection.prepareStatement(JDBC4Connection.java:48) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:254) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:226) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at com.avaje.ebeaninternal.server.lib.sql.PooledConnection.prepareStatement(PooledConnection.java:426) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at com.avaje.ebeaninternal.server.lib.sql.PooledConnection.prepareStatement(PooledConnection.java:396) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at com.avaje.ebeaninternal.server.ddl.DdlGenerator.runStatement(DdlGenerator.java:271) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at com.avaje.ebeaninternal.server.ddl.DdlGenerator.runStatements(DdlGenerator.java:246) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
at com.avaje.ebeaninternal.server.ddl.DdlGenerator.runScript(DdlGenerator.java:224) ~[spigot-1.11.jar:git-Spigot-16c940b-0805f60]
... 25 more

Edit: I'm on Spigot 1.11
Edit2: I'm using ScoreboardStats 0.9.16

@games647
Copy link
Owner

It couldn't correctly read your sql config, because it tries to use SQLite than your here posted mysql settings.

@gladionpvp
Copy link
Author

So what am I supposed to do?

Greetings...

@games647
Copy link
Owner

Do you special characters in your sql config?

@gladionpvp
Copy link
Author

Okay, I just edited the sql with Notepad++ seems like FlashFXP default editor made the errors happen.

So now I tested it, killed somebody, it did count the kill but after I reloaded the Server, the kill was gone again... What now?

Thanks forthe answer games647 really appreciate it!

Greetings

@gladionpvp
Copy link
Author

Alright, now it uploads the kills and deaths to the database. But when does the temporary Scoreboard refresh? How long does it take?

Greetings

And thanks for the help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants