mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-05-26 04:49:51 +08:00
"Autogenerate" data files with data fallbacks and moved keys folder into jar resources (#927)
* Autogenerate keys and data files * Update gacha html files Accidentally pushed with old html files * Keys no longer copied. No more manually retrieving listing files. Recursive directory creation Removed unused code from old GC as well. * Moved somethings and better errors * Fixed resources from loading twice * Data files fallback
This commit is contained in:
committed by
GitHub
Unverified
parent
1adffc21c0
commit
f473e44611
@@ -29,18 +29,7 @@ import static emu.grasscutter.utils.Language.translate;
|
||||
* Handles all gacha-related HTTP requests.
|
||||
*/
|
||||
public final class GachaHandler implements Router {
|
||||
private final String gachaMappings;
|
||||
|
||||
public GachaHandler() {
|
||||
this.gachaMappings = Utils.toFilePath(DATA("gacha/mappings.js"));
|
||||
if(!(new File(this.gachaMappings).exists())) {
|
||||
try {
|
||||
Tools.createGachaMapping(this.gachaMappings);
|
||||
} catch (Exception exception) {
|
||||
Grasscutter.getLogger().warn("Failed to create gacha mappings.", exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
public static final String gachaMappings = DATA(Utils.toFilePath("gacha/mappings.js"));
|
||||
|
||||
@Override public void applyRoutes(Express express, Javalin handle) {
|
||||
express.get("/gacha", GachaHandler::gachaRecords);
|
||||
|
||||
Reference in New Issue
Block a user