Kunc.RiotGames.Lol.LeagueClientUpdate
0.1.0
Prefix Reserved
See the version list below for details.
dotnet add package Kunc.RiotGames.Lol.LeagueClientUpdate --version 0.1.0
NuGet\Install-Package Kunc.RiotGames.Lol.LeagueClientUpdate -Version 0.1.0
<PackageReference Include="Kunc.RiotGames.Lol.LeagueClientUpdate" Version="0.1.0" />
paket add Kunc.RiotGames.Lol.LeagueClientUpdate --version 0.1.0
#r "nuget: Kunc.RiotGames.Lol.LeagueClientUpdate, 0.1.0"
// Install Kunc.RiotGames.Lol.LeagueClientUpdate as a Cake Addin #addin nuget:?package=Kunc.RiotGames.Lol.LeagueClientUpdate&version=0.1.0 // Install Kunc.RiotGames.Lol.LeagueClientUpdate as a Cake Tool #tool nuget:?package=Kunc.RiotGames.Lol.LeagueClientUpdate&version=0.1.0
Kunc.RiotGames.Lol.LeagueClientUpdate
How to use
Lockfile lockfile = await Lockfile.FromFileAsync();
LolLeagueClientUpdate lcu = new LolLeagueClientUpdate(lockfile);
API
To send an API request, you have 2 options:
- Use the predefined methods (
GetAsync/SendAsync
) that are a wrapper aroundHttpClinet
. - Use
HttpClient
directly (propertyClient
), so you can use many existing methods.
var obj = new { challengeIds = new long[] { -1, -1, -1 } };
await lcu.SendAsync(HttpMethod.Post, "lol-challenges/v1/update-player-preferences/", obj);
await lcu.Client.PostAsJsonAsync("lol-challenges/v1/update-player-preferences/", obj);
RootObject obj1 = await lcu.GetAsync<RootObject>("lol-summoner/v1/current-summoner");
RootObject obj2 = await lcu.Client.GetFromJsonAsync<RootObject>("lol-summoner/v1/current-summoner");
class RootObject { /* Properties */ }
WebSocket
To subscribe a lcu event, you have 2 options:
- Call
Subscribe
with event uri and pass event delegate. - Create a
class
with public (static) methods and placeLcuEventAttribute
on it, than callSubscribeAll<T>()
, if theclass
has any dependencies in the constructor, you can callSubscribeAll<T>(T obj)
and pass the created class.
When you create a class or use Subscibe
with a System.Delegate
, you can create any method that has any return type and has 0-3 parameters, the parameters can be
object
/LolLeagueClientUpdate
for "sender"CancelationToken
- and anything else will be a lcu event argument
Don't forget to call ConnectAsync
to start WebSocket.
lcu.Subscribe<LcuEventArgs<string>>("/lol-gameflow/v1/gameflow-phase", (sender, arg) => Console.WriteLine(arg.Data));
lcu.SubscribeAll<SomeClass>();
var obj = new SomeClassWithDependencies(DateTime.Now);
lcu.SubscribeAll(obj);
await lcu.ConnectAsync();
class SomeClass
{
[LcuEvent("/lol-gameflow/v1/gameflow-phase")]
public void MyMethod1(object? sender, LcuEventArgs<string> data)
=> Console.WriteLine(data.Data);
[LcuEvent("/lol-gameflow/v1/gameflow-phase")]
public void MyMethod2() => Console.WriteLine("without params");
[LcuEvent("/lol-gameflow/v1/gameflow-phase")]
public int MyMethod3()
{
Console.WriteLine("Return int, without params");
return 6;
}
}
class SomeClassWithDependencies
{
public SomeClassWithDependencies(DateTime dt) { }
[LcuEvent("/lol-gameflow/v1/gameflow-phase")]
public void MyMethod1(object? sender, LcuEventArgs<string> data)
=> Console.WriteLine(data.Data);
}
Disclaimer
Kunc.RiotGames.Lol.LeagueClientUpdate
isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.