-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from Blue-Millennium/25-fix-bugs-in-data-query
25 fix bugs in data query
- Loading branch information
Showing
21 changed files
with
90 additions
and
189 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
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
14 changes: 4 additions & 10 deletions
14
...un/suya/suisuroru/commands/execute/othercommands/data/QueryFunctions/DataQueryByName.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 |
---|---|---|
@@ -1,36 +1,30 @@ | ||
package fun.suya.suisuroru.commands.execute.othercommands.data.QueryFunctions; | ||
|
||
import fun.suya.suisuroru.data.AuthData.DataGet; | ||
import fun.suya.suisuroru.data.AuthData.DataProcess; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import static fun.suya.suisuroru.commands.execute.othercommands.data.QueryFunctions.DataQueryByUUID.ProcessFinalData; | ||
import static fun.xd.suka.Main.LOGGER; | ||
|
||
public class DataQueryByName implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) { | ||
if (!sender.isOp()) { | ||
sender.sendMessage("您没有权限这么做"); | ||
return false; | ||
return true; | ||
} | ||
DataGet dataGet = new DataGet(); | ||
String Name; | ||
try { | ||
Name = args[0]; | ||
} catch (Exception e) { | ||
LOGGER.info(String.valueOf(e)); | ||
return false; | ||
} | ||
String playerJson = dataGet.getPlayersByNameAsJson(Name); | ||
if (!playerJson.isEmpty() && !playerJson.equals("[]")) { | ||
sender.sendMessage(DataProcess.processData(playerJson)); | ||
return true; | ||
} else { | ||
sender.sendMessage("查询的数据不存在"); | ||
return false; | ||
} | ||
String playerJson = dataGet.getPlayersByNameAsJson(Name); | ||
return ProcessFinalData(sender, playerJson); | ||
} | ||
} |
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
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
50 changes: 2 additions & 48 deletions
50
src/main/java/fun/suya/suisuroru/data/AuthData/AuthData.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 |
---|---|---|
@@ -1,51 +1,5 @@ | ||
package fun.suya.suisuroru.data.AuthData; | ||
|
||
public class AuthData { | ||
private final PlayerData playerData; | ||
private final long firstJoin; | ||
private final long lastJoin; | ||
private final long qqNumber; | ||
private final long linkedTime; | ||
private final String firstJoinIp; | ||
private final String lastJoinIp; | ||
|
||
// 构造函数 | ||
public AuthData(PlayerData playerData, long firstJoin, long lastJoin, long qqNumber, long linkedTime, String firstJoinIp, String lastJoinIp) { | ||
this.playerData = playerData; | ||
this.firstJoin = firstJoin; | ||
this.lastJoin = lastJoin; | ||
this.qqNumber = qqNumber; | ||
this.linkedTime = linkedTime; | ||
this.firstJoinIp = firstJoinIp; | ||
this.lastJoinIp = lastJoinIp; | ||
} | ||
|
||
// Getters | ||
public PlayerData getPlayerData() { | ||
return playerData; | ||
} | ||
|
||
public long getFirstJoin() { | ||
return firstJoin; | ||
} | ||
|
||
public long getLastJoin() { | ||
return lastJoin; | ||
} | ||
|
||
public long getQqNumber() { | ||
return qqNumber; | ||
} | ||
|
||
public long getLinkedTime() { | ||
return linkedTime; | ||
} | ||
|
||
public String getFirstJoinIp() { | ||
return firstJoinIp; | ||
} | ||
|
||
public String getLastJoinIp() { | ||
return lastJoinIp; | ||
} | ||
public record AuthData(PlayerData playerData, long firstJoin, long lastJoin, long qqNumber, long linkedTime, | ||
String firstJoinIp, String lastJoinIp) { | ||
} |
Oops, something went wrong.