Skip to content

Commit

Permalink
Merge branch 'refs/heads/dev'
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
  • Loading branch information
4379711 committed May 30, 2024
2 parents b2dbbc2 + eef3241 commit c3fb549
Show file tree
Hide file tree
Showing 18 changed files with 98 additions and 173 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@ buildNumber.properties
*.bak
test/
*.txt
lol-game-data
lol-game-data
logs
41 changes: 21 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,41 +27,42 @@
- 战绩查询(即使设置了隐藏生涯,可以查询)

## 软件截图
![安装后的图标](https://github.com/4379711/lol-helper/raw/master/src/main/resources/assets/logo.jpg)
![主界面](https://github.com/4379711/lol-helper/raw/master/src/main/resources/assets/main.png)
![段位和状态](https://github.com/4379711/lol-helper/raw/master/src/main/resources/assets/01.jpg)
![自动接受对局](https://github.com/4379711/lol-helper/raw/master/src/main/resources/assets/02.jpg)
![房间内发送文字](https://github.com/4379711/lol-helper/raw/master/src/main/resources/assets/03.jpg)
![游戏内发送文字](https://github.com/4379711/lol-helper/raw/master/src/main/resources/assets/04.jpg)
![喷人语录](https://github.com/4379711/lol-helper/raw/master/src/main/resources/assets/05.png)
![炫彩皮肤](https://github.com/4379711/lol-helper/raw/master/src/main/resources/assets/6.png)

## 使用说明
##### 项目说明
- 一键喊话功能和快捷键触发盲仔光速摸眼等功能,均使用模拟按键的方式实现
- 喷人喷多了,被举报,会被禁言,这是游戏内设定,和本工具无关
- 软件安装目录下,首次运行后,会产生一个`word.txt`,里面内置了喷人语录,可自行修改
- 发送战绩有时候会失效,大概率是因为玩家名字和数字**被游戏屏蔽**,小概率是因为某些词汇被屏蔽,例如`牛马`现已被屏蔽
- 使用模拟按键的方式实现的几个功能,说不定哪天游戏官方会认为**违规**,目前来看,本人使用两年多无任何负面影响
- 可自行制作windows安装程序,在releases页面下载最新的`lol-helper.jar`,使用jdk17+,命令:
```jpackage -i ./ -n lol-helper --type "msi" --app-version "1.0" --icon icon.ico --vendor "YaLong" --description "lol小助手" --copyright "yalong" --win-per-user-install --win-menu --verbose --win-dir-chooser --win-shortcut --main-jar lol-helper.jar```
- 功能失效可能是**未以管理员身份运行程序**
- 一键喊话功能和快捷键触发盲仔光速摸眼等功能,均使用模拟按键的方式实现
- 喷人喷多了,被举报,会被禁言,这是游戏内设定,和本工具无关
- 软件安装目录下,首次运行后,会产生一个`words.txt`,里面内置了喷人语录,可自行修改,也可在软件内的喷人语录里修改
- 发送战绩有时候会失效,大概率是因为玩家名字和数字**被游戏屏蔽**,小概率是因为某些词汇被屏蔽,例如`牛马`现已被屏蔽
- 使用模拟按键的方式实现的几个功能,说不定哪天游戏官方会认为**违规**,目前来看,本人使用两年多无任何负面影响
- 可自行制作windows安装程序,在releases页面下载最新的`lol-helper.jar`,使用jdk17+,命令:
```jpackage -i ./ -n lol-helper --type "msi" --app-version "1.0" --icon icon.ico --vendor "YaLong" --description "lol小助手" --copyright "yalong" --win-per-user-install --win-menu --verbose --win-dir-chooser --win-shortcut --main-jar lol-helper.jar```
- 功能失效可能是**未以管理员身份运行程序**
- 方式一: 对着图标右键 -> 以管理员身份运行
- 方式二(推荐): 对着图标右键 -> 属性 -> 以管理员身份运行此程序 -> 确定 -> 以后直接双击图标启动程序即可

##### 快捷键说明
- F1:发送队友最近三局战绩和得分到聊天框,可在选择英雄界面使用
- F2:发送对方最近三局战绩和得分到聊天框,只能在游戏内使用,因为选英雄界面看不到对面玩家
- T(或者自定义按键):瞎子光速`眼闪W`(即自动按4DW)
- HOME(问候家人,所以用了home):发送垃圾话(如果修改了垃圾话文件,可以取消勾选,再打开勾选,即可重新加载垃圾话)
- END:发送鼓励的话,自动从网络上获取彩虹屁,并自动发送到聊天框
- DELETE:发送垃圾话时可能会被系统屏蔽,此时标记后会把这个垃圾话打印到结果面板里,方便后续对照修改
- F1:发送队友最近三局战绩和得分到聊天框,可在选择英雄界面使用
- F2:发送对方最近三局战绩和得分到聊天框,只能在游戏内使用,因为选英雄界面看不到对面玩家
- T(或者自定义按键):瞎子光速`眼闪W`(即自动按4DW)
- HOME(问候家人,所以用了home):发送垃圾话(如果修改了垃圾话文件,可以取消勾选,再打开勾选,即可重新加载垃圾话)
- END:发送鼓励的话,自动从网络上获取彩虹屁,并自动发送到聊天框
- DELETE:发送垃圾话时可能会被系统屏蔽,此时标记后会把这个垃圾话打印到结果面板里,方便后续对照修改
- 自定义快捷键

##### 安装步骤
1. 点击[GITHUB](https://github.com/4379711/lol-helper/releases/download/V7.1/lol-helper-7.1.msi)页面或者[GITEE](https://gitee.com/qq4379711/lol-helper/releases/download/V7.1/lol-helper-7.1.msi)下载安装包,下载完成后双击安装
2. 桌面会生成图标,对着图标`右键->属性->兼容性->以管理员身份运行此程序->确定`
3. 点击[GITHUB Releases](https://github.com/4379711/lol-helper/releases)下载最新版本的`lol-helper.jar`
4. 对着桌面图标`右键->打开文件所在位置->进入app文件夹->`,替换最新版的`lol-helper.jar`,以后更新软件版本就这样替换即可
5. 先启动游戏,双击桌面图标启动软件
1. 点击[GITHUB](https://github.com/4379711/lol-helper/releases/download/V7.1/lol-helper-7.1.msi)页面或者[GITEE](https://gitee.com/qq4379711/lol-helper/releases/download/V7.1/lol-helper-7.1.msi)下载安装包,下载完成后双击安装
2. 桌面会生成图标,对着图标`右键->属性->兼容性->以管理员身份运行此程序->确定`
3. 点击[GITHUB Releases](https://github.com/4379711/lol-helper/releases)下载最新版本的`lol-helper.jar`
4. 对着桌面图标`右键->打开文件所在位置->进入app文件夹->`,替换最新版的`lol-helper.jar`,以后更新软件版本就这样替换即可
5. 先启动游戏,双击桌面图标启动软件

## 免责声明
- 本项目仅供学习,未经许可,不得用作商业用途,不得用作违法行为!!!
Expand Down
1 change: 1 addition & 0 deletions src/main/java/yalong/site/ClientStarter.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public void initLcu() throws Exception {
}
RequestLcuUtil requestUtil = new RequestLcuUtil(leagueClientBO);
api = new LinkLeagueClientApi(requestUtil);
GameDataCache.cacheLcuMe();
}

@SuppressWarnings("InfiniteLoopStatement")
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/yalong/site/bo/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ public class Player {
private Long summonerId;
private String summonerName;
private String tagLine;
private String privacy;
private int summonerLevel;
}
17 changes: 0 additions & 17 deletions src/main/java/yalong/site/bo/SummonerInfoBO.java

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/java/yalong/site/bo/SummonerScoreBO.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
@AllArgsConstructor
@Data
public class SummonerScoreBO {
private SummonerInfoBO summonerInfo;
private Player summonerInfo;
private List<ScoreBO> scoreBOList;
}
2 changes: 1 addition & 1 deletion src/main/java/yalong/site/cache/FrameSetting.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author yalong
*/
public class FrameSetting {
public static final int WIDTH = 700;
public static final int WIDTH = 800;
public static final int HEIGHT = 400;
public static final int MATCH_WIDTH = 1000;
public static final int MATCH_HEIGHT = 800;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/yalong/site/cache/GameDataCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@Slf4j
public class GameDataCache {

public static SummonerInfoBO me;
public static Player me;
public static ArrayList<String> otherTeamScore = new ArrayList<>();
public static ArrayList<String> myTeamScore = new ArrayList<>();
public static ArrayList<ChampionBO> allChampion = new ArrayList<>();
Expand Down
1 change: 0 additions & 1 deletion src/main/java/yalong/site/frame/panel/base/BaseButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public BaseButton() {
this.setFocusPainted(false);
Dimension dimension = new Dimension(200, 25);
this.setOpaque(false);
this.setBorder(null);
this.setSize(dimension);
this.setMinimumSize(dimension);
this.setMaximumSize(dimension);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ public CareerBackgroundSkinBox() {
this.addPopupMenuListener(popupMenuListener());
}

private void initItems() {
box.removeAllItems();
box.addItem(new ItemBO(null, "选择生涯背景皮肤"));
private void loadItems(){
try {
if (FrameUserSetting.careerChampionId != null && AppCache.api != null) {
// 根据所选英雄获取皮肤
Expand All @@ -44,7 +42,10 @@ private void initItems() {
} catch (IOException ex) {
log.error("获取生涯背景皮肤接口错误", ex);
}

}
private void initItems() {
box.removeAllItems();
box.addItem(new ItemBO(null, "选择生涯背景皮肤"));
}

/**
Expand Down Expand Up @@ -75,6 +76,7 @@ private PopupMenuListener popupMenuListener() {
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
//重新加载皮肤数据
initItems();
loadItems();
}

@Override
Expand All @@ -84,7 +86,7 @@ public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {

@Override
public void popupMenuCanceled(PopupMenuEvent e) {

initItems();
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public ChampionSelectFrame(String topic, Consumer<String> callBack) {
championPanel.setPreferredSize(new Dimension(FrameSetting.CHAMPION_SELECT_WIDTH, FrameSetting.CHAMPION_SELECT_HEIGHT - 50));
allPanel.add(championPanel);
this.add(allPanel);
championPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 2));
championPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 2, 2));

this.addWindowListener(listener());
}
Expand All @@ -70,7 +70,7 @@ public void createButtons(String filter) {
}
);
}
button.setPreferredSize(new Dimension(150, 30));
button.setPreferredSize(new Dimension(100, 30));
group.add(button);
championPanel.add(button);
}
Expand Down
59 changes: 1 addition & 58 deletions src/main/java/yalong/site/frame/panel/client/HistoryDetail.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@
import yalong.site.cache.FrameSetting;
import yalong.site.frame.bo.ScoreLevelBO;
import yalong.site.frame.constant.GameConstant;
import yalong.site.frame.panel.base.SearchTextField;
import yalong.site.frame.utils.MatchHistoryUtil;

import javax.swing.*;
import java.awt.*;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.IOException;
Expand Down Expand Up @@ -69,23 +66,6 @@ private JPanel buildTeam1Title() {
return jPanel;
}

private JPanel buildTeam2Title() {
JPanel jPanel = new JPanel();
GridBagLayout layout = new GridBagLayout();
jPanel.setLayout(layout);
jPanel.setBorder(BorderFactory.createLineBorder(Color.GRAY, 1, true));
jPanel.setBackground(Color.GRAY);
ArrayList<GridBagConstraints> grid = titleGridList();
jPanel.add(new JLabel("蓝色方"), grid.get(0));
jPanel.add(new JLabel("评分"), grid.get(1));
jPanel.add(new JLabel("KDA"), grid.get(2));
jPanel.add(new JLabel("伤害"), grid.get(3));
jPanel.add(new JLabel("眼"), grid.get(4));
jPanel.add(new JLabel("补兵数"), grid.get(5));
jPanel.add(new JLabel("装备"), grid.get(6));
return jPanel;
}

/**
* 管局玩家数据构建布局
*
Expand Down Expand Up @@ -129,7 +109,6 @@ private JPanel buildTeamData(ParticipantIdentities playInfo, Participants playGa
jPanel.add(name, gridList.get(5));
//段位
jPanel.add(new JLabel(MatchHistoryUtil.getRanked(playInfo.getPlayer().getPuuid())), gridList.get(6));
System.out.println(AppCache.api.getRank(playInfo.getPlayer().getPuuid()));
//评分
DecimalFormat df = new DecimalFormat("#.0");
JLabel score = new JLabel(df.format(scoreLevel.getScore()));
Expand Down Expand Up @@ -603,42 +582,6 @@ private ArrayList<GridBagConstraints> titleGridList() {
0, 0));
return arrayList;
}

private ActionListener actionListener() {
return new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() instanceof SearchTextField search) {
String input = search.getText();
SummonerInfoBO summonerInfo = null;
if (input.isEmpty() && input.isBlank()) {
JOptionPane.showMessageDialog(null, "输入为空", "提示", JOptionPane.INFORMATION_MESSAGE);
} else {
try {
summonerInfo = AppCache.api.getV2InfoByNameList(new ArrayList<>() {{
add(input);
}}).get(0);
} catch (IOException ex) {
JOptionPane.showMessageDialog(null, "未查询到召唤师:" + input, "提示", JOptionPane.INFORMATION_MESSAGE);
log.error("未查询到召唤师");
}
try {
if (summonerInfo != null) {
FrameInnerCache.matchPanel.setData(AppCache.api.getProductsMatchHistoryByPuuid(summonerInfo.getPuuid(), 0, FrameSetting.PAGE_SIZE - 1), summonerInfo.getPuuid());
FrameInnerCache.matchPanel.showAllComponent();
FrameInnerCache.matchPanel.resetIndex();

}
} catch (IOException ex) {
log.error("查询战绩错误");
}
}

}
}
};
}

}

@Slf4j
Expand All @@ -660,7 +603,7 @@ public void mouseClicked(MouseEvent e) {
try {
java.util.List<String> list = new ArrayList<String>();
list.add(jLabel.getText());
List<SummonerInfoBO> summonerInfoBOList = AppCache.api.getV2InfoByNameList(list);
List<Player> summonerInfoBOList = AppCache.api.getV2InfoByNameList(list);
String puuid = summonerInfoBOList.get(0).getPuuid();
ProductsMatchHistoryBO pmh = AppCache.api.getProductsMatchHistoryByPuuid(puuid, 0, FrameSetting.PAGE_SIZE - 1);
FrameInnerCache.matchPanel.resetIndex();
Expand Down
40 changes: 20 additions & 20 deletions src/main/java/yalong/site/frame/panel/client/MatchPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import lombok.extern.slf4j.Slf4j;
import yalong.site.bo.GameData;
import yalong.site.bo.Participants;
import yalong.site.bo.Player;
import yalong.site.bo.ProductsMatchHistoryBO;
import yalong.site.bo.SummonerInfoBO;
import yalong.site.cache.AppCache;
import yalong.site.cache.FrameInnerCache;
import yalong.site.cache.FrameSetting;
import yalong.site.cache.GameDataCache;
import yalong.site.frame.constant.GameConstant;
import yalong.site.frame.panel.base.SearchTextField;
import yalong.site.frame.utils.MatchHistoryUtil;
Expand All @@ -20,6 +21,7 @@
import java.awt.event.MouseEvent;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;

/**
* 战绩查询的容器需要一条一条生成数据
Expand Down Expand Up @@ -191,30 +193,28 @@ private ActionListener actionListener() {
return e -> {
if (e.getSource() instanceof SearchTextField search) {
String input = search.getText();
SummonerInfoBO summonerInfo = null;
Player summonerInfo = null;
if (input.isEmpty() && input.isBlank()) {
JOptionPane.showMessageDialog(null, "输入为空", "提示", JOptionPane.INFORMATION_MESSAGE);
} else {
try {
summonerInfo = AppCache.api.getV2InfoByNameList(new ArrayList<>() {{
add(input);
}}).get(0);
} catch (IOException ex) {
JOptionPane.showMessageDialog(null, "未查询到召唤师:" + input, "提示", JOptionPane.INFORMATION_MESSAGE);
log.error("未查询到召唤师");
}
try {
if (summonerInfo != null) {
FrameInnerCache.matchPanel.setData(AppCache.api.getProductsMatchHistoryByPuuid(summonerInfo.getPuuid(), 0, FrameSetting.PAGE_SIZE - 1), summonerInfo.getPuuid());
FrameInnerCache.matchPanel.showAllComponent();
FrameInnerCache.matchPanel.resetIndex();
input = GameDataCache.me.getGameName()+"#"+GameDataCache.me.getTagLine();
}
try {
summonerInfo = AppCache.api.getV2InfoByNameList(Collections.singletonList(input)).get(0);
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "未查询到召唤师:" + input, "提示", JOptionPane.INFORMATION_MESSAGE);
log.error("未查询到召唤师");
}
try {
if (summonerInfo != null) {
FrameInnerCache.matchPanel.setData(AppCache.api.getProductsMatchHistoryByPuuid(summonerInfo.getPuuid(), 0, FrameSetting.PAGE_SIZE - 1), summonerInfo.getPuuid());
FrameInnerCache.matchPanel.showAllComponent();
FrameInnerCache.matchPanel.resetIndex();

}
} catch (IOException ex) {
log.error("查询战绩错误");
}
} catch (IOException ex) {
log.error("查询战绩错误");
}


}
};
}
Expand Down
Loading

0 comments on commit c3fb549

Please sign in to comment.