From ed4eb644a0074632af372cc885b5a63698dd9da2 Mon Sep 17 00:00:00 2001 From: glax Date: Sun, 28 Jan 2024 18:25:33 +0100 Subject: [PATCH] Fi xjson message string --- CShocker/CShocker.csproj | 2 +- CShocker/Shockers/APIS/OpenShockHttp.cs | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CShocker/CShocker.csproj b/CShocker/CShocker.csproj index 1478b7c..af47cc0 100644 --- a/CShocker/CShocker.csproj +++ b/CShocker/CShocker.csproj @@ -7,7 +7,7 @@ Glax https://github.com/C9Glax/CShocker git - 1.3.7 + 1.3.8 diff --git a/CShocker/Shockers/APIS/OpenShockHttp.cs b/CShocker/Shockers/APIS/OpenShockHttp.cs index a66fb83..bb1dd5a 100644 --- a/CShocker/Shockers/APIS/OpenShockHttp.cs +++ b/CShocker/Shockers/APIS/OpenShockHttp.cs @@ -63,15 +63,16 @@ public class OpenShockHttp : HttpShocker UserAgent = { new ProductInfoHeaderValue("CShocker", "1") }, Accept = { new MediaTypeWithQualityHeaderValue("application/json") } }, - Content = new StringContent("{ shocks: ["+ - "{ "+ - $"\"id\": \"{shockerId}\"," + - $"\"type\": {ControlActionToByte(action)},"+ - $"\"intensity\": {intensity},"+ - $"\"duration\": {duration}"+ - "}" + + Content = new StringContent("{" + + "\"shocks\": ["+ + "{"+ + $"\"id\": \"{shockerId}\"," + + $"\"type\": {ControlActionToByte(action)},"+ + $"\"intensity\": {intensity},"+ + $"\"duration\": {duration}"+ + "}" + "]," + - "customName: CShocker" + + "\"customName\": CShocker" + "}", Encoding.UTF8, new MediaTypeHeaderValue("application/json")) }; request.Headers.Add("OpenShockToken", ApiKey);