Skip to content

Commit

Permalink
Add developer debug to holdings store method.
Browse files Browse the repository at this point in the history
  • Loading branch information
creatorfromhell committed Oct 31, 2023
1 parent 8383572 commit 129b66d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ public void store(StorageConnector<?> connector, @NotNull HoldingsEntry object,
yaml.set("Holdings." + MainConfig.yaml().getString("Core.Server.Name")
+ "." + object.getRegion() + "." + object.getCurrency().toString() + "."
+ object.getHandler().asID(), object.getAmount().toPlainString());

TNECore.log().debug("YAMLHoldings-store-Entry ID:" + identifier, DebugLevel.DEVELOPER);
TNECore.log().debug("YAMLHoldings-store-Entry Currency:" + object.getCurrency().toString(), DebugLevel.DEVELOPER);
TNECore.log().debug("YAMLHoldings-store-Entry AMT:" + object.getAmount().toPlainString(), DebugLevel.DEVELOPER);
try {
yaml.save();
yaml = null;
Expand Down
6 changes: 6 additions & 0 deletions Core/src/net/tnemc/core/io/storage/engine/flat/YAML.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ public void reset(StorageConnector<?> connector) {
file.delete();
}
}
final File transactionDirectory = new File(TNECore.directory(), "transactions");
if(transactionDirectory.exists()) {
for(File file : Objects.requireNonNull(transactionDirectory.listFiles())) {
file.delete();
}
}
}

/**
Expand Down

0 comments on commit 129b66d

Please sign in to comment.