BlossomiShymae.GrrrLCU
0.5.0
See the version list below for details.
dotnet add package BlossomiShymae.GrrrLCU --version 0.5.0
NuGet\Install-Package BlossomiShymae.GrrrLCU -Version 0.5.0
<PackageReference Include="BlossomiShymae.GrrrLCU" Version="0.5.0" />
paket add BlossomiShymae.GrrrLCU --version 0.5.0
#r "nuget: BlossomiShymae.GrrrLCU, 0.5.0"
// Install BlossomiShymae.GrrrLCU as a Cake Addin #addin nuget:?package=BlossomiShymae.GrrrLCU&version=0.5.0 // Install BlossomiShymae.GrrrLCU as a Cake Tool #tool nuget:?package=BlossomiShymae.GrrrLCU&version=0.5.0
GrrrLCU
GrrrLCU is a wrapper for the LCU API which is unofficially provided by Riot Games.
This library is currently compatible with .NET 8 and higher for Windows.
Contributors
<a href="https://github.com/BlossomiShymae/GrrrLCU/graphs/contributors"> <img src="https://contrib.rocks/image?repo=BlossomiShymae/GrrrLCU" /> </a>
Requesting the LCU
Requesting with GrrrLCU is simple:
var response = await Connector.SendAsync(HttpMethod.Get, "/lol-summoner/v1/current-summoner");
var me = await response.Content.ReadFromJsonAsync<Summoner>();
Simpler for GET requests:
var response = await Connector.GetAsync("/lol-summoner/v1/current-summoner");
var me = await response.Content.ReadFromJsonAsync<Summoner>();
Simplest for GET requests:
var me = await Connector.GetFromJsonAsync<Summoner>("/lol-summoner/v1/current-summoner");
Utilities:
var processInfo = Connector.GetProcessInfo();
var riotAuthentication = new RiotAuthentication(processInfo.RemotingAuthToken);
WebSockets
This library uses the Websocket.Client
wrapper, which comes with built-in reconnection and error handling.
Create a client:
var client = Connector.CreateLcuWebsocketClient();
Listen to events, disconnections, or reconnection messages:
client.EventReceived.Subscribe(msg =>
{
Console.WriteLine(msg?.Data?.Uri);
});
client.DisconnectionHappened.Subscribe(msg =>
{
if (msg.Exception != null) throw msg.Exception;
});
client.ReconnectionHappened.Subscribe(msg =>
{
Console.WriteLine(msg.Type);
});
Use it:
// This starts the client in a background thread. You will need an event loop
// to listen to messages.
await client.Start();
// Subscribe to every event that the League Client sends.
var message = new EventMessage(RequestType.Subscribe, EventMessage.Kinds.OnJsonApiEvent);
client.Send(message);
// We will need an event loop for the background thread to process.
// You may close at any time with Ctrl+C or similar chord.
while(true) await Task.Delay(TimeSpan.FromSeconds(1));
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-windows7.0 is compatible. |
-
net8.0-windows7.0
- Websocket.Client (>= 5.1.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.14.0 | 93 | 8/29/2024 |
0.13.1 | 129 | 8/24/2024 |
0.13.0 | 115 | 8/23/2024 |
0.12.0 | 120 | 8/22/2024 |
0.11.1 | 113 | 8/20/2024 |
0.11.0 | 128 | 8/20/2024 |
0.10.0 | 121 | 8/16/2024 |
0.9.0 | 122 | 8/10/2024 |
0.8.0 | 116 | 8/8/2024 |
0.7.0 | 89 | 8/7/2024 |
0.6.0 | 92 | 8/7/2024 |
0.5.0 | 58 | 8/4/2024 |
0.4.0 | 56 | 8/2/2024 |
0.3.0 | 65 | 8/1/2024 |
0.2.0 | 54 | 7/31/2024 |
0.1.1 | 76 | 7/27/2024 |
0.1.0 | 77 | 7/27/2024 |