Created quest_log table
This commit is contained in:
parent
cdff96fb4d
commit
6a5261ff9a
|
|
@ -98,7 +98,7 @@ public class Database {
|
||||||
"step_1_progress INT NOT NULL, " +
|
"step_1_progress INT NOT NULL, " +
|
||||||
"step_2_progress INT NOT NULL, " +
|
"step_2_progress INT NOT NULL, " +
|
||||||
"reward_received BIT(1) NOT NULL, " +
|
"reward_received BIT(1) NOT NULL, " +
|
||||||
"PRIMARY KEY (UUID)" +
|
"PRIMARY KEY (uuid)" +
|
||||||
")";
|
")";
|
||||||
getDatabase().getConnection().prepareStatement(sql).executeUpdate();
|
getDatabase().getConnection().prepareStatement(sql).executeUpdate();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
|
|
@ -109,4 +109,22 @@ public class Database {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void createQuestLogTable() {
|
||||||
|
try {
|
||||||
|
String sql = "CREATE TABLE IF NOT EXISTS quest_log(" +
|
||||||
|
"uuid VARCHAR(36) NOT NULL, " +
|
||||||
|
"year INT NOT NULL, " +
|
||||||
|
"month INT NOT NULL, " +
|
||||||
|
"day INT NOT NULL, " +
|
||||||
|
"PRIMARY KEY (uuid, year, month, day)" +
|
||||||
|
")";
|
||||||
|
getDatabase().getConnection().prepareStatement(sql).executeUpdate();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Logger.severe("Error while trying to create quest log table");
|
||||||
|
Logger.severe("Shutting down AltitudeQuests");
|
||||||
|
Bukkit.getPluginManager().disablePlugin(AQuest.getInstance());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -210,10 +210,15 @@ public abstract class Quest {
|
||||||
if (!isDone)
|
if (!isDone)
|
||||||
return;
|
return;
|
||||||
//TODO add completed quest to database
|
//TODO add completed quest to database
|
||||||
|
saveDone(player);
|
||||||
QuestCompleteEvent event = new QuestCompleteEvent(player, this, true);
|
QuestCompleteEvent event = new QuestCompleteEvent(player, this, true);
|
||||||
event.callEvent();
|
event.callEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void saveDone(Player player) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public Variant getVariant() {
|
public Variant getVariant() {
|
||||||
return variant;
|
return variant;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user