Skip to content

Commit

Permalink
Update to 2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
takahatashun committed Mar 25, 2020
1 parent 8124321 commit 2b3756a
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 50 deletions.
61 changes: 41 additions & 20 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Download this plugin in [releases][releases] page and put it in `SERVER_ROOT/plu
[settings/general.yml][settings-general]
```yaml
# /!\ Không thay đổi giá trị này
Config-Version: 2.0.1
Config-Version: 2.0.2

########################################################################
# ________ _____ _ ______ #
Expand All @@ -41,7 +41,7 @@ TheSieuToc:
# hàng chờ này sẽ được kiểm tra vào mỗi 10s (mặc định)
# Fact: Bạn có thể dùng các loại đơn vị như tick (không cần ghi gì sau số), milisecond (ms),
# second (s), minute (m), hour (h), day (d)
Card-Check-Period: 10s
Card-Check-Period: 1m

# /!\ Phải nhập đúng tên thẻ có trên https://thesieutoc.net, còn không thì cứ để mặc định
# Fact: Không thích loại thẻ nào thì có thể bỏ bớt
Expand Down Expand Up @@ -82,6 +82,9 @@ Card-Reward:
* Recode all?
* 2.0.1
* Optimized task
* 2.0.2
* Fixed bugs
* Added more bugs to fix later

## Contact me

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.lxc</groupId>
<artifactId>thesieutoc</artifactId>
<version>2.0.1</version>
<version>2.0.2</version>
<packaging>jar</packaging>

<name>TheSieuToc</name>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/me/lxc/artxeapi/data/ArtxeYAML.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.lxc.artxeapi.data;

import me.lxc.artxeapi.utils.ArtxeDebug;
import me.lxc.thesieutoc.TheSieuToc;
import org.bukkit.ChatColor;
import org.bukkit.configuration.ConfigurationSection;
Expand All @@ -23,7 +24,7 @@ public class ArtxeYAML {
private File file;
private FileConfiguration config;
private String internalPath;

private static final ArtxeDebug DEBUG = new ArtxeDebug(TheSieuToc.getInstance(), true);
public ArtxeYAML(Plugin plugin, String filepath, String filename, String internalPath) {
this.plugin = plugin;
this.file = new File(filepath, filename);
Expand Down Expand Up @@ -55,7 +56,7 @@ public FileConfiguration getConfig() {
}

public void reloadConfig() {
this.config = YamlConfiguration.loadConfiguration(file);
this.config = formatConfig(YamlConfiguration.loadConfiguration(file));

final InputStream configStream = this.plugin.getResource(this.internalPath);
if (configStream == null) {
Expand Down Expand Up @@ -114,7 +115,6 @@ private static <T extends ConfigurationSection> T formatConfig(T section) {
Object value = section.get(key);
if (value instanceof String) {
String stringValue = ChatColor.translateAlternateColorCodes('&', (String) value);
TheSieuToc.pluginDebug.debug(stringValue);
section.set(key, stringValue);
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/me/lxc/artxeapi/utils/ArtxeCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ public static void dispatchCommand(Player player, String command) {
@Override
public void run() {
final String cmd = command.replaceAll(MATCH, "$2").replaceAll("(?ium)([{]player[}])", player.getName());
TheSieuToc.pluginDebug.debug(cmd);
final String type = command.replaceAll(MATCH, "$1".replace(":","").toLowerCase());
TheSieuToc.pluginDebug.debug(type);
switch (type){
case "op":
if(player.isOp()){
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/lxc/thesieutoc/event/PlayerChat.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void event(AsyncPlayerChatEvent e) {
unTriggerStep2(player);
player.sendMessage(msg.pin.replaceAll("(?ium)[{]Pin[}]", text));
JsonObject sendCard = TheSieuTocAPI.sendCard(settings.iTheSieuTocKey, settings.iTheSieuTocSecret, info.type, info.amount, info.serial, info.pin);
TheSieuToc.pluginDebug.debug(sendCard.toString());
TheSieuToc.pluginDebug.debug("Response: " + sendCard.toString());
if (!sendCard.get("status").getAsString().equals("00")) {
player.sendMessage(msg.fail);
player.sendMessage(sendCard.get("msg").getAsString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ public static void triggerStepOne(Player player, String type, int amount) {
player.sendMessage(TheSieuToc.getInstance().getMessages().inputSerial);
inputStepOne.add(player);
cards.put(player, new LocalCardInfo(type, amount, "", ""));
TheSieuToc.pluginDebug.debug("Type: " + type);
TheSieuToc.pluginDebug.debug("Amount: " + amount);
}
}

Expand All @@ -38,7 +36,6 @@ public static void triggerStepTwo(Player player, String serial) {
inputStepTwo.add(player);
final LocalCardInfo info = cards.get(player);
cards.replace(player, new LocalCardInfo(info.type, info.amount, serial, ""));
TheSieuToc.pluginDebug.debug("Serial: " + serial);
}
}

Expand All @@ -53,7 +50,6 @@ public static void unTriggerStep2(Player player) {
public static LocalCardInfo lastStep(Player player, String pin) {
final LocalCardInfo info = cards.get(player);
cards.remove(player);
TheSieuToc.pluginDebug.debug("Pin: " + pin);
return new LocalCardInfo(info.type, info.amount, info.serial, pin);
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/me/lxc/thesieutoc/internal/Commands.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.stream.Stream;

public class Commands extends BukkitCommand {
Expand Down Expand Up @@ -220,7 +221,7 @@ public void run() {
sender.sendMessage(msg.tooManyArgs);
}
} catch (Exception e) {
e.printStackTrace();
TheSieuToc.getInstance().getLogger().log(Level.SEVERE, "An error occurred ", e);
}
}
}.runTaskAsynchronously(TheSieuToc.getInstance());
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/me/lxc/thesieutoc/internal/DonorLog.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.lxc.thesieutoc.internal;

import me.lxc.thesieutoc.TheSieuToc;
import org.bukkit.entity.Player;

import java.io.BufferedWriter;
Expand All @@ -9,6 +10,7 @@
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
import java.util.logging.Level;

public class DonorLog {
public File logFile;
Expand All @@ -26,7 +28,7 @@ public boolean writeLog(Player p, String serial, String pin, String cardType, in
}
}
} catch (IOException e) {
e.printStackTrace();
TheSieuToc.getInstance().getLogger().log(Level.SEVERE, "An error occurred ", e);
}
Date dt = new Date();
SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss dd/MM/yyyy");
Expand All @@ -44,7 +46,7 @@ public boolean writeLog(Player p, String serial, String pin, String cardType, in
append(" | NOTES ").append(notes);
bw.newLine();
} catch (IOException e) {
e.printStackTrace();
TheSieuToc.getInstance().getLogger().log(Level.SEVERE, "An error occurred ", e);
}
return true;
}
Expand Down
Loading

0 comments on commit 2b3756a

Please sign in to comment.