From c513f8ad4e3a52ce46f69e99fdc36b3cfa00f168 Mon Sep 17 00:00:00 2001 From: Orisland <756176532@qq.com> Date: Wed, 8 Mar 2023 01:13:42 +0800 Subject: [PATCH] change RU to EU. --- src/main/java/org/orisland/Handler.java | 108 +----------------- .../java/org/orisland/wows/ApiConfig.java | 3 +- .../wows/dataPack/StringToMeaningful.java | 3 +- 3 files changed, 6 insertions(+), 108 deletions(-) diff --git a/src/main/java/org/orisland/Handler.java b/src/main/java/org/orisland/Handler.java index e856b1b..d4cff6f 100644 --- a/src/main/java/org/orisland/Handler.java +++ b/src/main/java/org/orisland/Handler.java @@ -43,112 +43,8 @@ public ListeningStatus friendListener(FriendMessageEvent event) throws IOExcepti @EventHandler public ListeningStatus groupListener(GroupMessageEvent event) throws IOException { - if (event.getMessage().contentToString().equals("1")){ - NickNameToAccountInfo("Orisland_Ex", ApiConfig.Server.EU); - }else if (event.getMessage().contentToString().equals("2")){ - searchNickNameToAccountId("Orisland_Ex", ApiConfig.Server.EU); - }else if (event.getMessage().contentToString().equals("3")){ -// ShipData.SearchShipIdToShipInfo("4277090288"); - SearchAccountIdToShipInfo("566316444", "4277090288", ApiConfig.Server.EU); - }else if (event.getMessage().contentToString().equals("4")){ - SearchAccountIdToShipInfo("567073590", ApiConfig.Server.EU); - }else if (event.getMessage().contentToString().equals("5")){ - List singleShipDataSimples = SearchAccountIdToAccountInfoByDate("566316444", ApiConfig.Server.EU, "20220518,20220517"); - for (SingleShipDataSimple singleShipDataSimple : singleShipDataSimples) { - System.out.println(singleShipDataSimple); - } - }else if (event.getMessage().contentToString().equals("6")){ - ObjectNode ship = JsonTool.mapper.createObjectNode(); - ship.put("Dmg", "47281979"); - ship.put("Wins", "276"); - ship.put("Frags", "484"); - ship.put("battle", "552"); - ship.put("shipId", "4277090288"); - ShipPr(ship); - }else if (event.getMessage().contentToString().equals("7")){ - NickNameToPr("Orisland_Ex", ApiConfig.Server.EU); -// System.out.println(orisland_ex); - }else if (event.getMessage().contentToString().equals("8")){ - readAccountToday("566316444", ApiConfig.Server.EU); - }else if (event.getMessage().contentToString().equals("9")){ - saveAccountShipInfo("566316445", ApiConfig.Server.EU, false); - }else if (event.getMessage().contentToString().equals("10")){ - List shipDataObjs = diffShip("566316444", ApiConfig.Server.EU); - for (ShipDataObj shipDataObj : shipDataObjs) { - System.out.println(shipDataObj.getShip().getName()); - System.out.println(shipDataObj.getBattle()); - System.out.println(shipDataObj.getAveDmg()); - System.out.println(shipDataObj.getPR().getPR()); - } - }else if (event.getMessage().contentToString().equals("11")){ - originPlayerData("566316444", ApiConfig.Server.EU); - }else if (event.getMessage().contentToString().equals("12")){ - selectData("566316444", ApiConfig.Server.EU, true); - }else if (event.getMessage().contentToString().equals("13")){ - updateAccountLocalData("566316444", ApiConfig.Server.EU); - }else if (event.getMessage().contentToString().equals("14")){ - initDataRefresh(); - }else if (event.getMessage().contentToString().equals("15")){ - updateAccountLocalDataAuto(false); - }else if (event.getMessage().contentToString().equals("16")){ - accountRecordAt("566316444", ApiConfig.Server.EU, 5); - }else if (event.getMessage().contentToString().equals("17")){ - System.out.println(searchAccountIdToAccountInfo("566316444", ApiConfig.Server.EU)); - }else if (event.getMessage().contentToString().equals("18")){ - Bot bot = event.getBot(); - ForwardMessageBuilder iNodes = new ForwardMessageBuilder(event.getSender()); - iNodes.add(bot, new PlainText("123")); - iNodes.add(bot, new PlainText("test")); - event.getSender().getGroup().sendMessage(iNodes.build()); - }else if (event.getMessage().contentToString().equals("19")){ - JsonNode jsonNode = AllShipInfo(); - System.out.println(jsonNode.size()); - System.out.println(jsonNode); - }else if (event.getMessage().contentToString().equals("20")){ - saveShipLanguageInfo(); - }else if (event.getMessage().contentToString().equals("21")){ - MessageChainBuilder builder = new MessageChainBuilder(); - builder.append("信息\r信息"); - event.getSender().getGroup().sendMessage(builder.build()); - MessageChainBuilder builder1 = new MessageChainBuilder(); - builder1.append("信息\n信息"); - event.getSender().getGroup().sendMessage(builder1.build()); - MessageChainBuilder builder2 = new MessageChainBuilder(); - builder2.append("信息\t信息"); - event.getSender().getGroup().sendMessage(builder2.build()); - }else if (event.getMessage().contentToString().equals("22")){ - ForwardMessage.Node node1 = new ForwardMessage.Node(event.getBot().getId(), 1653807529, "bot", new MessageChainBuilder().append("test1").build()); - ForwardMessage.Node node2 = new ForwardMessage.Node(event.getBot().getId(), 1653807530, "bot", new MessageChainBuilder().append("test2").build()); - ForwardMessage.Node node3 = new ForwardMessage.Node(event.getBot().getId(), 1653807531, "bot", new MessageChainBuilder().append("test3").build()); - - Bot bot = event.getBot(); - ForwardMessageBuilder iNodes = new ForwardMessageBuilder(event.getSender()); - - }else if (event.getMessage().contentToString().equals("23")){ -// InputStream resourceAsStream = WowsPlugin.class.getClassLoader().getResourceAsStream("图片1.png"); -// Image image1 = net.mamoe.mirai.contact.Contact.uploadImage(event.getSender(), resourceAsStream); -// InputStream resourceAsStream1 = WowsPlugin.class.getClassLoader().getResourceAsStream("图片2.png"); -// Image image2 = net.mamoe.mirai.contact.Contact.uploadImage(event.getSender(), resourceAsStream1); -// InputStream resourceAsStream2 = WowsPlugin.class.getClassLoader().getResourceAsStream("图片3.png"); -// Image image3 = net.mamoe.mirai.contact.Contact.uploadImage(event.getSender(), resourceAsStream2); -// InputStream resourceAsStream3 = WowsPlugin.class.getClassLoader().getResourceAsStream("1.png"); -// Image image4 = net.mamoe.mirai.contact.Contact.uploadImage(event.getSender(), resourceAsStream3); - - Image image = StringToMeaningful.getImage((CommandSenderOnMessage) event.getSender().getGroup(), "1.png"); - - MessageChainBuilder append = new MessageChainBuilder() - .append("这是一条测试") - .append("\n") - .append(image); - - event.getGroup().sendMessage(append.build()); - }else if (event.getMessage().contentToString().equals("24")){ - System.out.println("org.orisland.plugin\\\\prImg\\\\"); - }else if (event.getMessage().contentToString().equals("25")){ - initPrImg(); - }else if (event.getMessage().contentToString().equals("26")){ - }else { - } + + return ListeningStatus.LISTENING; } diff --git a/src/main/java/org/orisland/wows/ApiConfig.java b/src/main/java/org/orisland/wows/ApiConfig.java index 27fda4f..1ace415 100644 --- a/src/main/java/org/orisland/wows/ApiConfig.java +++ b/src/main/java/org/orisland/wows/ApiConfig.java @@ -92,7 +92,8 @@ public class ApiConfig { public static final String dataDirEu = dataDir + "playerData" + File.separator + "eu" + File.separator; public static final String dataDirAsia = dataDir + "playerData" + File.separator + "asia" + File.separator; public static final String dataDirNa = dataDir + "playerData" + File.separator + "na" + File.separator; - public static final String dataDirRu = dataDir + "playerData" + File.separator + "ru" + File.separator; +// 注意俄服没了,难绷,找半天问题原来是俄服没了,直接改成eu。 + public static final String dataDirRu = dataDir + "playerData" + File.separator + "eu" + File.separator; /** * 配置文件地址 diff --git a/src/main/java/org/orisland/wows/dataPack/StringToMeaningful.java b/src/main/java/org/orisland/wows/dataPack/StringToMeaningful.java index a901f3e..0d4948b 100644 --- a/src/main/java/org/orisland/wows/dataPack/StringToMeaningful.java +++ b/src/main/java/org/orisland/wows/dataPack/StringToMeaningful.java @@ -189,10 +189,11 @@ public static Server StringToServer(String str){ case "美服": case "美": return Server.com; +// 将俄服暂时全部合并入欧服 case "俄服": case "俄": case "RU": - return Server.RU; + return Server.EU; default: log.error("出现了预料之外的问题!"); return null;