Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Game Client API isn't working on the PBE #356

Closed
JanPachimari opened this issue Aug 29, 2020 · 23 comments
Closed

[BUG] Game Client API isn't working on the PBE #356

JanPachimari opened this issue Aug 29, 2020 · 23 comments

Comments

@JanPachimari
Copy link

Bug Description
I have made a request to https://127.0.0.1:2999/swagger/v2/swagger.json on both PBE and live (in my case EUW) servers.
While live servers returned the expected behaviour, I didn't get a response on PBE servers. It has worked before.

@RiotTuxedo RiotTuxedo added the pending: acknowledged We're aware of this issue and are investigating. label Aug 29, 2020
@RiotTuxedo
Copy link
Contributor

With Uli's help, determined that the game client API is working but it's just starting up on a random port instead of 2999.

We believe we've identified the issue and there's a fix checked in. We believe this will affect patch 10.18. Currently, the bug doesn't have a high enough impact to warrant an additional deploy of the game client (game breaking bugs are typically high impact) but if the game client is redeployed in the next 2 weeks this fix should get included in that redeploy. Will keep the thread updated.

@RiotTuxedo
Copy link
Contributor

RiotTuxedo commented Sep 3, 2020

There's a fix on the PBE, so this shouldn't be an issue on the PBE or for patch 10.19.

As expected, this should be affecting all live regions in 10.18. I've confirmed it's affecting NA. The release team is tentatively planning on a redeploy this upcoming Monday Tuesday if this fix isn't automatically included in a redeploy before then.

Editted because Monday is a US holiday, which means the redeploy would happen Tuesday.

@fabran99
Copy link

fabran99 commented Sep 3, 2020

LAS is also affected by the bug

@RiotTuxedo
Copy link
Contributor

@fabran99 I'll update my comment so it's clear, but yes this bug should affect all regions in patch 10.18. I only confirmed it was affecting NA.

@Querijn
Copy link

Querijn commented Sep 3, 2020

Wasn't this used by that twitch extension that gave you live updates on the game via an overlay? Isn't that a valid reason to micropatch this into live?

@RiotTuxedo
Copy link
Contributor

