Skip to content

Commit

Permalink
wait & remote scheduled statuses + bugfixes
Browse files Browse the repository at this point in the history
added wait status
added remote scheduled status
bugfixes
  • Loading branch information
KatDevsGames committed Oct 29, 2024
1 parent b9832ed commit 724f8f6
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
6 changes: 5 additions & 1 deletion EffectRequest.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#if NETSTANDARD1_3_OR_GREATER
using System;
#endif
using System;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace ConnectorLib.JSON;
Expand All @@ -21,7 +23,9 @@ public class EffectRequest : SimpleJSONRequest
public long? duration; //milliseconds
public string? viewer;
public JArray? viewers;
public int? cost;
public long? cost;
public Guid? requestID;
public JObject? sourceDetails;

public EffectRequest() => type = RequestType.EffectStart;

Expand Down
4 changes: 4 additions & 0 deletions EffectStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public enum EffectStatus
Resumed = 0x07,
/// <summary>The timed effect has finished.</summary>
Finished = 0x08,
/// <summary>The effect cannot be triggered right now. Wait for the specified time period for a followup response. Does not reschedule the request.</summary>
Wait = 0x09,
/// <summary>The effect is being managed by a remote scheduler. Wait indefinitely.</summary>
RemoteScheduled = 0xA0,

//== Effect Class Messages
/// <summary>The effect should be shown in the menu.</summary>
Expand Down
6 changes: 3 additions & 3 deletions GenericEvent.cs → GenericEventRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ namespace ConnectorLib.JSON;
[Serializable]
#endif
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class GenericEvent : SimpleJSONResponse
public class GenericEventRequest : SimpleJSONRequest
{
[JsonProperty(PropertyName = "internal")] public bool @internal;
public string eventType;
public Dictionary<string, string> data;
public Dictionary<string, object> data;

public GenericEvent() => type = ResponseType.GenericEvent;
public GenericEventRequest() => type = RequestType.GenericEvent;
}
21 changes: 21 additions & 0 deletions GenericEventResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#if NETSTANDARD1_3_OR_GREATER
using System;
#endif
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json;

namespace ConnectorLib.JSON;

#if NETSTANDARD1_3_OR_GREATER
[Serializable]
#endif
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class GenericEventResponse : SimpleJSONResponse
{
[JsonProperty(PropertyName = "internal")] public bool @internal;
public string eventType;
public Dictionary<string, object> data;

public GenericEventResponse() => type = ResponseType.GenericEvent;
}
2 changes: 1 addition & 1 deletion SimpleJSONResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static bool TryParse(JObject j, out SimpleJSONResponse? response)
response = j.ToObject<RpcRequest>(JSON_SERIALIZER)!;
return true;
case ResponseType.GenericEvent:
response = j.ToObject<GenericEvent>(JSON_SERIALIZER)!;
response = j.ToObject<GenericEventResponse>(JSON_SERIALIZER)!;
return true;
case ResponseType.DataResponse:
response = j.ToObject<DataResponse>(JSON_SERIALIZER)!;
Expand Down

0 comments on commit 724f8f6

Please sign in to comment.