Skip to content

Commit

Permalink
Warn if configuration is outdated
Browse files Browse the repository at this point in the history
  • Loading branch information
spaceemotion committed Mar 7, 2013
1 parent 3d841a6 commit 96e5164
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/net/aufdemrand/denizen/Denizen.java
Expand Up @@ -51,7 +51,7 @@


public class Denizen extends JavaPlugin {

public final static double configVersion = 0.88;
public static String versionTag = "0.8.8 pre-release";

private boolean startedSuccessful = false;
Expand Down Expand Up @@ -170,6 +170,13 @@ public void onEnable() {
// Populate config.yml if it doesn't yet exist.
saveDefaultConfig();
reloadConfig();

// Warn if configuration is outdated
if(!getConfig().isSet("version") || getConfig().getDouble("version", 0) < configVersion) {
dB.echoError("Your configuration file seems to be outdated!");
dB.echoError("Please generate a new one by deleteing your current config.yml file in the Denizen folder.");
}

ScriptHelper.reloadScripts();
reloadSaves();

Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/config.yml
@@ -1,3 +1,8 @@
# The current configuration version. DO NOT CHANGE THIS VALUE!!!
# Denizen will check against the latest internal version and warn you if your
# configuration file is outdated!
version: 0.88

# Whether Denizen debug information should be shown in the server
# console or not.
Show Debug: true
Expand Down

0 comments on commit 96e5164

Please sign in to comment.