Skip to content

Commit

Permalink
Remove trade-short and relevant settings
Browse files Browse the repository at this point in the history
Remove trade-short and relevant settings.

     - Remove trade-short.html/.csv as it's not used often.
     - Remove trade.html settings.
     - Updated to latest 1.18 snapshot.
  • Loading branch information
noahbclarkson committed Dec 1, 2021
1 parent 8c25981 commit 8dfdde0
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 175 deletions.
6 changes: 3 additions & 3 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/">
<accessrules>
<accessrule kind="accessible" pattern="**/com/sun/net/**"/>
</accessrules>
<accessrules>
<accessrule kind="accessible" pattern="**/com/sun/net/**"/>
</accessrules>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies {
implementation 'org.apache.httpcomponents:httpclient:4.5.13'
implementation 'com.github.stefvanschie.inventoryframework:IF:0.10.3'

compileOnly 'org.spigotmc:spigot-api:1.18-pre5-R0.1-SNAPSHOT'
compileOnly 'org.spigotmc:spigot-api:1.18-R0.1-SNAPSHOT'
compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1'
compileOnly 'org.projectlombok:lombok:1.18.22'
compileOnly 'net.essentialsx:EssentialsX:2.19.0'
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/unprotesting/com/github/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private void checkEconomy(){

public static void setupDataFiles(){
dataFiles = new DataFiles(INSTANCE.getDataFolder());
for (int i = 0; i < 8; i++){
for (int i = 0; i < dataFiles.getFileNames().length; i++){
if (!dataFiles.getFiles()[i].exists()){
INSTANCE.saveResource(dataFiles.getFileNames()[i], false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ public boolean onCommand(CommandSender sender, Command command, String trade, St
if (!(player.hasPermission("at.trade") || player.hasPermission("at.admin"))){CommandUtil.noPermission(player);return true;}
String[] arr = Main.getServerIPStrings();
player.spigot().sendMessage(createTextComponent(ChatColor.YELLOW + "View Overall Item Prices", "Click to go to " + arr[0], arr[0]));
player.spigot().sendMessage(createTextComponent(ChatColor.YELLOW + "View Recent Item Prices", "Click to go to " + arr[1], arr[1]));
return true;
}
else{
String[] arr = Main.getServerIPStrings();
Logging.log("Go to: " + arr[0] + " for overall item prices.");
Logging.log("Go to: " + arr[1] + " for recent item prices.");
return true;
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/unprotesting/com/github/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class Config {
@Getter
@Setter
private static Integer port, timePeriod, sellPriceVariationTimePeriod, sellPriceVariationUpdatePeriod, autoSellUpdatePeriod,
autoSellProfitUpdatePeriod, maximumShortTradeLength, InterestRateUpdateRate,
autoSellProfitUpdatePeriod, InterestRateUpdateRate,
tutorialMessagePeriod, updatePricesThreshold;

@Getter
Expand Down Expand Up @@ -45,7 +45,6 @@ public static void loadDefaults() {
Config.setReadFromCSV(getDataFiles().getConfig().getBoolean("read-from-csv", false));

Config.setPort(getDataFiles().getConfig().getInt("port", 8321));
Config.setMaximumShortTradeLength(getDataFiles().getConfig().getInt("maximum-short-trade-length", 144));
Config.setTimePeriod(getDataFiles().getConfig().getInt("time-period", 30));
Config.setAutoSellUpdatePeriod(getDataFiles().getConfig().getInt("auto-sell-update-period", 20));
Config.setAutoSellProfitUpdatePeriod(getDataFiles().getConfig().getInt("auto-sell-profit-update-period", 1200));
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/unprotesting/com/github/config/DataFiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ public class DataFiles {

@Getter
private File[] files;
private final String[] filenames = {"config.yml", "shops.yml", "enchantments.yml", "playerdata.yml", "messages.yml", "web/trade.html", "web/trade-short.html", "web/favicon.ico"};
private final String[] filenames = {"config.yml", "shops.yml", "enchantments.yml", "playerdata.yml", "messages.yml", "web/trade.html", "web/favicon.ico"};
private YamlConfiguration[] configs;

public DataFiles(File dataFolder){
this.files = new File[8];
this.files = new File[7];
this.configs = new YamlConfiguration[5];
for (int i = 0; i < 5; i++){
this.configs[i] = new YamlConfiguration();
}
int i = 0;
for (;i < 8; i++){
for (;i < files.length; i++){
File file = new File(dataFolder, filenames[i]);
files[i] = file;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ public class CSVHandler {

// Create CSV files with all price, buy and sell data to be read by the webpage
public static void writeCSV(){
try {
write("trade", 0);
write("trade-short", Config.getMaximumShortTradeLength());
} catch (IOException e) {
e.printStackTrace();
}
try {write("trade", 0);} catch (IOException e) {e.printStackTrace();}
}

// Create individual CSV file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ private String[] getIP(){
hostIP = in.readLine().trim();
} catch (IOException e) {
e.printStackTrace();
String official_website = "http://autotune.xyz";
return new String[] {official_website, official_website};
String error = "http://autotune.xyz";
return new String[] {error, error};
}
String base = "http://" + hostIP + ":" + Config.getPort();
String[] output = {base + "/trade.html", base + "/trade-short.html"};
String[] output = {base + "/trade.html"};
return output;
}

Expand Down
4 changes: 0 additions & 4 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ web-server-enabled: true
## Make sure to port-forward and disable firewalls for this port.
port: 8123

## The maximum length in data points that the trade-short.html will show (this doesn't affect data)
## Info: When the time-period is set to 30, a maximum-short-trade-length of 48 is one day.
maximum-short-trade-length: 50

## Time Period in minutes
## Info: When decreasing or increasing this adjust your volatility settings accordingly
time-period: 30
Expand Down
150 changes: 0 additions & 150 deletions src/main/resources/web/trade-short.html

This file was deleted.

0 comments on commit 8dfdde0

Please sign in to comment.