#lol #riot #api-wrapper #lcu #events

teemo

A League of Legends API wrapper for Rust

10 releases

0.2.3 Jan 10, 2024
0.2.2 Jan 4, 2024
0.2.1 Dec 25, 2023
0.1.3-beta.2 Dec 15, 2023

#2141 in Web programming

Download history 10/week @ 2023-12-22 7/week @ 2023-12-29 12/week @ 2024-01-05 1/week @ 2024-02-23 1/week @ 2024-03-01 1/week @ 2024-03-08 9/week @ 2024-03-15 16/week @ 2024-03-29 51/week @ 2024-04-05

76 downloads per month

MIT license

22KB
453 lines

Teemo

不要低估迅捷斥候的威力。

本项目用于和英雄联盟游戏客户端进行请求和通信。

使用 Usage

本项目适用于:

  • Windows
  • League Of Legends

事件 Event

https://127.0.0.1:<PORT>/help可以查看。

需要注意的是:如果注册了某事件,会触发这个事件及其所有子事件。比如注册/lol-lobby/v2/lobby事件,那么/lol-lobby/v2/lobby/members也会触发事件回调.

示例

示例

对局进行中的事件

对局开始后通过https://127.0.0.1:2999/swagger/v3/openapi.json查看接口地址。

可在官方文档中搜索2999即可找到所有api的功能描述。

其它

LCU websocket

https://hextechdocs.dev/getting-started-with-the-lcu-websocket/

示例:https://gist.github.com/Pupix/eb662b1b784bb704a1390643738a8c15

程序流程

  1. 初始化数据;
  2. api转发;
  3. ws连接;
  4. ws检查;
  5. ws关闭;
  6. 程序关闭。

流程错误处理

  • 若401,返回至1;
  • 若被拒绝,返回至1;
  • 若关闭程序,停止所有循环。

如何关闭 vscode 的 rust-analyzer 插件的自动类型提示

https://zhuanlan.zhihu.com/p/535828881

LCU主动关闭ws

word": String("UWpTutcT0rme7Lfw"), "partyId": String("INVID4148783830"), "partyType": String(""), "restrictions": Null, "scarcePositions": Array [], "warnings": Null}, "uri": String("/lol-lobby/v2/lobby")}
thread 'tokio-runtime-worker' panicked at E:\Users\wa\Documents\codes\Teemo\src\utils.rs:148:23:
called `Result::unwrap()` on an `Err` value: Io(Os { code: 10054, kind: ConnectionReset, message: "远程主机强迫关闭了一 个现有的连接。" })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Dependencies

~7–22MB
~343K SLoC