Skip to content

Commit

Permalink
v1.3.0: 修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RegadPoleCN committed Feb 9, 2024
1 parent 08ac838 commit 92c9029
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 103 deletions.
2 changes: 1 addition & 1 deletion plumbot-bukkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>me.regadpole</groupId>
<artifactId>plumbot</artifactId>
<version>1.3.1-pre1</version>
<version>1.3.0</version>
</parent>

<artifactId>plumbot-bukkit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ public void onFriendMessageReceive(PrivateMessage e){
if(!Config.Online()){
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(e.getMessage());
if (matcher.find()){
return;
}
bot.sendMsg(false, "当前在线:" + "("+Bukkit.getServer().getOnlinePlayers().size()+"人)"+ServerManager.listOnlinePlayer(), e.getUserId());
return;
}
Expand All @@ -49,11 +44,6 @@ public void onFriendMessageReceive(PrivateMessage e){
if(!Config.TPS()){
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(e.getMessage());
if (matcher.find()){
return;
}
ServerTps st = new ServerTps();
bot.sendMsg(false, "当前tps:" + st.getTps() + "\n" + "当前MSPT:" + st.getMSPT(),e.getUserId());
return;
Expand All @@ -66,11 +56,6 @@ public void onFriendMessageReceive(PrivateMessage e){
if(!Config.CMD()){
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(matcher.group());
if (matcher.find()){
return;
}
String cmd = matcher.group().replace(Prefix+"cmd ", "");
bot.sendMsg(false, "已发送指令至服务器",e.getUserId());
PlumBot.getScheduler().runTaskAsynchronously(()->{
Expand Down Expand Up @@ -124,11 +109,6 @@ public void onGroupMessageReceive(GroupMessage e){
if(!Config.CMD()){
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(msg);
if (matcher.find()){
return;
}
String cmd = matcher.group().replace(Prefix+"cmd ", "");
bot.sendMsg(true, "已发送指令至服务器",groupID);
PlumBot.getScheduler().runTaskAsynchronously(()->{
Expand All @@ -144,11 +124,6 @@ public void onGroupMessageReceive(GroupMessage e){
if (!Config.WhiteList()) {
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(msg);
if (matcher.find()){
return;
}
String name = matcher.group().replace(Prefix + "删除白名单 ", "");
if (name.isEmpty()) {
bot.sendMsg(true, "id不能为空", groupID);
Expand All @@ -172,11 +147,6 @@ public void onGroupMessageReceive(GroupMessage e){
if (!Config.WhiteList()) {
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(msg);
if (matcher.find()){
return;
}
String qq = matcher.group().replace(Prefix + "删除User白名单 ", "");
if (qq.isEmpty()) {
bot.sendMsg(true, "QQ不能为空", groupID);
Expand All @@ -200,11 +170,6 @@ public void onGroupMessageReceive(GroupMessage e){
if (!Config.SDC()){
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(msg);
if (matcher.find()){
return;
}
String scmd = matcher.group().replace(Prefix+"", "");
String gcmd = Config.getCommandsYaml().getString("Admin."+scmd);
if(gcmd!=null) {
Expand Down Expand Up @@ -245,11 +210,6 @@ public void onGroupMessageReceive(GroupMessage e){
if(!Config.Online()){
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(msg);
if (matcher.find()){
return;
}
bot.sendMsg(true, "当前在线:" + "("+Bukkit.getServer().getOnlinePlayers().size()+"人)"+ServerManager.listOnlinePlayer(),groupID);
return;
}
Expand All @@ -258,11 +218,6 @@ public void onGroupMessageReceive(GroupMessage e){
if(!Config.TPS()){
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(msg);
if (matcher.find()){
return;
}
ServerTps st = new ServerTps();
bot.sendMsg(true, "当前tps:" + st.getTps() + "\n" + "当前MSPT:" + st.getMSPT(),groupID);
return;
Expand All @@ -274,11 +229,6 @@ public void onGroupMessageReceive(GroupMessage e){
if (!Config.WhiteList()) {
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(msg);
if (matcher.find()){
return;
}
String PlayerName = matcher.group().replace(Prefix + "申请白名单 ", "");
if (PlayerName.isEmpty()) {
bot.sendMsg(true, "id不能为空", groupID);
Expand All @@ -301,11 +251,6 @@ public void onGroupMessageReceive(GroupMessage e){
if (!Config.WhiteList()) {
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(msg);
if (matcher.find()){
return;
}
PlumBot.getScheduler().runTaskAsynchronously(() -> {
String idForName = DatabaseManager.getBind(String.valueOf(senderID), DataBase.type().toLowerCase(), PlumBot.getDatabase());
if (idForName == null || idForName.isEmpty()) {
Expand All @@ -325,11 +270,6 @@ public void onGroupMessageReceive(GroupMessage e){
if (!Config.SDC()){
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(msg);
if (matcher.find()){
return;
}
String scmd = matcher.group().replace(Prefix+"", "");
String gcmd = Config.getCommandsYaml().getString("User."+scmd);
if(gcmd!=null) {
Expand All @@ -344,11 +284,6 @@ public void onGroupMessageReceive(GroupMessage e){
if (Config.SDR()){
String back = Config.getReturnsYaml().getString(msg);
if(back!=null){
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(msg);
if (matcher.find()){
return;
}
bot.sendMsg(true, back,groupID);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion plumbot-velocity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>me.regadpole</groupId>
<artifactId>plumbot</artifactId>
<version>1.3.1-pre1</version>
<version>1.3.0</version>
</parent>

<artifactId>plumbot-velocity</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ public void onFriendMessageReceive(PrivateMessage e){
if(!Config.config.Online){
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(e.getMessage());
if (matcher.find()){
return;
}
List<String> pname = new ArrayList<>();
for (Player player : plugin.getServer().getAllPlayers()) {
pname.add(player.getUsername());
Expand Down Expand Up @@ -92,11 +87,6 @@ public void onGroupMessageReceive(GroupMessage e){
if (!Config.config.WhiteList.enable) {
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(msg);
if (matcher.find()){
return;
}
String name = matcher.group().replace("/删除白名单 ", "");
if (name.isEmpty()) {
PlumBot.getBot().sendMsg(true, "id不能为空", groupID);
Expand All @@ -120,11 +110,6 @@ public void onGroupMessageReceive(GroupMessage e){
if (!Config.config.WhiteList.enable) {
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(msg);
if (matcher.find()){
return;
}
String qq = matcher.group().replace(Prefix + "删除User白名单 ", "");
if (qq.isEmpty()) {
bot.sendMsg(true, "QQ不能为空", groupID);
Expand Down Expand Up @@ -168,11 +153,6 @@ public void onGroupMessageReceive(GroupMessage e){
if(!Config.config.Online){
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(msg);
if (matcher.find()){
return;
}
List<String> pname = new ArrayList<>();
for (Player player : plugin.getServer().getAllPlayers()) {
pname.add(player.getUsername());
Expand All @@ -187,11 +167,6 @@ public void onGroupMessageReceive(GroupMessage e){
if (!Config.config.WhiteList.enable) {
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(msg);
if (matcher.find()){
return;
}
String PlayerName = matcher.group().replace("/申请白名单 ", "");
if (PlayerName.isEmpty()) {
PlumBot.getBot().sendMsg(true, "id不能为空", groupID);
Expand All @@ -214,11 +189,6 @@ public void onGroupMessageReceive(GroupMessage e){
if (!Config.config.WhiteList.enable) {
return;
}
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(msg);
if (matcher.find()){
return;
}
PlumBot.INSTANCE.getServer().getScheduler().buildTask(PlumBot.INSTANCE, () -> {
String idForName = DatabaseManager.getBind(String.valueOf(senderID), DbConfig.type.toLowerCase(), PlumBot.getDatabase());
if (idForName == null || idForName.isEmpty()) {
Expand All @@ -235,11 +205,6 @@ public void onGroupMessageReceive(GroupMessage e){
if (plugin.vconf.getReturnsObj().get(msg) == null) return;
String back = String.valueOf(plugin.vconf.getReturnsObj().get(msg));
if(back!=null){
pattern = Pattern.compile("\\[CQ:.*].*");
matcher = pattern.matcher(msg);
if (matcher.find()){
return;
}
PlumBot.getBot().sendMsg(true, back,groupID);
return;
}
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.regadpole</groupId>
<artifactId>plumbot</artifactId>
<version>1.3.1-pre1</version>
<version>1.3.0</version>
<packaging>pom</packaging>

<name>PlumBot</name>
Expand Down

0 comments on commit 92c9029

Please sign in to comment.