loldevs / riotapi

A general purpose api for all things riot
loldevs.github.io
Apache License 2.0
48 stars 14 forks source link

Summoners with unicode symbols in their names #33

Closed ghost closed 9 years ago

ghost commented 9 years ago

When I try to query a live game info for a summoner with unicode symbol in its name (e.g., Noctµrnal) , I get something like this:

Exception in thread "Thread-2" net.boreeas.riotapi.rtmp.messages.InvokeException: Client.Packet.Encoding: Unknown AMF type '108'.
    at net.boreeas.riotapi.rtmp.RtmpClient.sendRpcAndWait(RtmpClient.java:554)

Am I doing something wrong or what?

strangeglyph commented 9 years ago

That's... interesting. Are you invoking sendRpcAndWait directly, or calling it via some service? What shard are you connecting to? Also, a full stacktrace would be awesome

ghost commented 9 years ago

Via GameService, here's the stacktrace (will this do?):

Exception in thread "Thread-1" net.boreeas.riotapi.rtmp.messages.InvokeException: Server.Processing: null
Root cause: AmfObject(type=java.io.UTFDataFormatException, fields={localizedMessage=null, cause=null, suppressed={}, message=null})
    at net.boreeas.riotapi.rtmp.RtmpClient.sendRpcAndWait(RtmpClient.java:554)
    at net.boreeas.riotapi.rtmp.services.GameService.retrieveInProgressSpectatorGameInfo(GameService.java:104)

I got this exception when querying user "Teemò". I am using "na" server.

strangeglyph commented 9 years ago

Yeah, thanks, I'll take a look

IcEBnd commented 9 years ago

I'm getting a very similar error.. please let me know if I can help in anyway. Running net.boreeas.riotapi.rtmp.RtmpClientTest INFO [ main] Connecting to prod.eun1.lol.riotgames.com:2099 INFO [ main] Client Id: D6587DB7-781A-2C14-C0A1-DDC0FC1E1497 INFO [ main] Login service call: xxx/***/sBLoGBOctyWJaXdubOygfAdj4j7cEtP-ErfX-EDZxnb2hznRVoIQt1JKdRXaCprEskPfHm9MYgeAg16s0dmZUg== on client version 4.20.14_11_14_10_18 (locale en_US) INFO [ main] Rtmp login: xxx/46a7385f-0f05-4c4e-8865-5eb1b4541394 INFO [ main] Retrieving data packet WARN [ RtmpClient reader thread] No match for field .DSMessagingVersion in class net.boreeas.riotapi.rtmp.serialization.AnonymousAmfObject WARN [ RtmpClient reader thread] No match for field .DSId in class net.boreeas.riotapi.rtmp.serialization.AnonymousAmfObject WARN [ RtmpClient reader thread] No match for field .DSSubtopic in class net.boreeas.riotapi.rtmp.serialization.AnonymousAmfObject WARN [ RtmpClient reader thread] No match for field .TUTORIAL in class net.boreeas.riotapi.rtmp.serialization.AnonymousAmfObject WARN [ RtmpClient reader thread] No match for field com.riotgames.platform.summoner.Summoner.previousSeasonHighestTeamReward in class net.boreeas.riotapi.com.riotgames.platform.summoner.Summoner WARN [ RtmpClient reader thread] Skipping field with no match: previousSeasonHighestTeamReward = 0 INFO [ main] Login complete - account state: ENABLED INFO [ RtmpClient reader thread] Unknown command: _error/[ErrorMessage(faultCode=Client.Packet.Encoding, faultString=Unknown AMF type '121'., faultDetail=null, rootCause=null, extendedData=null)]/REQUEST/Success=false Params = class net.boreeas.riotapi.rtmp.messages.ErrorMessage Method = class net.boreeas.riotapi.rtmp.messages.control.Command$Method Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 10.419 sec <<< FAILURE!

Results :

Tests in error: testRetrieveInProgressSpectatorGameInfo(net.boreeas.riotapi.rtmp.RtmpClientTest): Client.Packet.Encoding: Unknown AMF type '121'.

Code:

diff --git a/rtmp/src/test/java/net/boreeas/riotapi/rtmp/RtmpClientTest.java b/rtmp/src/test/java/net/boreeas/riotapi/rtmp/RtmpClientTest.java
index b52ba24..a77c674 100644
--- a/rtmp/src/test/java/net/boreeas/riotapi/rtmp/RtmpClientTest.java
+++ b/rtmp/src/test/java/net/boreeas/riotapi/rtmp/RtmpClientTest.java
@@ -32,6 +32,7 @@ import net.boreeas.riotapi.com.riotgames.platform.summoner.spellbook.RunePageBoo
 import net.boreeas.riotapi.com.riotgames.team.dto.Team;
 import net.boreeas.riotapi.constants.Season;
 import net.boreeas.riotapi.loginqueue.LoginQueue;
+import net.boreeas.riotapi.com.riotgames.platform.game.PlatformGameLifecycle;

 import java.io.FileInputStream;
 import java.io.InputStreamReader;
@@ -46,7 +47,7 @@ import java.util.stream.Collectors;
 public class RtmpClientTest extends TestCase {

     private static Properties testConfig = new Properties();;
-    private static Shard shard = Shard.EUW;
+    private static Shard shard = Shard.EUNE;
     private static RtmpClient client;
     private static long summonerId;
     private static long accountId;
@@ -257,4 +258,11 @@ public class RtmpClientTest extends TestCase {
     public void testIsTagValidAndAvailablge() {
         client.summonerTeamService.isTagValidAndAvailable("TEST");
     }
+
+    public void testRetrieveInProgressSpectatorGameInfo() {
+        String player = "Shïbby";
+        PlatformGameLifecycle pgl = client.gameService.retrieveInProgressSpectatorGameInfo(player);
+        System.out.println("SpectatorGameInfo");
+        System.out.println(pgl.gameName);   
+    }
 }