This issue is unfortunately not micropatchable :(

@flazouh
Copy link

flazouh commented Sep 3, 2020

So it's normal that I can't access my replay via GET https://127.0.0.1:2999/replay/render on the live server due to the bug ? Because before the 10.18 patch, everything was working for me and it seems that since the patch, I can't make that request anymore

@MingweiSamuel
Copy link

So it's normal that

Yes. You can manually get the port you need to use using this powershell command:

Get-NetTCPConnection -OwningProcess $(Get-Process 'League of Legends').Id | Where-Object { $_.LocalAddress -EQ '127.0.0.1' -And $_.RemoteAddress -EQ '0.0.0.0' } | Select-Object LocalAddress,LocalPort

@flazouh
Copy link

flazouh commented Sep 3, 2020

Ah yes indeed, thank you. But wasn't it always on port 2999 before ? First time I see it change so I'm surprised

@MingweiSamuel
Copy link

Yes its a bug

@ItaloScript
Copy link

Get-NetTCPConnection

So it's normal that

Yes. You can manually get the port you need to use using this powershell command:

Get-NetTCPConnection -OwningProcess $(Get-Process 'League of Legends').Id | Where-Object { $_.LocalAddress -EQ '127.0.0.1' -And $_.RemoteAddress -EQ '0.0.0.0' } | Select-Object LocalAddress,LocalPort

Get-NetTCPConnection doesnt work in windows lower than 8 , another solution?

@MingweiSamuel
Copy link

@Querijn had this recommendation (from the discord). You can also follow these steps manually from cmd:

1. Run the commandline "tasklist" and catch the output.
2. Split the lines, find the one that starts with "League of Legends.exe"
3. Split the lines into words, get the second "word". This is the PID, or process ID (should be a number).
4. This should result in one or zero lines.
5. Run the commandline "netstat -ano", catch output.
6. Split into lines, get only those that say "LISTENING" at the end, and contain the PID you've gotten earlier.
7. This should contain 1 line. Get the second word (should be an address eg 127.0.0.1:3578)
8. Make a GET request for "https://<address>/liveclientdata/allgamedata". It should return 200 OK.

@Querijn
Copy link

Querijn commented Sep 8, 2020

If you've got access to the windows API GetExtendedTcpTable might do the trick
https://docs.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getextendedtcptable

Here's @MingweiSamuel's comment in NodeJS (requires "node-fetch"):

async function getLiveGameAPIAddress() {
    return new Promise((resolve, reject) => {
        const exec = require('child_process').exec;
        const fetch = require("node-fetch");

        exec('tasklist', function (err, stdout, stderr) {
            const leagueLine = stdout.split("\n").filter(l => l.startsWith("League of Legends.exe"))[0];
            if (leagueLine == null) {
                reject("No League of Legends client found");
                return;
            }
            const words = leagueLine.split(" ").filter(s => s.length).map(s => s.trim());
            // console.log(`pid = ${words[3]}`);

            exec('netstat -ano', async function (err, stdout, stderr) {
                const lines = stdout.split("\n");
                // console.log(lines[0]);
                const tcpConnections = lines.filter(w => w.indexOf(words[3]) >= 0 && w.indexOf("LISTENING") >= 0);

                for (let conn of tcpConnections) {
                    const connectionData = conn.split(" ").filter(s => s.length);
                    // console.log(connectionData);
                    try {
                        const response = await fetch(`https://${connectionData[1]}/liveclientdata/allgamedata`);
                        
                        if (response.ok) {
                            resolve(connectionData[1]);
                            return;
                        }
                    }
                    catch (e) {
                        // console.error(e);
                    }
                }

                reject("Unable to determine web server!");
            });
        });
    });
}

getLiveGameAPIAddress().then(console.log);```

@RiotTuxedo
Copy link
Contributor

Alright update friends. The TFTM client needs to be re-released along with the game client, so we're just waiting on those. The fix should be out soon.

@RiotTuxedo
Copy link
Contributor

Unfortunately, I have to walk back this last update :(

As we get closer to the 10.19 patch, we've made the tough call to forego the 10.18 redeploy to fix this issue due to concerns that the redeploy will impact the timelines for 10.19. This issue has already been resolved on the PBE for patch 10.19. Without a redeploy to fix the randomized port for the game client API, there are a couple options for using the replay API in patch 10.18:

  1. Download and build the source code for League Director accounting for the randomized port in the game client.

  2. Use an alternative tool, that accounts for the randomized port, to manipulate the camera for replays generated in patch 10.18. One such tool being SkinSpotlights' Creator Suite. SkinSpotlights has a solid track record of providing quality tools for content creators, but as always we recommend exercising caution when using any third party tools.

RiotTuxedo referenced this issue in RiotGames/leaguedirector Sep 15, 2020
@lokoko99
Copy link

@RiotTuxedo Can you give us detailed explanation for the first option "Download and build the source code for League Director accounting for the randomized port in the game client."

@RiotTuxedo
Copy link
Contributor

@lokoko99 I was thinking of one of the following:

  1. You wait until the game client starts up, determine the port, and then build League Director using that port.
  2. You fork League Director and add logic to determine the port when the game client starts up.

As a heads up, the 10.19 patch is starting to roll out. Which means you'd need to save the 10.18 game client if you want to watch replays from games played during 10.18 as well as follow one of the options listed above; rebuild League Director or use an alternative tool.

@lokoko99
Copy link

lokoko99 commented Sep 15, 2020

I think I will wait 10.19 since I am not developer so this is too complicated for me. I just make content. :)
Hope it will work on new patch...

@RiotTuxedo
Copy link
Contributor

RiotTuxedo commented Sep 16, 2020

@lokoko99 should be fixed. I confirmed on the PBE last week. 10.19 is rolling out now. Give me a few minutes and I'll confirm.

EDIT: Confirmed the issue is resolved on OCE.

@ChronoBrake
Copy link

ChronoBrake commented Sep 16, 2020

Why in https://127.0.0.1:2999/liveclientdata/eventdata i don't see events about Drake and Baron kills? Only champion and turrets destroying info. In this patch it be disabled or what?
EUNE

@c0derMo
Copy link

c0derMo commented Sep 16, 2020

Some of the events are currently bugged, see #236

@ChronoBrake
Copy link

"Any update? it have been almost half a year"
really ?

@Querijn
Copy link

Querijn commented Sep 16, 2020

I recommend complaining about an issue in the comment section of the issue in question

@RiotTuxedo RiotTuxedo added closed: resolved scope: lol and removed pending: acknowledged We're aware of this issue and are investigating. labels Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants