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

Fix SQLite file not found issue #2371

Merged
merged 1 commit into from
Jun 28, 2021
Merged

Conversation

fntsrlike
Copy link
Contributor

When OP customize bukkit/spigot plugins directory location, SQLite file will still on default directory.
It will cause directory not found exception. Also let SQLite file not correct in the plugin directory.

for example, my server use following script to execute server

SERVER_DIR="$(dirname "$PWD")"
PLUGIN_DIR="${SERVER_DIR}/plugins"
CONFIG_DIR="${SERVER_DIR}/configs"
WORLD_DIR="${SERVER_DIR}/worlds"

cd "${CONFIG_DIR}/vanilla"

java \
    -Dlog4j.configurationFile="${CONFIG_DIR}/log4j2.xml" \
    -server \
    -jar "${SERVER_DIR}/server.jar" \
    --plugins $PLUGIN_DIR \
    --world-dir $WORLD_DIR \
    --bukkit-settings "${CONFIG_DIR}/spigot/bukkit.yml" \
    --spigot-settings "${CONFIG_DIR}/spigot/spigot.yml" \
    --commands-settings "${CONFIG_DIR}/spigot/commands.yml" \
    --nogui

Our directory structure is as following:

server
  configs
    vanilla
    spigot
  plugins
  worlds
  server.jar

In current version, authme.db will create at server/configs/vanilla/plugins/authme/authme.db, and if directory is no exist, it will raise exception and stop server.

Other plugin config files (e.g. config.yml will locate on server/plugins/authme/. The db file and config file not on the same directory. It not out expectation.

The pull request wanna solve this issue. I found the path of db file is hardcode, so I edit to use variable this.dataFolder and use File.separator to concat the path.

When OP customize bukkit/spigot plugins directory location, SQLite file will still on default directory.
It will cause directory not found exception. Also let SQLite file not correct in the plugin directory.
@sgdc3 sgdc3 merged commit 5c23d33 into AuthMe:master Jun 28, 2021
@sgdc3
Copy link
Member

sgdc3 commented Jun 28, 2021

Thank you :)

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