From d0c43d887bbe86eeedd43a6fb27c2ca0e0d8c132 Mon Sep 17 00:00:00 2001 From: gsd Date: Thu, 16 Feb 2023 16:07:48 +0300 Subject: [PATCH] =?UTF-8?q?=D1=8F=20=D0=B2=20=D0=B0=D1=85=D1=83=D0=B5=20?= =?UTF-8?q?=D0=B1=D0=BB=D1=8F=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/app/entities/other/SteamID.java | 7 +++---- src/main/java/app/services/ReportService.java | 2 +- src/main/java/app/services/steam/SteamWebApi.java | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/app/entities/other/SteamID.java b/src/main/java/app/entities/other/SteamID.java index a23400c..f64edf8 100644 --- a/src/main/java/app/entities/other/SteamID.java +++ b/src/main/java/app/entities/other/SteamID.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; public class SteamID { public String steam3; public String steam2; - public String steam64; + public long steam64; public String community_url; public long account_id; @@ -18,7 +18,7 @@ public class SteamID { public SteamID(String steam3, String steam2, String steam64, long account_id) { this.steam3 = steam3; this.steam2 = steam2; - this.steam64 = steam64; + this.steam64 = Long.valueOf(steam64); this.community_url = String.format("https://steamcommunity.com/profiles/%s", steam64); this.account_id = account_id; } @@ -30,8 +30,7 @@ public class SteamID { public boolean is(SteamID steamID){ try { - if (steam64.equals(steamID.steam64)) return true; - else return false; + return steam64 == steamID.steam64; } catch (NullPointerException err) { System.out.printf("%s != %s", steam64, steamID.steam64); throw new InvalidSteamID(); diff --git a/src/main/java/app/services/ReportService.java b/src/main/java/app/services/ReportService.java index de03bbc..8874e04 100644 --- a/src/main/java/app/services/ReportService.java +++ b/src/main/java/app/services/ReportService.java @@ -23,7 +23,7 @@ public class ReportService { String webhook_url; @Value("${backend.report.kd}") long kd; - HashMap userKD; + HashMap userKD; Stats stats; StatsService statsService; String tf2_icon = "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/440/e3f595a92552da3d664ad00277fad2107345f743.jpg"; diff --git a/src/main/java/app/services/steam/SteamWebApi.java b/src/main/java/app/services/steam/SteamWebApi.java index 9b6f6d9..1f64bbb 100644 --- a/src/main/java/app/services/steam/SteamWebApi.java +++ b/src/main/java/app/services/steam/SteamWebApi.java @@ -22,7 +22,7 @@ public class SteamWebApi { restTemplate = new RestTemplate(); } - public SteamData getSteamData(String steam64){ + public SteamData getSteamData(long steam64){ String url = String.format("https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=%s&steamids=%s", webapi_key, steam64); try { ResponseEntity response = restTemplate.getForEntity(url, String.class);