Skip to content

Commit

Permalink
Merge branch 'refs/heads/dev'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/yalong/site/frame/panel/about/AboutPanel.java
  • Loading branch information
4379711 committed Sep 4, 2024
2 parents 1552630 + 676dd3c commit 5ea8a3d
Show file tree
Hide file tree
Showing 44 changed files with 2,191 additions and 27 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# lol-helper
- 英雄联盟助手,主要使用LCU API,**未修改**客户端内容,**理论上不会封号!**,另外附上官方文档
- 英雄联盟助手,主要使用LCU API和SGP API,**未修改**客户端内容,**理论上不会封号!**,另外附上官方文档
- [拳头文档](https://developer.riotgames.com/docs/lol/)
- [lcu](https://hextechdocs.dev/tag/lcu/)
- [版本英雄游戏数据](https://developer.riotgames.com/docs/lol#data-dragon_champions)
Expand All @@ -24,8 +24,9 @@
- 查看双方所有人的近期战绩,并计算得分,添加大神和牛马称谓,一键发送到聊天框
- **游戏内一键喊话,对喷**
- **游戏内一键鼓励队友,彩虹屁**
- **设置炫彩皮肤(没有原皮肤但有炫彩皮肤的情况下,此功能可以突破游戏限制)**
- ~~**设置炫彩皮肤(没有原皮肤但有炫彩皮肤的情况下,此功能可以突破游戏限制)(由于xx大厂已修复)**~~
- 战绩查询(即使设置了隐藏生涯,可以查询)
- 选择英雄时 队友战绩查看 左侧显示最近改20把胜率 点击队友头像查看详情数据

## 软件截图
![主界面](https://github.com/4379711/lol-helper/raw/master/src/main/resources/assets/main.png)
Expand All @@ -35,6 +36,7 @@
![游戏内发送文字](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)
![队友战绩查看](https://github.com/4379711/lol-helper/raw/master/src/main/resources/assets/07.png)

## 使用说明
##### 项目说明
Expand Down Expand Up @@ -70,5 +72,5 @@
- 本项目仅供学习,未经许可,不得用作商业用途,不得用作违法行为!!!

## 联系
> 加QQ群,群号882050965,或者用qq扫描下方二维码
> 加QQ群,~~群号882050965~~已满 二群1001245686,或者用qq扫描下方二维码
![QQ群](https://github.com/4379711/lol-helper/raw/master/src/main/resources/assets/QR-Code.jpg)
25 changes: 24 additions & 1 deletion src/main/java/yalong/site/ClientStarter.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
import lombok.extern.slf4j.Slf4j;
import yalong.site.bo.LeagueClientBO;
import yalong.site.cache.AppCache;
import yalong.site.cache.FrameInnerCache;
import yalong.site.cache.GameDataCache;
import yalong.site.enums.GameStatusEnum;
import yalong.site.exception.NoLcuApiException;
import yalong.site.exception.NoProcessException;
import yalong.site.http.RequestLcuUtil;
import yalong.site.http.RequestSgpUtil;
import yalong.site.services.lcu.*;
import yalong.site.services.sgp.RegionSgpApi;
import yalong.site.utils.ProcessUtil;

import java.io.IOException;
Expand All @@ -19,6 +23,7 @@
@Slf4j
public class ClientStarter {
private LinkLeagueClientApi api;
private RegionSgpApi localSgpApi;

public void initLcu() throws Exception {
LeagueClientBO leagueClientBO = ProcessUtil.getClientProcess();
Expand All @@ -30,6 +35,18 @@ public void initLcu() throws Exception {
GameDataCache.cacheLcuMe();
}

public void initSgp() throws Exception {
LeagueClientBO leagueClientBO = ProcessUtil.getClientProcess();
if (leagueClientBO.equals(new LeagueClientBO())) {
throw new NoProcessException();
}
if (AppCache.api == null) {
throw new NoLcuApiException();
}
RequestSgpUtil requestUtil = new RequestSgpUtil(AppCache.api.getSgpAccessToken(), leagueClientBO.getRegion().toLowerCase());
localSgpApi = new RegionSgpApi(requestUtil);
}

@SuppressWarnings("InfiniteLoopStatement")
public void listenGameStatus() throws InterruptedException, IOException {
while (true) {
Expand All @@ -41,6 +58,12 @@ public void listenGameStatus() throws InterruptedException, IOException {
CalculateScore calculateScore = new CalculateScore(api);
//监听游戏状态
GameStatusEnum gameStatus = api.getGameStatus();
if (!gameStatus.equals(GameStatusEnum.ChampSelect)) {
if (FrameInnerCache.myTeamMatchHistoryPanel != null) {
FrameInnerCache.myTeamMatchHistoryPanel.dispose();
FrameInnerCache.myTeamMatchHistoryPanel = null;
}
}
switch (gameStatus) {
case None:
case Matchmaking:
Expand All @@ -58,7 +81,7 @@ public void listenGameStatus() throws InterruptedException, IOException {
break;
}
case ChampSelect: {
gameStatusContext.setStrategy(new ChampSelectStrategy(api, calculateScore));
gameStatusContext.setStrategy(new ChampSelectStrategy(api, localSgpApi, calculateScore));
break;
}
case InProgress: {
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/yalong/site/LeagueClientHelper.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package yalong.site;

import lombok.extern.slf4j.Slf4j;
import yalong.site.cache.GameDataCache;
import yalong.site.exception.NoProcessException;
import yalong.site.frame.MainFrame;
import yalong.site.services.hotkey.HotKeyService;
Expand All @@ -20,6 +21,8 @@ public static void main(String[] args) {
try {
ClientStarter clientStarter = new ClientStarter();
clientStarter.initLcu();
clientStarter.initSgp();
GameDataCache.cacheLcuAll();
MainFrame.showFrame();
HotKeyService.start();
clientStarter.listenGameStatus();
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/yalong/site/bo/GameMatchHistoryBO.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package yalong.site.bo;

import lombok.Data;
import yalong.site.frame.constant.GameConstant;

import java.util.Date;
import java.util.List;
Expand All @@ -25,7 +26,7 @@ public class GameMatchHistoryBO {
private List<Participants> participants;
/**
* 游戏类型ID 使用该类型区分游戏类型
* 在{@link yalong.site.frame.constant.GameConstant#GAME_TYPE}和{@link yalong.site.enums.GameTypeEnum}
* 在{@link GameConstant#GAME_TYPE}和{@link yalong.site.enums.GameTypeEnum}
* 进行映射和判断是否能进行对局详情展示
*/
private Integer queueId;
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/yalong/site/bo/GameQueue.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package yalong.site.bo;

import lombok.Data;

/**
* 游戏地图模式
*
* @author WuYi
*/
@Data
public class GameQueue {
private Integer id;
private String name;
private String gameMode;
private Integer mapId;
}
5 changes: 5 additions & 0 deletions src/main/java/yalong/site/bo/LeagueClientBO.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@ public class LeagueClientBO {
* 密钥
*/
private String token;

/**
* 区域
*/
private String region;
}
24 changes: 24 additions & 0 deletions src/main/java/yalong/site/bo/SGPRank.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package yalong.site.bo;

import lombok.Data;

/**
* 段位
*
* @author WuYi
*/
@Data
public class SGPRank {
/**
* 游戏模式
*/
private String queueType;
/**
* 段位
*/
private String tier;
/**
* 段位等级
*/
private String rank;
}
26 changes: 26 additions & 0 deletions src/main/java/yalong/site/bo/SgpSummonerInfoBo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package yalong.site.bo;

import lombok.Data;

/**
* sgp的召唤术数据姓名为老数据尽量
* @author WuYi
*/
@Data
public class SgpSummonerInfoBo {
public Long id;
private String puuid;
private Long accountId;
/**
* 头像id
*/
private int profileIconId;
private int level;
private int expPoints;
private int levelAndXpVersion;
private String revisionId;
private Long revisionDate;
private Long lastGameDate;
private String privacy;
private int expToNextLevel;
}
28 changes: 28 additions & 0 deletions src/main/java/yalong/site/bo/SpgGames.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package yalong.site.bo;

import lombok.Data;

import java.util.List;

/**
* @author WuYi
*/
@Data
public class SpgGames {
private String endOfGameResult;
private Long gameCreation;
private Integer gameDuration;
private Long gameId;
private Long gameStartTimestamp;
private Long gameEndTimestamp;
private String gameMode;
private String gameType;
private String gameVersion;
private Integer mapId;
private List<SpgParticipants> participants;
private String platformId;
private Integer queueId;
private Integer seasonId;
private List<Teams> teams;

}
Loading

0 comments on commit 5ea8a3d

Please sign in to comment.