Update Dependency Cshocker

Update Dependency CS2GSI
Update README
OpenShock now automatically gets shockerIds
This commit is contained in:
glax 2024-01-19 02:06:26 +01:00
parent d040995051
commit 18d3b6bf66
5 changed files with 35 additions and 17 deletions

View File

@ -2,7 +2,7 @@
using CS2GSI;
using CShocker.Ranges;
using CShocker.Shockers.Abstract;
using CS2Event = CS2GSI.CS2GSI.CS2Event;
using CS2Event = CS2GSI.CS2Event;
namespace OpenCS2hock;

View File

@ -10,8 +10,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CS2GSI" Version="1.0.6" />
<PackageReference Include="CShocker" Version="1.2.0" />
<PackageReference Include="CS2GSI" Version="1.0.7" />
<PackageReference Include="CShocker" Version="1.2.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

View File

@ -4,7 +4,7 @@ using CShocker.Shockers;
using CShocker.Shockers.Abstract;
using CShocker.Shockers.APIS;
using Microsoft.Extensions.Logging;
using CS2Event = CS2GSI.CS2GSI.CS2Event;
using CS2Event = CS2GSI.CS2Event;
namespace OpenCS2hock;
@ -117,18 +117,16 @@ public static class Setup
Shocker newShocker;
DurationRange durationRange;
IntensityRange intensityRange;
List<string> shockerIds;
List<string> shockerIds = new();
switch (selected)
{
case 1: //OpenShock (HTTP)
apiUri = QueryString("OpenShock API-Endpoint (https://api.shocklink.net):", "https://api.shocklink.net");
apiKey = QueryString("OpenShock API-Key:","");
Console.WriteLine("Shocker IDs associated with this API:");
shockerIds = AddShockerIds();
intensityRange = GetIntensityRange();
durationRange = GetDurationRange();
newShocker = new OpenShockHttp(shockerIds, intensityRange, durationRange, apiUri, apiKey);
newShocker.ShockerIds.AddRange(((OpenShockHttp)newShocker).GetShockers());
break;
case 3: //PiShock (HTTP)
apiUri = QueryString("PiShock API-Endpoint (https://do.pishock.com/api/apioperate):", "https://do.pishock.com/api/apioperate");

View File

@ -1,5 +1,5 @@
using CShocker.Shockers;
using CS2Event = CS2GSI.CS2GSI.CS2Event;
using CS2GSI;
using CShocker.Shockers;
namespace OpenCS2hock;

View File

@ -43,38 +43,58 @@ Example `config.json`. Place next to executable. Will also be generated on first
}
```
### LogLevel
## LogLevel
[Levels](https://learn.microsoft.com/de-de/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-8.0)
## Shockers
### ApiKey
For OpenShock (HTTP) get token [here](https://shocklink.net/#/dashboard/tokens)
For PiShock (HTTP) get information [here](https://apidocs.pishock.com/#header-authenticating)
### ApiType
CShocker [![Github](https://img.shields.io/badge/Github-8A2BE2)](https://github.com/C9Glax/cshocker) [here](https://github.com/C9Glax/CShocker/blob/master/CShocker/Shockers/Abstract/ShockerApi.cs)
### ShockerIds
List of Shocker-Ids, comma seperated. Get ID of shocker [here](https://shocklink.net/#/dashboard/shockers/own). Press the three dots -> Edit
List of Shocker-Ids, comma seperated.
Example `[ "ID-1", "ID-2" ]`
`[ "ID-1-asdasd", "ID-2-fghfgh" ]`
### Intensity Range
`0-100`%
in percent
`0-100`
### Duration Range
in ms
- `0-30000` OpenShock
- `0-15000` PiShock
### Username (PiShockHttp only)
For PiShock (HTTP) get information [here](https://apidocs.pishock.com/#header-authenticating)
### Sharecode (PiShockHttp only)
For PiShock (HTTP) get information [here](https://apidocs.pishock.com/#header-authenticating)
## ShockerActions
### TriggerEvent IDs
From CS2GSI [![Github](https://img.shields.io/badge/Github-8A2BE2)](https://github.com/C9Glax/CS2GSI) [here](https://github.com/C9Glax/CS2GSI/blob/master/CS2GSI/CS2Event.cs)
### Values for `Actions`
### ShockerIds
List of Shocker-Ids, comma seperated. (Same as in configured Shocker)
`[ "ID-1", "ID-2" ]`
### Actions
From CShocker [![Github](https://img.shields.io/badge/Github-8A2BE2)](https://github.com/C9Glax/cshocker) [here](https://github.com/C9Glax/CShocker/blob/master/CShocker/Shockers/ControlAction.cs)
### ValueFromInput
Use CS2GSI EventArgs value to determine Intensity (within configured Range)
Use CS2GSI EventArgs value to determine Intensity (within configured IntensityRange)
# Using
### CS2GSI
[![GitHub License](https://img.shields.io/github/license/c9glax/CS2GSI)](/LICENSE)
[![GitHub License](https://img.shields.io/github/license/c9glax/CS2GSI)](https://img.shields.io/github/license/c9glax/CS2GSI/LICENSE)
[![NuGet Version](https://img.shields.io/nuget/v/CS2GSI)](https://www.nuget.org/packages/CS2GSI/)
[![Github](https://img.shields.io/badge/Github-8A2BE2)](https://github.com/C9Glax/CS2GSI)
[![GitHub Release](https://img.shields.io/github/v/release/c9glax/CS2GSI)](https://github.com/C9Glax/CS2GSI/releases/latest)