diff --git a/Godot/USAGE.md b/Godot/USAGE.md index cbd20eb..d18fe8a 100644 --- a/Godot/USAGE.md +++ b/Godot/USAGE.md @@ -108,6 +108,10 @@ An `ActionWindow` can be in one of 4 possible states: - `Forced`: An action force has been sent for this window. - `Ended`: This window has successfuly received an action and is waiting to be destroyed. +> [!Important] +> Since the API doesn't support multiple `actions/force` messages at the same time, you need to make sure you don't have multiple action windows in the `Forced` state at the same time. +> Easiest way to prevent this is to only ever have one active action window at a time. + ### Adding a Context If you want to add a context message to an action window, you can use the function `ActionWindow.set_context(message: String, silent: bool)`. This will send the context message when the window is registered. Use this to pass in state relevant to the available actions. diff --git a/Unity/Assets/Json/JsonSchema.cs b/Unity/Assets/Json/JsonSchema.cs index 28eed80..504f1b8 100644 --- a/Unity/Assets/Json/JsonSchema.cs +++ b/Unity/Assets/Json/JsonSchema.cs @@ -90,16 +90,16 @@ public List Required public int? MaxLength { get; set; } [JsonProperty("maximum")] - public int? Maximum { get; set; } + public float? Maximum { get; set; } [JsonProperty("exclusiveMinimum")] - public int? ExclusiveMinimum { get; set; } + public float? ExclusiveMinimum { get; set; } [JsonProperty("exclusiveMaximum")] - public int? ExclusiveMaximum { get; set; } + public float? ExclusiveMaximum { get; set; } [JsonProperty("minimum")] - public int? Minimum { get; set; } + public float? Minimum { get; set; } [JsonProperty("required")] private List? _required; diff --git a/Unity/Assets/Websocket/WebsocketConnection.cs b/Unity/Assets/Websocket/WebsocketConnection.cs index 2c825a2..5573cd9 100644 --- a/Unity/Assets/Websocket/WebsocketConnection.cs +++ b/Unity/Assets/Websocket/WebsocketConnection.cs @@ -48,8 +48,6 @@ private async UniTask Reconnect() private async UniTask StartWs() { - Debug.LogWarning("Initializing WebSocket connection"); - try { if (_socket?.State is WebSocketState.Open or WebSocketState.Connecting) await _socket.Close(); @@ -127,13 +125,15 @@ private async UniTask StartWs() }; _socket.OnError += error => { - Debug.LogError("Websocket connection has encountered an error!"); - Debug.LogError(error); - Reconnect().Forget(); + if (error != "Unable to connect to the remote server") + { + Debug.LogError("Websocket connection has encountered an error!"); + Debug.LogError(error); + } }; - _socket.OnClose += _ => + _socket.OnClose += code => { - Debug.LogError("Websocket connection has been closed!"); + if (code != WebSocketCloseCode.Abnormal) Debug.LogWarning($"Websocket connection has been closed with code {code}!"); Reconnect().Forget(); }; await _socket.Connect(); diff --git a/Unity/Assets/package.json b/Unity/Assets/package.json index c0e8b13..e468735 100644 --- a/Unity/Assets/package.json +++ b/Unity/Assets/package.json @@ -3,7 +3,7 @@ "displayName": "Neuro SDK", "description": "Neuro SDK for Unity", "author": "Vedal AI", - "version": "1.1.5", + "version": "1.1.6", "unity": "2022.3", "dependencies": { "com.cysharp.unitask": "2.5.10", diff --git a/Unity/NuGet/Dependencies/Newtonsoft.Json.dll b/Unity/NuGet/Dependencies/Newtonsoft.Json.dll new file mode 100644 index 0000000..6630063 Binary files /dev/null and b/Unity/NuGet/Dependencies/Newtonsoft.Json.dll differ diff --git a/Unity/NuGet/Dependencies/UniTask.Linq.dll b/Unity/NuGet/Dependencies/UniTask.Linq.dll new file mode 100644 index 0000000..6113680 Binary files /dev/null and b/Unity/NuGet/Dependencies/UniTask.Linq.dll differ diff --git a/Unity/USAGE.md b/Unity/USAGE.md index ddf9d73..c0d9623 100644 --- a/Unity/USAGE.md +++ b/Unity/USAGE.md @@ -131,6 +131,10 @@ An `ActionWindow` can be in one of 4 possible states: - `Forced`: An action force has been sent for this window. - `Ended`: This window has successfuly received an action and is waiting to be destroyed. +> [!Important] +> Since the API doesn't support multiple `actions/force` messages at the same time, you need to make sure you don't have multiple action windows in the `Forced` state at the same time. +> Easiest way to prevent this is to only ever have one active action window at a time. + ### Adding a Context If you want to add a context message to an action window, you can use the method `void ActionWindow.SetContext(string message, bool silent)`. This will send the context message when the window is registered. Use this to pass in state relevant to the available actions.