-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create the bases of a PDSectionConfiguration, the structure that will…
… allow PDSections to be stored on different types of databases and to force the EverNifeCore to load them as soon as possible after a initialization and after a reload - Also add a 'lastSaved' timestemp for all PlayerData. - Implement a enableSmartCache() for all PlayerData's Configs by default. - Force the cacheToString() to all PlayerData that has not logged in on the server on the last 3 days (probably confiurable on the future) - HotLoad properly the given PDSections after EverNifeCore reload, taking more benefits of the cache system for plugins that must read all PlayerData (like FinalEconomy)
- Loading branch information
Showing
6 changed files
with
140 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/main/java/br/com/finalcraft/evernifecore/config/playerdata/PDSectionConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package br.com.finalcraft.evernifecore.config.playerdata; | ||
|
||
import br.com.finalcraft.evernifecore.ecplugin.ECPluginData; | ||
import lombok.Data; | ||
|
||
public class PDSectionConfiguration { | ||
|
||
private final ECPluginData pluginData; | ||
private final Class<? extends PDSection> pdSectionClass; | ||
private final boolean shouldHotLoad; | ||
|
||
public PDSectionConfiguration(ECPluginData pluginData, Class<? extends PDSection> pdSectionClass, boolean shouldHotLoad) { | ||
this.pluginData = pluginData; | ||
this.pdSectionClass = pdSectionClass; | ||
this.shouldHotLoad = shouldHotLoad; | ||
|
||
/** | ||
* The idea of this class is hold several information on how this | ||
* PDSection should behave. | ||
* | ||
* There will be information like: | ||
* shouldHotLoad: will be loaded as soon as PlayerData instance is created; | ||
* storeDataType: UNIVERSAL, SERVER_ONLY | ||
* dataStorageType: YAML, MYSQL, MIXED_MYSQL (YAML with something MYSQL) | ||
*/ | ||
} | ||
|
||
public ECPluginData getPluginData() { | ||
return pluginData; | ||
} | ||
|
||
public Class<? extends PDSection> getPdSectionClass() { | ||
return pdSectionClass; | ||
} | ||
|
||
public boolean shouldHotLoad() { | ||
return shouldHotLoad; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters