feat: Unity client SDK (continuation of #1105)#1516
Conversation
Moved Unity SDK template files from 'templates/unity/Runtime' and 'templates/unity/Editor' to 'templates/unity/Assets/Runtime' and 'templates/unity/Assets/Editor' for better alignment with Unity project conventions. Updated getFiles() in Unity.php to reflect new paths and added support for copying plugin DLLs and project settings. Improved file upload logic in Client.cs.twig to handle streams and byte arrays more robustly, and removed Unity-specific logging from Exception.cs.twig. Minor fixes in Realtime.cs.twig and Role.cs.twig for namespace and async handling.
Introduces Unity2021 test support by adding a Unity2021Test.php, Unity test source files, and updating the GitHub Actions workflow to include Unity2021 in the test matrix and set the UNITY_LICENSE environment variable. This enables automated testing for the Unity SDK within the CI pipeline.
b4a302b to
00c4e0b
Compare
00c4e0b to
96474f5
Compare
…ntinued # Conflicts: # .github/workflows/tests.yml # src/SDK/SDK.php
…ntinued # Conflicts: # mock-server/app/http.php
| internal class RealtimeConnectedData | ||
| { | ||
| [JsonPropertyName("user")] | ||
| public Dictionary<string, object> User { get; set; } |
There was a problem hiding this comment.
a question here, do we need a dict here? user is always a single one for a client unlike subscriptions. A single client = single user
There was a problem hiding this comment.
Updated in 89dd7f3: connected.user is no longer modeled as a dictionary map type; it is now handled as a single JSON object (JsonElement) and checked as an object payload.
There was a problem hiding this comment.
@copilot One concern -> I am not aware in c# websockets. Presence and Subscribe are two independent messages.
Earlier we used to follow this->
- on the first subscribe only we open the websocket
Same thing should be done for the presence as well.
But here one thing is coming -> due to two different variants we need to make sure only one socket connection is opened and they are sent after the 'connected' is received
So a lock should be held always here.
Can you check this part
There was a problem hiding this comment.
Addressed in 89dd7f3: subscribe and presence now share a serialized send path guarded by a lock, and sends are deferred until after the app-level connected message. I also kept single-flight socket creation and allowed presence-only socket open (_channels.Count == 0 && _pendingPresence == null guard).
|
@ArnabChatterjee20k Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
| Metadata = metadata | ||
| }; | ||
|
|
||
| if (_webSocket?.State == WebSocketState.Open) |
There was a problem hiding this comment.
Ideally we should do it in a lock based synchronised way. same in the subscribe
Fix React Native audit vulnerabilities
Agent-Logs-Url: https://github.com/appwrite/sdk-generator/sessions/4b35a02a-b3af-4100-b0da-b0d11c6536c2 Co-authored-by: ArnabChatterjee20k <83803257+ArnabChatterjee20k@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…on-scope Scope React Native brace-expansion override
Summary
This PR continues the work started by @Fellmonkey in #1105 to add comprehensive Unity SDK support to the SDK generator.
What was done
unity-client-sdkbranch from Unity client sdk #1105unity-client-sdk-continuedpreserving all original commits from the community PRmasterand resolved conflicts (notably intemplates/dotnet/Package/Models/Model.cs.twig)Original PR content (from #1105)
Unitylanguage class (src/SDK/Language/Unity.php) that extends the baseLanguageclass, providing Unity-specific type mappings, keywords, and code generation logic for C# in Unity environment.templates/unity/Assets/including:Unity2021Test.phptest class that integrates with the existing test frameworkTests.cs,Tests.asmdef) for comprehensive SDK testingunityci/editor:ubuntu-2021.3.45f1-base-3.1.0UNITY_LICENSEenvironment variable for Unity Editor automationAssets/Runtime/andAssets/Editor/Changes from original PR
masterCloses #1105