Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexejhero committed Dec 26, 2024
2 parents 33e1492 + a51bd51 commit a7e9ee3
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 12 deletions.
4 changes: 4 additions & 0 deletions Godot/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions Unity/Assets/Json/JsonSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ public List<string> 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<string>? _required;
Expand Down
14 changes: 7 additions & 7 deletions Unity/Assets/Websocket/WebsocketConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion Unity/Assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Binary file added Unity/NuGet/Dependencies/Newtonsoft.Json.dll
Binary file not shown.
Binary file added Unity/NuGet/Dependencies/UniTask.Linq.dll
Binary file not shown.
4 changes: 4 additions & 0 deletions Unity/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a7e9ee3

Please sign in to comment.