Ale*_*pov 6 command-line gdb macos
背景:最后是 tl;dr
英雄联盟有一个旁观者模式,在这种模式下,您可以延迟 3 分钟观看其他人的比赛(基本上是重播)。 受欢迎的 LoL 网站 OP.GG想出了一种巧妙的方法,将这些观众游戏托管在他们自己的服务器上,从而使它们可重玩,而不是仅在游戏运行时可用(就像 Riot 那样)。
如果您从 OP.GG 请求重播,它会发送一个批处理文件,查找联盟所在的位置,然后神奇的事情发生了:
@start "" "League of Legends.exe" "8394" "LoLLauncher.exe" "" "spectator fspectate.op.gg:4081 tjJbtRLQ/HMV7HuAxWV0XsXoRB4OmFBr 1391881421 NA1"
Run Code Online (Sandbox Code Playgroud)
这在 Windows 上运行良好。我正在尝试让它在 Mac(它有一个官方客户端)上运行。
首先我尝试手动运行相同的命令,(为了方便拆分)
/Applications/ ... /LeagueOfLegends.app/ ... /LeagueofLegends 8393 LoLLauncher \
/Applications/ ... /LolClient spectator fspectate.op.gg:4081 tjJbtRLQ/HMV7HuAxWV0XsXoRB4OmFBr 1391881421 NA1
Run Code Online (Sandbox Code Playgroud)
但是,运行它只会启动 LoLLauncher,它会关闭所有活动的 League 进程。如果我只是打电话,会发生完全相同的事情/Applications/ ... /LeagueOfLegends.app/ ... /LeagueofLegends
接下来,我尝试查看启动旁观者模式时实际发生的情况,因此我运行$ ps -axf | grep -i lol了显示
UID PID PPID C STIME TTY TIME CMD
503 3085 1 0 Wed02pm ?? 0:00.00 (LolClient)
503 24607 1 0 9:19am ?? 0:00.98 /Applications/League of Legends.app/Contents/LOL/RADS/system/UserKernel.app/Contents/MacOS/UserKernel updateandrun lol_launcher LoLLauncher.app
503 24610 24607 0 9:19am ?? 1:08.76 /Applications/League of Legends.app/Contents/LoL/RADS/projects/lol_launcher/releases/0.0.0.122/deploy/LoLLauncher.app/Contents/MacOS/LoLLauncher
503 24611 24610 0 9:19am ?? 1:23.02 /Applications/League of Legends.app/Contents/LoL/RADS/projects/lol_air_client/releases/0.0.0.127/deploy/bin/LolClient -runtime .\ -nodebug META-INF\AIR\application.xml .\ -- 8393
503 24927 24610 0 9:44am ?? 0:03.37 /Applications/League of Legends.app/Contents/LoL/RADS/solutions/lol_game_client_sln/releases/0.0.0.117/deploy/LeagueOfLegends.app/Contents/MacOS/LeagueofLegends 8394 LoLLauncher /Applications/League of Legends.app/Contents/LoL/RADS/projects/lol_air_client/releases/0.0.0.127/deploy/bin/LolClient spectator 216.133.234.17:8088 Yn1oMX/n3LpXNebibzUa1i3Z+s2HV0ul 1400781241 NA1
Run Code Online (Sandbox Code Playgroud)
出于兴趣:
(LolClient)我无法通过它的PID杀死的。UserKernel updateandrun lol_launcher LoLLauncher.app 首先启动。LoLLauncher由UserKernel(我们可以从 PPID 中看到)启动UserKernel.我尝试将 GDB 附加到 LolClient,但我无法从中获得任何有意义的信息,因为它是一个 Adobe AIR 应用程序(而且我从未将 GDB 与我自己的代码一起使用)。
接下来,我运行dtruss -a -b 100m -f -p $PID了所有我能想到的:the LolClient、 theLolLauncher和 theUserKernel并略读了产生的 50 万行。我发现诸如 GET 请求之类的东西用于获取游戏信息以供观看,但我看不到任何具有观看者选项的英雄联盟.exe 等价物的启动。
最后,我跑去lsof | grep -i lol看看在这个过程中是否打开了其他任何东西,但没有找到任何看起来合适的东西。打开UserKernel, LolLauncher, LolClient, Adobe AIR,LeagueofLegends和 then Bugsplat,所有这些都是预期的。这些似乎都与弄清楚英雄联盟如何打开观众模式无关。
显然可以做到,因为观众模式可以从客户端访问。它似乎可以从 CLI 完成,因为 Windows 可以做到,并且客户端应该是平等的。除非我遗漏了 UNIX 和 Windows 处理 CLI 应用程序启动方式之间的差异。
我的问题是,是否还有其他任何事情我可以尝试弄清楚如何自己启动旁观者模式。
tl;博士:
试图从 CLI 进入旁观者模式。这在 Windows 上是可能的(参见第一个代码块),但它只是在 Mac 上重新启动 League。我还能尝试找到什么调用,以及如何重现它?
编辑 1:当观众模式启动时,我找到了确切的线路(在 GDB 中)。这一切都dtruss变成了为一步。
PS:请告诉我如何改进这个问题或其格式,我很想使用 StackOverflow/SuperUser,但正如本周播客(第 59 集)中的人所说,这非常令人生畏。很抱歉第一次在 StackOverflow 上发帖:(
我想知道同样的事情,而且你非常接近......但是,这是答案,至少对于 4.14.14_08_11_13_42 (见下文)。仅供参考,我做了很多搜索,似乎没有人在 Mac 上解决这个问题,所以我希望我能成为第一个……;-)
首先,启动联盟客户端并正常登录。然后,在终端中:
$ cd "/Applications/League of Legends.app/Contents/LoL/RADS/solutions/lol_game_client_sln/releases/0.0.0.131/deploy/LeagueOfLegends.app/Contents/MacOS"
$ riot_launched=true "/Applications/League of Legends.app/Contents/LoL/RADS/solutions/lol_game_client_sln/releases/0.0.0.131/deploy/LeagueOfLegends.app/Contents/MacOS/LeagueofLegends" 8394 LoLLauncher "/Applications/League of Legends.app/Contents/LoL/RADS/projects/lol_air_client/releases/0.0.0.140/deploy/bin/LolClient" "spectator [ip:port] [token] [number] [region]"
Run Code Online (Sandbox Code Playgroud)
这对我有用。唯一的问题是在观看比赛后,大厅没有正确重置——当观众客户端以这种方式启动时,“比赛已结束”事件似乎没有正确注册。所以,我只是关闭应用程序并重新启动......但是,至少这样我可以观看与我不是“朋友”的人的比赛。
| 归档时间: |
|
| 查看次数: |
5711 次 |
| 最近记录: |