diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..5b1874d9c --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,21 @@ +## Description of Changes +*Describe what has been changed, any new features or bug fixes* + +## API + + - [ ] This is an API breaking change to the SDK + +*If the API is breaking, please state below what will break* + +## Requires SpacetimeDB PRs +*List any PRs here that are required for this SDK change to work* + +## Testsuite +*If you would like to run the your SDK changes in this PR against a specific SpacetimeDB branch, specify that here. This can be a branch name or a link to a PR.* + +SpacetimeDB branch name: master + +## Testing +*Write instructions for a test that you performed for this PR* + +- [ ] Describe a test for this PR that you have completed diff --git a/.github/workflows/check-pr-base.yml b/.github/workflows/check-pr-base.yml new file mode 100644 index 000000000..73b71c27f --- /dev/null +++ b/.github/workflows/check-pr-base.yml @@ -0,0 +1,22 @@ +name: Git tree checks + +on: + pull_request: + types: [opened, edited, reopened, synchronize] + merge_group: +permissions: read-all + +jobs: + check_base_ref: + name: Only release branches may merge into master + runs-on: ubuntu-latest + steps: + - id: not_based_on_master + if: | + github.event_name == 'pull_request' && + github.event.pull_request.base.ref == 'master' && + ! startsWith(github.event.pull_request.head.ref, 'release/') + run: | + echo 'Only `release/*` branches are allowed to merge into `master`.' + echo 'Maybe your PR should be merging into `staging`?' + exit 1 diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml new file mode 100644 index 000000000..04f0a1411 --- /dev/null +++ b/.github/workflows/publish-nuget.yml @@ -0,0 +1,25 @@ +name: Publish NuGet Package on Release + +on: + release: + types: [published] + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8' + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore --configuration Release + # - name: Test + # run: dotnet test --no-build + - name: Pack + run: dotnet pack --no-build --output nupkgs + - name: Publish + run: dotnet nuget push nupkgs/*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..460ab9778 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,159 @@ +name: Test Suite + +on: + push: + branches: + - staging + pull_request: + +jobs: + unity-testsuite: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: true + + # Grab the SpacetimeDB branch name from the PR description. If it's not found, master will be used instead. + # We'll use this branch name for any integration tests with SpacetimeDB. + + - name: Extract SpacetimeDB branch name or PR link from PR description + id: extract-branch + if: github.event_name == 'pull_request' + env: + description: ${{ github.event.pull_request.body }} + run: | + # Check if description contains a branch name or a PR link + branch_or_pr=$(echo "$description" | grep -oP '(?<=SpacetimeDB branch name:\s).+') + echo "Branch or PR found: $branch_or_pr" + + if [[ -z "$branch_or_pr" ]]; then + branch="master" + elif [[ "$branch_or_pr" =~ ^https://github.com/.*/pull/[0-9]+$ ]]; then + # If it's a PR link, extract the branch name from the PR + pr_number=$(echo "$branch_or_pr" | grep -oP '[0-9]+$') + branch=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + https://api.github.com/repos/clockworklabs/SpacetimeDB/pulls/$pr_number | jq -r '.head.ref') + else + # It's already a branch name + branch="$branch_or_pr" + fi + + echo "branch=$branch" >> $GITHUB_OUTPUT + echo "Final branch name: $branch" + + - name: Checkout SpacetimeDB + uses: actions/checkout@v4 + with: + repository: clockworklabs/SpacetimeDB + ref: ${{ steps.extract-branch.outputs.branch }} + path: SpacetimeDB~ + + # Run cheap .NET tests first. If those fail, no need to run expensive Unity tests. + + - name: Override NuGet packages + run: | + dotnet pack SpacetimeDB~/crates/bindings-csharp/BSATN.Runtime + + # Write out the nuget config file to `nuget.config`. This causes the spacetimedb-csharp-sdk repository + # to be aware of the local versions of the `bindings-csharp` packages in SpacetimeDB, and use them if + # available. Otherwise, `spacetimedb-csharp-sdk` will use the NuGet versions of the packages. + # This means that (if version numbers match) we will test the local versions of the C# packages, even + # if they're not pushed to NuGet. + # See https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file for more info on the config file. + ./tools~/write-nuget-config.sh SpacetimeDB~ + + - name: Run .NET tests + run: dotnet test -warnaserror + + - name: Verify C# formatting + run: dotnet format --no-restore --verify-no-changes SpacetimeDB.ClientSDK.sln + + # Now, setup the Unity tests. + + - name: Patch spacetimedb dependency in Cargo.toml + working-directory: unity-tests~/server-rust + run: | + sed -i "s|spacetimedb *=.*|spacetimedb = \{ path = \"../../SpacetimeDB~/crates/bindings\" \}|" Cargo.toml + cat Cargo.toml + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + with: + workspaces: unity-tests~/server-rust + shared-key: UnityTestServer + + - name: Install SpacetimeDB CLI from the local checkout + run: | + cargo install --force --path SpacetimeDB~/crates/cli --locked --message-format=short + cargo install --force --path SpacetimeDB~/crates/standalone --locked --message-format=short + # Add a handy alias using the old binary name, so that we don't have to rewrite all scripts (incl. in submodules). + rm $HOME/.cargo/bin/spacetime || echo "haven't run on this host before" + ln -s $HOME/.cargo/bin/spacetimedb-cli $HOME/.cargo/bin/spacetime + # Clear any existing information + spacetime server clear -y + env: + # Share the target directory with our local project to avoid rebuilding same SpacetimeDB crates twice. + CARGO_TARGET_DIR: unity-tests~/server-rust/target + + - name: Generate client bindings + working-directory: unity-tests~/server-rust + run: bash ./generate.sh -y + + - name: Check for changes + run: | + git diff --exit-code unity-tests~/client/Assets/Scripts/autogen || { + echo "Error: Bindings are dirty. Please generate bindings again and commit them to this branch." + exit 1 + } + + - name: Check Unity meta files + uses: DeNA/unity-meta-check@v3 + with: + enable_pr_comment: ${{ github.event_name == 'pull_request' }} + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + + - name: Start SpacetimeDB + run: | + spacetime start & + disown + + - name: Publish module to SpacetimeDB + working-directory: unity-tests~/server-rust + run: | + spacetime logout && spacetime login --server-issued-login local + bash ./publish.sh + + - uses: actions/cache@v3 + with: + path: unity-tests~/client/Library + key: Library-SpacetimeDBUnityTestsuite-Linux-x86 + restore-keys: | + Library-SpacetimeDBUnityTestsuite- + Library- + + - name: Patch com.clockworklabs.spacetimedbsdk dependency in manifest.json + working-directory: unity-tests~/client/Packages + run: | + # Replace the com.clockworklabs.spacetimedbsdk dependency with the current branch. + # TODO: find out why pointing to a local directory doesn't work - is it because Unity CI action uses Docker? + yq e -i '.dependencies["com.clockworklabs.spacetimedbsdk"] = "https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk.git#${{ github.head_ref }}"' manifest.json + cat manifest.json + + - name: Run Unity tests + uses: game-ci/unity-test-runner@v4 + with: + unityVersion: 2022.3.32f1 # Adjust Unity version to a valid tag + projectPath: unity-tests~/client # Path to the Unity project subdirectory + githubToken: ${{ secrets.GITHUB_TOKEN }} + testMode: playmode + useHostNetwork: true + env: + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} diff --git a/.gitignore b/.gitignore index 116e0d072..42502a20a 100644 --- a/.gitignore +++ b/.gitignore @@ -32,9 +32,7 @@ # Autogenerated VS/MD/Consulo solution and project files ExportedObj/ .consulo/ -*.csproj *.unityproj -*.sln *.suo *.tmp *.user @@ -71,5 +69,10 @@ crashlytics-build.properties /[Aa]ssets/[Ss]treamingAssets/aa.meta /[Aa]ssets/[Ss]treamingAssets/aa/* -.idea -*.unitypackage +bin~ +obj~ + +# This is used for local paths to SpacetimeDB packages. +/nuget.config +/nuget.config.meta +.idea/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..50c54dcb4 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "SpacetimeDBCircleGame"] + path = unity-tests~ + url = https://github.com/clockworklabs/SpacetimeDBCircleGame diff --git a/Assets/ExportPackage.cs b/Assets/ExportPackage.cs deleted file mode 100644 index 70e155669..000000000 --- a/Assets/ExportPackage.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEditor; -using UnityEngine; - -public class ExportPackage -{ - public static void Export() - { - AssetDatabase.ExportPackage("Assets/SpacetimeDB", "SpacetimeDBUnitySDK.unitypackage", ExportPackageOptions.Recurse); - } -} diff --git a/Assets/Main.unity b/Assets/Main.unity deleted file mode 100644 index 7582fbead..000000000 --- a/Assets/Main.unity +++ /dev/null @@ -1,301 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -OcclusionCullingSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 - m_SceneGUID: 00000000000000000000000000000000 - m_OcclusionCullingData: {fileID: 0} ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 9 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - m_FogMode: 3 - m_FogDensity: 0.01 - m_LinearFogStart: 0 - m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} - m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} - m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} - m_AmbientIntensity: 1 - m_AmbientMode: 0 - m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} - m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} - m_HaloStrength: 0.5 - m_FlareStrength: 1 - m_FlareFadeSpeed: 3 - m_HaloTexture: {fileID: 0} - m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} - m_DefaultReflectionMode: 0 - m_DefaultReflectionResolution: 128 - m_ReflectionBounces: 1 - m_ReflectionIntensity: 1 - m_CustomReflection: {fileID: 0} - m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.18028328, g: 0.22571328, b: 0.3069218, a: 1} - m_UseRadianceAmbientProbe: 0 ---- !u!157 &3 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 12 - m_GIWorkflowMode: 1 - m_GISettings: - serializedVersion: 2 - m_BounceScale: 1 - m_IndirectOutputScale: 1 - m_AlbedoBoost: 1 - m_EnvironmentLightingMode: 0 - m_EnableBakedLightmaps: 1 - m_EnableRealtimeLightmaps: 0 - m_LightmapEditorSettings: - serializedVersion: 12 - m_Resolution: 2 - m_BakeResolution: 40 - m_AtlasSize: 1024 - m_AO: 0 - m_AOMaxDistance: 1 - m_CompAOExponent: 1 - m_CompAOExponentDirect: 0 - m_ExtractAmbientOcclusion: 0 - m_Padding: 2 - m_LightmapParameters: {fileID: 0} - m_LightmapsBakeMode: 1 - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 256 - m_ReflectionCompression: 2 - m_MixedBakeMode: 2 - m_BakeBackend: 1 - m_PVRSampling: 1 - m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 512 - m_PVRBounces: 2 - m_PVREnvironmentSampleCount: 256 - m_PVREnvironmentReferencePointCount: 2048 - m_PVRFilteringMode: 1 - m_PVRDenoiserTypeDirect: 1 - m_PVRDenoiserTypeIndirect: 1 - m_PVRDenoiserTypeAO: 1 - m_PVRFilterTypeDirect: 0 - m_PVRFilterTypeIndirect: 0 - m_PVRFilterTypeAO: 0 - m_PVREnvironmentMIS: 1 - m_PVRCulling: 1 - m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 5 - m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousPositionSigmaDirect: 0.5 - m_PVRFilteringAtrousPositionSigmaIndirect: 2 - m_PVRFilteringAtrousPositionSigmaAO: 1 - m_ExportTrainingData: 0 - m_TrainingDataDestination: TrainingData - m_LightProbeSampleCountMultiplier: 4 - m_LightingDataAsset: {fileID: 0} - m_LightingSettings: {fileID: 0} ---- !u!196 &4 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentTypeID: 0 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - minRegionArea: 2 - manualCellSize: 0 - cellSize: 0.16666667 - manualTileSize: 0 - tileSize: 256 - accuratePlacement: 0 - maxJobWorkers: 0 - preserveTilesOutsideBounds: 0 - debug: - m_Flags: 0 - m_NavMeshData: {fileID: 0} ---- !u!1 &870692381 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 870692384} - - component: {fileID: 870692383} - - component: {fileID: 870692382} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &870692382 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 870692381} - m_Enabled: 1 ---- !u!20 &870692383 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 870692381} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &870692384 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 870692381} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1777449238 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1777449240} - - component: {fileID: 1777449239} - m_Layer: 0 - m_Name: Directional Light - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!108 &1777449239 -Light: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1777449238} - m_Enabled: 1 - serializedVersion: 10 - m_Type: 1 - m_Shape: 0 - m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} - m_Intensity: 1 - m_Range: 10 - m_SpotAngle: 30 - m_InnerSpotAngle: 21.80208 - m_CookieSize: 10 - m_Shadows: - m_Type: 2 - m_Resolution: -1 - m_CustomResolution: -1 - m_Strength: 1 - m_Bias: 0.02 - m_NormalBias: 0.1 - m_NearPlane: 0.1 - m_CullingMatrixOverride: - e00: 1 - e01: 0 - e02: 0 - e03: 0 - e10: 0 - e11: 1 - e12: 0 - e13: 0 - e20: 0 - e21: 0 - e22: 1 - e23: 0 - e30: 0 - e31: 0 - e32: 0 - e33: 1 - m_UseCullingMatrixOverride: 0 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingLayerMask: 1 - m_Lightmapping: 4 - m_LightShadowCasterMode: 0 - m_AreaSize: {x: 1, y: 1} - m_BounceIntensity: 1 - m_ColorTemperature: 6570 - m_UseColorTemperature: 0 - m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} - m_UseBoundingSphereOverride: 0 - m_UseViewFrustumForShadowCasterCull: 1 - m_ShadowRadius: 0 - m_ShadowAngle: 0 ---- !u!4 &1777449240 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1777449238} - m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} - m_LocalPosition: {x: 0, y: 3, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} diff --git a/Assets/Materials/Skybox_Mat.mat b/Assets/Materials/Skybox_Mat.mat deleted file mode 100644 index ba73d5da5..000000000 --- a/Assets/Materials/Skybox_Mat.mat +++ /dev/null @@ -1,89 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: Skybox_Mat - m_Shader: {fileID: 106, guid: 0000000000000000f000000000000000, type: 0} - m_ShaderKeywords: _METALLIC_SETUP _SUNDISK_HIGH_QUALITY - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BumpMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _SpecGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - _AtmosphereThickness: 0.53 - - _BumpScale: 1 - - _Cutoff: 0.5 - - _DetailNormalMapScale: 1 - - _DstBlend: 0 - - _Exposure: 1.25 - - _GlossMapScale: 1 - - _Glossiness: 0.5 - - _GlossyReflections: 1 - - _Metallic: 0 - - _Mode: 0 - - _OcclusionStrength: 1 - - _Parallax: 0.02 - - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 1 - - _SrcBlend: 1 - - _SunDisk: 2 - - _SunSize: 0.04 - - _SunSizeConvergence: 5 - - _UVSec: 0 - - _WorkflowMode: 1 - - _ZWrite: 1 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - - _GroundColor: {r: 0.6392157, g: 0.6901961, b: 0.7411765, a: 1} - - _SkyTint: {r: 1, g: 1, b: 1, a: 1} - - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} diff --git a/Assets/Materials/Skybox_Mat.mat.meta b/Assets/Materials/Skybox_Mat.mat.meta deleted file mode 100644 index facef4afe..000000000 --- a/Assets/Materials/Skybox_Mat.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0ffaa0b7117ba8c47a9d05ae701d4b4d -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Presets/AudioCompressedInMemory.preset b/Assets/Presets/AudioCompressedInMemory.preset deleted file mode 100644 index 4ca91acf3..000000000 --- a/Assets/Presets/AudioCompressedInMemory.preset +++ /dev/null @@ -1,137 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!181963792 &2655988077585873504 -Preset: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: AudioCompressedInMemory - m_TargetType: - m_NativeTypeID: 1020 - m_ManagedTypePPtr: {fileID: 0} - m_ManagedTypeFallback: - m_Properties: - - target: {fileID: 0} - propertyPath: m_ExternalObjects.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.loadType - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.sampleRateSetting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.sampleRateOverride - value: 44100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.compressionFormat - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.quality - value: 0.7 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.conversionMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.size - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].first - value: 4 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.loadType - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.sampleRateSetting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.sampleRateOverride - value: 44100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.compressionFormat - value: 3 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.quality - value: 0.7 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.conversionMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].first - value: 7 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.loadType - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.sampleRateSetting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.sampleRateOverride - value: 44100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.compressionFormat - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.quality - value: 0.7 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.conversionMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ForceToMono - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Normalize - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PreloadAudioData - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_LoadInBackground - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Ambisonic - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_3D - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_UserData - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AssetBundleName - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AssetBundleVariant - value: - objectReference: {fileID: 0} diff --git a/Assets/Presets/AudioCompressedInMemory.preset.meta b/Assets/Presets/AudioCompressedInMemory.preset.meta deleted file mode 100644 index cd0d5633d..000000000 --- a/Assets/Presets/AudioCompressedInMemory.preset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 2dd802e4d37c65149922028d3e973832 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Presets/AudioStreaming.preset b/Assets/Presets/AudioStreaming.preset deleted file mode 100644 index 8499ed8c6..000000000 --- a/Assets/Presets/AudioStreaming.preset +++ /dev/null @@ -1,137 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!181963792 &2655988077585873504 -Preset: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: AudioStreaming - m_TargetType: - m_NativeTypeID: 1020 - m_ManagedTypePPtr: {fileID: 0} - m_ManagedTypeFallback: - m_Properties: - - target: {fileID: 0} - propertyPath: m_ExternalObjects.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.loadType - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.sampleRateSetting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.sampleRateOverride - value: 44100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.compressionFormat - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.quality - value: 0.7 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.conversionMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.size - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].first - value: 4 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.loadType - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.sampleRateSetting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.sampleRateOverride - value: 44100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.compressionFormat - value: 3 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.quality - value: 0.7 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.conversionMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].first - value: 7 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.loadType - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.sampleRateSetting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.sampleRateOverride - value: 44100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.compressionFormat - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.quality - value: 0.7 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.conversionMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ForceToMono - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Normalize - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PreloadAudioData - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_LoadInBackground - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Ambisonic - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_3D - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_UserData - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AssetBundleName - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AssetBundleVariant - value: - objectReference: {fileID: 0} diff --git a/Assets/Presets/AudioStreaming.preset.meta b/Assets/Presets/AudioStreaming.preset.meta deleted file mode 100644 index b7b811802..000000000 --- a/Assets/Presets/AudioStreaming.preset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 86bcce7f5575b54408aa0f3a7d321039 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 2655988077585873504 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Presets/Defaults/AlbedoTexture_Default.preset b/Assets/Presets/Defaults/AlbedoTexture_Default.preset deleted file mode 100644 index 6137100f1..000000000 --- a/Assets/Presets/Defaults/AlbedoTexture_Default.preset +++ /dev/null @@ -1,497 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!181963792 &2655988077585873504 -Preset: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: AlbedoTexture_Default - m_TargetType: - m_NativeTypeID: 1006 - m_ManagedTypePPtr: {fileID: 0} - m_ManagedTypeFallback: - m_Properties: - - target: {fileID: 0} - propertyPath: m_FileIDToRecycleName.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ExternalObjects.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_EnableMipMap - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_sRGBTexture - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_LinearTexture - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_FadeOut - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_BorderMipMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapsPreserveCoverage - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AlphaTestReferenceValue - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapFadeDistanceStart - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapFadeDistanceEnd - value: 3 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ConvertToNormalMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ExternalNormalMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_HeightScale - value: 0.25 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_NormalMapFilter - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_IsReadable - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_StreamingMipmaps - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_StreamingMipmapsPriority - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_GrayScaleToAlpha - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_GenerateCubemap - value: 6 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_CubemapConvolution - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SeamlessCubemap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureFormat - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MaxTextureSize - value: 2048 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_FilterMode - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_Aniso - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_MipBias - value: -100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_WrapU - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_WrapV - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_WrapW - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_NPOTScale - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Lightmap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteExtrude - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteMeshType - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Alignment - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePixelsToUnits - value: 100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.w - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteGenerateFallbackPhysicsShape - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AlphaUsage - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AlphaIsTransparency - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteTessellationDetail - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureType - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureShape - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SingleChannelComponent - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MaxTextureSizeSet - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_CompressionQualitySet - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureFormatSet - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.size - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_BuildTarget - value: DefaultTexturePlatform - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_MaxTextureSize - value: 8192 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_TextureCompression - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_BuildTarget - value: Standalone - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_MaxTextureSize - value: 8192 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_TextureCompression - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_BuildTarget - value: iPhone - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_MaxTextureSize - value: 8192 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_TextureCompression - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_BuildTarget - value: Android - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_MaxTextureSize - value: 8192 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_TextureCompression - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_BuildTarget - value: Windows Store Apps - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_MaxTextureSize - value: 8192 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_TextureCompression - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Sprites.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Outline.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_PhysicsShape.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Bones.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_SpriteID - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Vertices.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Indices.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Edges.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Weights.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePackingTag - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PSDRemoveMatte - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PSDShowRemoveMatteOption - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_UserData - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AssetBundleName - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AssetBundleVariant - value: - objectReference: {fileID: 0} diff --git a/Assets/Presets/Defaults/AlbedoTexture_Default.preset.meta b/Assets/Presets/Defaults/AlbedoTexture_Default.preset.meta deleted file mode 100644 index 2e7fd878e..000000000 --- a/Assets/Presets/Defaults/AlbedoTexture_Default.preset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e8537455c6c08bd4e8bf0be3707da685 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 2655988077585873504 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Presets/Defaults/AudioDecompressOnLoad.preset b/Assets/Presets/Defaults/AudioDecompressOnLoad.preset deleted file mode 100644 index dd415f614..000000000 --- a/Assets/Presets/Defaults/AudioDecompressOnLoad.preset +++ /dev/null @@ -1,137 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!181963792 &2655988077585873504 -Preset: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: AudioDecompressOnLoad - m_TargetType: - m_NativeTypeID: 1020 - m_ManagedTypePPtr: {fileID: 0} - m_ManagedTypeFallback: - m_Properties: - - target: {fileID: 0} - propertyPath: m_ExternalObjects.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.loadType - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.sampleRateSetting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.sampleRateOverride - value: 44100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.compressionFormat - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.quality - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DefaultSettings.conversionMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.size - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].first - value: 4 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.loadType - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.sampleRateSetting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.sampleRateOverride - value: 44100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.compressionFormat - value: 3 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.quality - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[0].second.conversionMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].first - value: 7 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.loadType - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.sampleRateSetting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.sampleRateOverride - value: 44100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.compressionFormat - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.quality - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettingOverrides.Array.data[1].second.conversionMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ForceToMono - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Normalize - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PreloadAudioData - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_LoadInBackground - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Ambisonic - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_3D - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_UserData - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AssetBundleName - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AssetBundleVariant - value: - objectReference: {fileID: 0} diff --git a/Assets/Presets/Defaults/AudioDecompressOnLoad.preset.meta b/Assets/Presets/Defaults/AudioDecompressOnLoad.preset.meta deleted file mode 100644 index 8e3dd0256..000000000 --- a/Assets/Presets/Defaults/AudioDecompressOnLoad.preset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e7689051185d12f4298e1ebb2693a29f -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Presets/Defaults/DirectionalLight_Default.preset b/Assets/Presets/Defaults/DirectionalLight_Default.preset deleted file mode 100644 index 24034e46d..000000000 --- a/Assets/Presets/Defaults/DirectionalLight_Default.preset +++ /dev/null @@ -1,137 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!181963792 &2655988077585873504 -Preset: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: DirectionalLight_Default - m_TargetType: - m_NativeTypeID: 108 - m_ManagedTypePPtr: {fileID: 0} - m_ManagedTypeFallback: - m_Properties: - - target: {fileID: 0} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Type - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Color.r - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Color.g - value: 0.95686275 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Color.b - value: 0.8392157 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Color.a - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Intensity - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Range - value: 10 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpotAngle - value: 30 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_CookieSize - value: 10 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Shadows.m_Type - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Shadows.m_Resolution - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Shadows.m_CustomResolution - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Shadows.m_Strength - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Shadows.m_Bias - value: 0.02 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Shadows.m_NormalBias - value: 0.1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Shadows.m_NearPlane - value: 0.1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Cookie - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_DrawHalo - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Flare - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_RenderMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_CullingMask.m_Bits - value: 4294967295 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Lightmapping - value: 4 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_LightShadowCasterMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AreaSize.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AreaSize.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_BounceIntensity - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ColorTemperature - value: 6570 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_UseColorTemperature - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ShadowRadius - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ShadowAngle - value: 0 - objectReference: {fileID: 0} diff --git a/Assets/Presets/Defaults/DirectionalLight_Default.preset.meta b/Assets/Presets/Defaults/DirectionalLight_Default.preset.meta deleted file mode 100644 index ac83bf91c..000000000 --- a/Assets/Presets/Defaults/DirectionalLight_Default.preset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 463065d4f17d1d94d848aa127b94dd43 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 2655988077585873504 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Presets/NormalTexture.preset b/Assets/Presets/NormalTexture.preset deleted file mode 100644 index c6a771f40..000000000 --- a/Assets/Presets/NormalTexture.preset +++ /dev/null @@ -1,497 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!181963792 &2655988077585873504 -Preset: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: NormalTexture - m_TargetType: - m_NativeTypeID: 1006 - m_ManagedTypePPtr: {fileID: 0} - m_ManagedTypeFallback: - m_Properties: - - target: {fileID: 0} - propertyPath: m_FileIDToRecycleName.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ExternalObjects.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_EnableMipMap - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_sRGBTexture - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_LinearTexture - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_FadeOut - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_BorderMipMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapsPreserveCoverage - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AlphaTestReferenceValue - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapFadeDistanceStart - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapFadeDistanceEnd - value: 3 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ConvertToNormalMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ExternalNormalMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_HeightScale - value: 0.25 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_NormalMapFilter - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_IsReadable - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_StreamingMipmaps - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_StreamingMipmapsPriority - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_GrayScaleToAlpha - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_GenerateCubemap - value: 6 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_CubemapConvolution - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SeamlessCubemap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureFormat - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MaxTextureSize - value: 2048 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_FilterMode - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_Aniso - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_MipBias - value: -100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_WrapU - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_WrapV - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_WrapW - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_NPOTScale - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Lightmap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteExtrude - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteMeshType - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Alignment - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePixelsToUnits - value: 100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.w - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteGenerateFallbackPhysicsShape - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AlphaUsage - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AlphaIsTransparency - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteTessellationDetail - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureType - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureShape - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SingleChannelComponent - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MaxTextureSizeSet - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_CompressionQualitySet - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureFormatSet - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.size - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_BuildTarget - value: DefaultTexturePlatform - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_MaxTextureSize - value: 8192 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_TextureCompression - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_BuildTarget - value: Standalone - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_MaxTextureSize - value: 8192 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_TextureCompression - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_BuildTarget - value: iPhone - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_MaxTextureSize - value: 8192 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_TextureCompression - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_BuildTarget - value: Android - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_MaxTextureSize - value: 8192 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_TextureCompression - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_BuildTarget - value: Windows Store Apps - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_MaxTextureSize - value: 8192 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_TextureCompression - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Sprites.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Outline.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_PhysicsShape.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Bones.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_SpriteID - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Vertices.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Indices.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Edges.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Weights.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePackingTag - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PSDRemoveMatte - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PSDShowRemoveMatteOption - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_UserData - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AssetBundleName - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AssetBundleVariant - value: - objectReference: {fileID: 0} diff --git a/Assets/Presets/NormalTexture.preset.meta b/Assets/Presets/NormalTexture.preset.meta deleted file mode 100644 index 33fcecf55..000000000 --- a/Assets/Presets/NormalTexture.preset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 14a57cf3b9fa1c74b884aa7e0dcf1faa -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 2655988077585873504 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Presets/UtilityTexture.preset b/Assets/Presets/UtilityTexture.preset deleted file mode 100644 index 6b879d82c..000000000 --- a/Assets/Presets/UtilityTexture.preset +++ /dev/null @@ -1,497 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!181963792 &2655988077585873504 -Preset: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: UtilityTexture - m_TargetType: - m_NativeTypeID: 1006 - m_ManagedTypePPtr: {fileID: 0} - m_ManagedTypeFallback: - m_Properties: - - target: {fileID: 0} - propertyPath: m_FileIDToRecycleName.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ExternalObjects.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_EnableMipMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_sRGBTexture - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_LinearTexture - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_FadeOut - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_BorderMipMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapsPreserveCoverage - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AlphaTestReferenceValue - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapFadeDistanceStart - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapFadeDistanceEnd - value: 3 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ConvertToNormalMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ExternalNormalMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_HeightScale - value: 0.25 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_NormalMapFilter - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_IsReadable - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_StreamingMipmaps - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_StreamingMipmapsPriority - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_GrayScaleToAlpha - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_GenerateCubemap - value: 6 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_CubemapConvolution - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SeamlessCubemap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureFormat - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MaxTextureSize - value: 2048 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_FilterMode - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_Aniso - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_MipBias - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_WrapU - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_WrapV - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_WrapW - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_NPOTScale - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Lightmap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteExtrude - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteMeshType - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Alignment - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePixelsToUnits - value: 100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.w - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteGenerateFallbackPhysicsShape - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AlphaUsage - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AlphaIsTransparency - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteTessellationDetail - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureType - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureShape - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SingleChannelComponent - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MaxTextureSizeSet - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_CompressionQualitySet - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureFormatSet - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.size - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_BuildTarget - value: DefaultTexturePlatform - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_MaxTextureSize - value: 8192 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_TextureCompression - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_BuildTarget - value: Standalone - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_MaxTextureSize - value: 8192 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_TextureCompression - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_BuildTarget - value: iPhone - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_MaxTextureSize - value: 8192 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_TextureCompression - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[2].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_BuildTarget - value: Android - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_MaxTextureSize - value: 8192 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_TextureCompression - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[3].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_BuildTarget - value: Windows Store Apps - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_MaxTextureSize - value: 8192 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_TextureCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[4].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Sprites.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Outline.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_PhysicsShape.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Bones.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_SpriteID - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Vertices.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Indices.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Edges.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Weights.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePackingTag - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PSDRemoveMatte - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PSDShowRemoveMatteOption - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_UserData - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AssetBundleName - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AssetBundleVariant - value: - objectReference: {fileID: 0} diff --git a/Assets/Presets/UtilityTexture.preset.meta b/Assets/Presets/UtilityTexture.preset.meta deleted file mode 100644 index a11d2e93d..000000000 --- a/Assets/Presets/UtilityTexture.preset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 45f7b2e3c78185248b3adbb14429c2ab -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 2655988077585873504 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Settings/ForwardRenderer.asset b/Assets/Settings/ForwardRenderer.asset deleted file mode 100644 index 4514a2b8a..000000000 --- a/Assets/Settings/ForwardRenderer.asset +++ /dev/null @@ -1,36 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} - m_Name: ForwardRenderer - m_EditorClassIdentifier: - m_RendererFeatures: [] - postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} - shaders: - blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3} - copyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3} - screenSpaceShadowPS: {fileID: 4800000, guid: 0f854b35a0cf61a429bd5dcfea30eddd, - type: 3} - samplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3} - fallbackErrorPS: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3} - m_OpaqueLayerMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_TransparentLayerMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_DefaultStencilState: - overrideStencilState: 0 - stencilReference: 0 - stencilCompareFunction: 8 - passOperation: 0 - failOperation: 0 - zFailOperation: 0 diff --git a/Assets/Settings/ForwardRenderer.asset.meta b/Assets/Settings/ForwardRenderer.asset.meta deleted file mode 100644 index 06d9cabc2..000000000 --- a/Assets/Settings/ForwardRenderer.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4a8e21d5c33334b11b34a596161b9360 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Settings/SampleSceneProfile.asset b/Assets/Settings/SampleSceneProfile.asset deleted file mode 100644 index cbc629b5c..000000000 --- a/Assets/Settings/SampleSceneProfile.asset +++ /dev/null @@ -1,118 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &-7893295128165547882 -MonoBehaviour: - m_ObjectHideFlags: 3 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0b2db86121404754db890f4c8dfe81b2, type: 3} - m_Name: Bloom - m_EditorClassIdentifier: - active: 1 - m_AdvancedMode: 0 - threshold: - m_OverrideState: 1 - m_Value: 1 - min: 0 - intensity: - m_OverrideState: 1 - m_Value: 1 - min: 0 - scatter: - m_OverrideState: 0 - m_Value: 0.7 - min: 0 - max: 1 - clamp: - m_OverrideState: 0 - m_Value: 65472 - min: 0 - tint: - m_OverrideState: 0 - m_Value: {r: 1, g: 1, b: 1, a: 1} - hdr: 0 - showAlpha: 0 - showEyeDropper: 1 - highQualityFiltering: - m_OverrideState: 0 - m_Value: 0 - dirtTexture: - m_OverrideState: 0 - m_Value: {fileID: 0} - dirtIntensity: - m_OverrideState: 0 - m_Value: 0 - min: 0 ---- !u!114 &-7011558710299706105 -MonoBehaviour: - m_ObjectHideFlags: 3 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 899c54efeace73346a0a16faa3afe726, type: 3} - m_Name: Vignette - m_EditorClassIdentifier: - active: 1 - m_AdvancedMode: 0 - color: - m_OverrideState: 0 - m_Value: {r: 0, g: 0, b: 0, a: 1} - hdr: 0 - showAlpha: 0 - showEyeDropper: 1 - center: - m_OverrideState: 0 - m_Value: {x: 0.5, y: 0.5} - intensity: - m_OverrideState: 1 - m_Value: 0.25 - min: 0 - max: 1 - smoothness: - m_OverrideState: 1 - m_Value: 0.4 - min: 0.01 - max: 1 - rounded: - m_OverrideState: 0 - m_Value: 0 ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3} - m_Name: SampleSceneProfile - m_EditorClassIdentifier: - components: - - {fileID: 849379129802519247} - - {fileID: -7893295128165547882} - - {fileID: -7011558710299706105} ---- !u!114 &849379129802519247 -MonoBehaviour: - m_ObjectHideFlags: 3 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 97c23e3b12dc18c42a140437e53d3951, type: 3} - m_Name: Tonemapping - m_EditorClassIdentifier: - active: 1 - m_AdvancedMode: 0 - mode: - m_OverrideState: 1 - m_Value: 2 diff --git a/Assets/Settings/SampleSceneProfile.asset.meta b/Assets/Settings/SampleSceneProfile.asset.meta deleted file mode 100644 index b82270c5b..000000000 --- a/Assets/Settings/SampleSceneProfile.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 10fc4df2da32a41aaa32d77bc913491c -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Settings/UniversalRP-HighQuality.asset b/Assets/Settings/UniversalRP-HighQuality.asset deleted file mode 100644 index 2ac23c8bc..000000000 --- a/Assets/Settings/UniversalRP-HighQuality.asset +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3} - m_Name: UniversalRP-HighQuality - m_EditorClassIdentifier: - k_AssetVersion: 5 - k_AssetPreviousVersion: 5 - m_RendererType: 1 - m_RendererData: {fileID: 0} - m_RendererDataList: - - {fileID: 11400000, guid: 4a8e21d5c33334b11b34a596161b9360, type: 2} - m_DefaultRendererIndex: 0 - m_RequireDepthTexture: 0 - m_RequireOpaqueTexture: 0 - m_OpaqueDownsampling: 1 - m_SupportsHDR: 1 - m_MSAA: 2 - m_RenderScale: 1 - m_MainLightRenderingMode: 1 - m_MainLightShadowsSupported: 1 - m_MainLightShadowmapResolution: 2048 - m_AdditionalLightsRenderingMode: 1 - m_AdditionalLightsPerObjectLimit: 4 - m_AdditionalLightShadowsSupported: 1 - m_AdditionalLightsShadowmapResolution: 512 - m_ShadowDistance: 50 - m_ShadowCascades: 1 - m_Cascade2Split: 0.25 - m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467} - m_ShadowDepthBias: 1 - m_ShadowNormalBias: 1 - m_SoftShadowsSupported: 1 - m_UseSRPBatcher: 1 - m_SupportsDynamicBatching: 0 - m_MixedLightingSupported: 1 - m_DebugLevel: 0 - m_ColorGradingMode: 0 - m_ColorGradingLutSize: 32 - m_ShadowType: 1 - m_LocalShadowsSupported: 0 - m_LocalShadowsAtlasResolution: 256 - m_MaxPixelLights: 0 - m_ShadowAtlasResolution: 256 - m_ShaderVariantLogLevel: 0 diff --git a/Assets/Settings/UniversalRP-HighQuality.asset.meta b/Assets/Settings/UniversalRP-HighQuality.asset.meta deleted file mode 100644 index c8fa31758..000000000 --- a/Assets/Settings/UniversalRP-HighQuality.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 19ba41d7c0026c3459d37c2fe90c55a0 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Settings/UniversalRP-LowQuality.asset b/Assets/Settings/UniversalRP-LowQuality.asset deleted file mode 100644 index ab81d03f0..000000000 --- a/Assets/Settings/UniversalRP-LowQuality.asset +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3} - m_Name: UniversalRP-LowQuality - m_EditorClassIdentifier: - k_AssetVersion: 5 - k_AssetPreviousVersion: 5 - m_RendererType: 1 - m_RendererData: {fileID: 0} - m_RendererDataList: - - {fileID: 11400000, guid: 4a8e21d5c33334b11b34a596161b9360, type: 2} - m_DefaultRendererIndex: 0 - m_RequireDepthTexture: 0 - m_RequireOpaqueTexture: 0 - m_OpaqueDownsampling: 1 - m_SupportsHDR: 0 - m_MSAA: 1 - m_RenderScale: 1 - m_MainLightRenderingMode: 1 - m_MainLightShadowsSupported: 0 - m_MainLightShadowmapResolution: 2048 - m_AdditionalLightsRenderingMode: 0 - m_AdditionalLightsPerObjectLimit: 4 - m_AdditionalLightShadowsSupported: 0 - m_AdditionalLightsShadowmapResolution: 512 - m_ShadowDistance: 50 - m_ShadowCascades: 0 - m_Cascade2Split: 0.25 - m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467} - m_ShadowDepthBias: 1 - m_ShadowNormalBias: 1 - m_SoftShadowsSupported: 0 - m_UseSRPBatcher: 1 - m_SupportsDynamicBatching: 0 - m_MixedLightingSupported: 1 - m_DebugLevel: 0 - m_ColorGradingMode: 0 - m_ColorGradingLutSize: 16 - m_ShadowType: 1 - m_LocalShadowsSupported: 0 - m_LocalShadowsAtlasResolution: 256 - m_MaxPixelLights: 0 - m_ShadowAtlasResolution: 256 - m_ShaderVariantLogLevel: 0 diff --git a/Assets/Settings/UniversalRP-LowQuality.asset.meta b/Assets/Settings/UniversalRP-LowQuality.asset.meta deleted file mode 100644 index 040da39e5..000000000 --- a/Assets/Settings/UniversalRP-LowQuality.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a31e9f9f9c9d4b9429ed0d1234e22103 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Settings/UniversalRP-MediumQuality.asset b/Assets/Settings/UniversalRP-MediumQuality.asset deleted file mode 100644 index 23de11bf0..000000000 --- a/Assets/Settings/UniversalRP-MediumQuality.asset +++ /dev/null @@ -1,53 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3} - m_Name: UniversalRP-MediumQuality - m_EditorClassIdentifier: - k_AssetVersion: 5 - k_AssetPreviousVersion: 5 - m_RendererType: 1 - m_RendererData: {fileID: 0} - m_RendererDataList: - - {fileID: 11400000, guid: 4a8e21d5c33334b11b34a596161b9360, type: 2} - m_DefaultRendererIndex: 0 - m_RequireDepthTexture: 0 - m_RequireOpaqueTexture: 0 - m_OpaqueDownsampling: 1 - m_SupportsHDR: 0 - m_MSAA: 1 - m_RenderScale: 1 - m_MainLightRenderingMode: 1 - m_MainLightShadowsSupported: 1 - m_MainLightShadowmapResolution: 2048 - m_AdditionalLightsRenderingMode: 1 - m_AdditionalLightsPerObjectLimit: 4 - m_AdditionalLightShadowsSupported: 0 - m_AdditionalLightsShadowmapResolution: 512 - m_ShadowDistance: 50 - m_ShadowCascades: 0 - m_Cascade2Split: 0.25 - m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467} - m_ShadowDepthBias: 1 - m_ShadowNormalBias: 1 - m_SoftShadowsSupported: 0 - m_UseSRPBatcher: 1 - m_SupportsDynamicBatching: 0 - m_MixedLightingSupported: 1 - m_DebugLevel: 0 - m_ColorGradingMode: 0 - m_ColorGradingLutSize: 32 - m_ShadowType: 1 - m_LocalShadowsSupported: 0 - m_LocalShadowsAtlasResolution: 256 - m_MaxPixelLights: 0 - m_ShadowAtlasResolution: 256 - m_ShaderVariantLogLevel: 0 diff --git a/Assets/Settings/UniversalRP-MediumQuality.asset.meta b/Assets/Settings/UniversalRP-MediumQuality.asset.meta deleted file mode 100644 index d8477b754..000000000 --- a/Assets/Settings/UniversalRP-MediumQuality.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d847b876476d3d6468f5dfcd34266f96 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages.meta b/Assets/SpacetimeDB/Packages.meta deleted file mode 100644 index 223280800..000000000 --- a/Assets/SpacetimeDB/Packages.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 086bf95e1033970ad9bf698d2215ebac -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9.meta b/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9.meta deleted file mode 100644 index 72c8721dd..000000000 --- a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 345dd82d825150bb68d5624d1e1392ce -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/Google.Protobuf.3.21.9.nupkg b/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/Google.Protobuf.3.21.9.nupkg deleted file mode 100644 index 1758cdd1b..000000000 Binary files a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/Google.Protobuf.3.21.9.nupkg and /dev/null differ diff --git a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib/net45.meta b/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib/net45.meta deleted file mode 100644 index 5e20f5838..000000000 --- a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib/net45.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 385903b30e115d7a58617f6f0fdb6dad -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib/net45/Google.Protobuf.dll b/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib/net45/Google.Protobuf.dll deleted file mode 100644 index f73a17baa..000000000 Binary files a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib/net45/Google.Protobuf.dll and /dev/null differ diff --git a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib/net45/Google.Protobuf.xml b/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib/net45/Google.Protobuf.xml deleted file mode 100644 index 4d6183a63..000000000 --- a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib/net45/Google.Protobuf.xml +++ /dev/null @@ -1,10465 +0,0 @@ - - - - Google.Protobuf - - - - - Provides a utility routine to copy small arrays much more quickly than Buffer.BlockCopy - - - - - The threshold above which you should use Buffer.BlockCopy rather than ByteArray.Copy - - - - - Determines which copy routine to use based on the number of bytes to be copied. - - - - - Reverses the order of bytes in the array - - - - - Immutable array of bytes. - - - - - Internal use only. Ensure that the provided memory is not mutated and belongs to this instance. - - - - - Internal use only. Ensure that the provided memory is not mutated and belongs to this instance. - This method encapsulates converting array to memory. Reduces need for SecuritySafeCritical - in .NET Framework. - - - - - Constructs a new ByteString from the given memory. The memory is - *not* copied, and must not be modified after this constructor is called. - - - - - Returns an empty ByteString. - - - - - Returns the length of this ByteString in bytes. - - - - - Returns true if this byte string is empty, false otherwise. - - - - - Provides read-only access to the data of this . - No data is copied so this is the most efficient way of accessing. - - - - - Provides read-only access to the data of this . - No data is copied so this is the most efficient way of accessing. - - - - - Converts this into a byte array. - - The data is copied - changes to the returned array will not be reflected in this ByteString. - A byte array with the same data as this ByteString. - - - - Converts this into a standard base64 representation. - - A base64 representation of this ByteString. - - - - Constructs a from the Base64 Encoded String. - - - - - Constructs a from data in the given stream, synchronously. - - If successful, will be read completely, from the position - at the start of the call. - The stream to copy into a ByteString. - A ByteString with content read from the given stream. - - - - Constructs a from data in the given stream, asynchronously. - - If successful, will be read completely, from the position - at the start of the call. - The stream to copy into a ByteString. - The cancellation token to use when reading from the stream, if any. - A ByteString with content read from the given stream. - - - - Constructs a from the given array. The contents - are copied, so further modifications to the array will not - be reflected in the returned ByteString. - This method can also be invoked in ByteString.CopyFrom(0xaa, 0xbb, ...) form - which is primarily useful for testing. - - - - - Constructs a from a portion of a byte array. - - - - - Constructs a from a read only span. The contents - are copied, so further modifications to the span will not - be reflected in the returned . - - - - - Creates a new by encoding the specified text with - the given encoding. - - - - - Creates a new by encoding the specified text in UTF-8. - - - - - Returns the byte at the given index. - - - - - Converts this into a string by applying the given encoding. - - - This method should only be used to convert binary data which was the result of encoding - text with the given encoding. - - The encoding to use to decode the binary data into text. - The result of decoding the binary data with the given decoding. - - - - Converts this into a string by applying the UTF-8 encoding. - - - This method should only be used to convert binary data which was the result of encoding - text with UTF-8. - - The result of decoding the binary data with the given decoding. - - - - Returns an iterator over the bytes in this . - - An iterator over the bytes in this object. - - - - Returns an iterator over the bytes in this . - - An iterator over the bytes in this object. - - - - Creates a CodedInputStream from this ByteString's data. - - - - - Compares two byte strings for equality. - - The first byte string to compare. - The second byte string to compare. - true if the byte strings are equal; false otherwise. - - - - Compares two byte strings for inequality. - - The first byte string to compare. - The second byte string to compare. - false if the byte strings are equal; true otherwise. - - - - Compares this byte string with another object. - - The object to compare this with. - true if refers to an equal ; false otherwise. - - - - Returns a hash code for this object. Two equal byte strings - will return the same hash code. - - A hash code for this object. - - - - Compares this byte string with another. - - The to compare this with. - true if refers to an equal byte string; false otherwise. - - - - Copies the entire byte array to the destination array provided at the offset specified. - - - - - Writes the entire byte array to the provided stream - - - - - SecuritySafeCritical attribute can not be placed on types with async methods. - This class has ByteString's async methods so it can be marked with SecuritySafeCritical. - - - - - Reads and decodes protocol message fields. - - - - This class is generally used by generated code to read appropriate - primitives from the stream. It effectively encapsulates the lowest - levels of protocol buffer format. - - - Repeated fields and map fields are not handled by this class; use - and to serialize such fields. - - - - - - Whether to leave the underlying stream open when disposing of this stream. - This is always true when there's no stream. - - - - - Buffer of data read from the stream or provided at construction time. - - - - - The stream to read further input from, or null if the byte array buffer was provided - directly on construction, with no further data available. - - - - - The parser state is kept separately so that other parse implementations can reuse the same - parsing primitives. - - - - - Creates a new CodedInputStream reading data from the given byte array. - - - - - Creates a new that reads from the given byte array slice. - - - - - Creates a new reading data from the given stream, which will be disposed - when the returned object is disposed. - - The stream to read from. - - - - Creates a new reading data from the given stream. - - The stream to read from. - true to leave open when the returned - is disposed; false to dispose of the given stream when the - returned object is disposed. - - - - Creates a new CodedInputStream reading data from the given - stream and buffer, using the default limits. - - - - - Creates a new CodedInputStream reading data from the given - stream and buffer, using the specified limits. - - - This chains to the version with the default limits instead of vice versa to avoid - having to check that the default values are valid every time. - - - - - Creates a with the specified size and recursion limits, reading - from an input stream. - - - This method exists separately from the constructor to reduce the number of constructor overloads. - It is likely to be used considerably less frequently than the constructors, as the default limits - are suitable for most use cases. - - The input stream to read from - The total limit of data to read from the stream. - The maximum recursion depth to allow while reading. - A CodedInputStream reading from with the specified size - and recursion limits. - - - - Returns the current position in the input stream, or the position in the input buffer - - - - - Returns the last tag read, or 0 if no tags have been read or we've read beyond - the end of the stream. - - - - - Returns the size limit for this stream. - - - This limit is applied when reading from the underlying stream, as a sanity check. It is - not applied when reading from a byte array data source without an underlying stream. - The default value is Int32.MaxValue. - - - The size limit. - - - - - Returns the recursion limit for this stream. This limit is applied whilst reading messages, - to avoid maliciously-recursive data. - - - The default limit is 100. - - - The recursion limit for this stream. - - - - - Internal-only property; when set to true, unknown fields will be discarded while parsing. - - - - - Internal-only property; provides extension identifiers to compatible messages while parsing. - - - - - Disposes of this instance, potentially closing any underlying stream. - - - As there is no flushing to perform here, disposing of a which - was constructed with the leaveOpen option parameter set to true (or one which - was constructed to read from a byte array) has no effect. - - - - - Verifies that the last call to ReadTag() returned tag 0 - in other words, - we've reached the end of the stream when we expected to. - - The - tag read was not the one specified - - - - Peeks at the next field tag. This is like calling , but the - tag is not consumed. (So a subsequent call to will return the - same value.) - - - - - Reads a field tag, returning the tag of 0 for "end of stream". - - - If this method returns 0, it doesn't necessarily mean the end of all - the data in this CodedInputStream; it may be the end of the logical stream - for an embedded message, for example. - - The next field tag, or 0 for end of stream. (0 is never a valid tag.) - - - - Skips the data for the field with the tag we've just read. - This should be called directly after , when - the caller wishes to skip an unknown field. - - - This method throws if the last-read tag was an end-group tag. - If a caller wishes to skip a group, they should skip the whole group, by calling this method after reading the - start-group tag. This behavior allows callers to call this method on any field they don't understand, correctly - resulting in an error if an end-group tag has not been paired with an earlier start-group tag. - - The last tag was an end-group tag - The last read operation read to the end of the logical stream - - - - Skip a group. - - - - - Reads a double field from the stream. - - - - - Reads a float field from the stream. - - - - - Reads a uint64 field from the stream. - - - - - Reads an int64 field from the stream. - - - - - Reads an int32 field from the stream. - - - - - Reads a fixed64 field from the stream. - - - - - Reads a fixed32 field from the stream. - - - - - Reads a bool field from the stream. - - - - - Reads a string field from the stream. - - - - - Reads an embedded message field value from the stream. - - - - - Reads an embedded group field from the stream. - - - - - Reads a bytes field value from the stream. - - - - - Reads a uint32 field value from the stream. - - - - - Reads an enum field value from the stream. - - - - - Reads an sfixed32 field value from the stream. - - - - - Reads an sfixed64 field value from the stream. - - - - - Reads an sint32 field value from the stream. - - - - - Reads an sint64 field value from the stream. - - - - - Reads a length for length-delimited data. - - - This is internally just reading a varint, but this method exists - to make the calling code clearer. - - - - - Peeks at the next tag in the stream. If it matches , - the tag is consumed and the method returns true; otherwise, the - stream is left in the original position and the method returns false. - - - - - Reads a raw Varint from the stream. If larger than 32 bits, discard the upper bits. - This method is optimised for the case where we've got lots of data in the buffer. - That means we can check the size just once, then just read directly from the buffer - without constant rechecking of the buffer length. - - - - - Reads a varint from the input one byte at a time, so that it does not - read any bytes after the end of the varint. If you simply wrapped the - stream in a CodedInputStream and used ReadRawVarint32(Stream) - then you would probably end up reading past the end of the varint since - CodedInputStream buffers its input. - - - - - - - Reads a raw varint from the stream. - - - - - Reads a 32-bit little-endian integer from the stream. - - - - - Reads a 64-bit little-endian integer from the stream. - - - - - Sets currentLimit to (current position) + byteLimit. This is called - when descending into a length-delimited embedded message. The previous - limit is returned. - - The old limit. - - - - Discards the current limit, returning the previous limit. - - - - - Returns whether or not all the data before the limit has been read. - - - - - - Returns true if the stream has reached the end of the input. This is the - case if either the end of the underlying input source has been reached or - the stream has reached a limit created using PushLimit. - - - - - Called when buffer is empty to read more bytes from the - input. If is true, RefillBuffer() guarantees that - either there will be at least one byte in the buffer when it returns - or it will throw an exception. If is false, - RefillBuffer() returns false if no more bytes were available. - - - - - - - Reads a fixed size of bytes from the input. - - - the end of the stream or the current limit was reached - - - - - Reads a top-level message or a nested message after the limits for this message have been pushed. - (parser will proceed until the end of the current limit) - NOTE: this method needs to be public because it's invoked by the generated code - e.g. msg.MergeFrom(CodedInputStream input) method - - - - - Encodes and writes protocol message fields. - - - - This class is generally used by generated code to write appropriate - primitives to the stream. It effectively encapsulates the lowest - levels of protocol buffer format. Unlike some other implementations, - this does not include combined "write tag and value" methods. Generated - code knows the exact byte representations of the tags they're going to write, - so there's no need to re-encode them each time. Manually-written code calling - this class should just call one of the WriteTag overloads before each value. - - - Repeated fields and map fields are not handled by this class; use RepeatedField<T> - and MapField<TKey, TValue> to serialize such fields. - - - - - - Computes the number of bytes that would be needed to encode a - double field, including the tag. - - - - - Computes the number of bytes that would be needed to encode a - float field, including the tag. - - - - - Computes the number of bytes that would be needed to encode a - uint64 field, including the tag. - - - - - Computes the number of bytes that would be needed to encode an - int64 field, including the tag. - - - - - Computes the number of bytes that would be needed to encode an - int32 field, including the tag. - - - - - Computes the number of bytes that would be needed to encode a - fixed64 field, including the tag. - - - - - Computes the number of bytes that would be needed to encode a - fixed32 field, including the tag. - - - - - Computes the number of bytes that would be needed to encode a - bool field, including the tag. - - - - - Computes the number of bytes that would be needed to encode a - string field, including the tag. - - - - - Computes the number of bytes that would be needed to encode a - group field, including the tag. - - - - - Computes the number of bytes that would be needed to encode an - embedded message field, including the tag. - - - - - Computes the number of bytes that would be needed to encode a - bytes field, including the tag. - - - - - Computes the number of bytes that would be needed to encode a - uint32 field, including the tag. - - - - - Computes the number of bytes that would be needed to encode a - enum field, including the tag. The caller is responsible for - converting the enum value to its numeric value. - - - - - Computes the number of bytes that would be needed to encode an - sfixed32 field, including the tag. - - - - - Computes the number of bytes that would be needed to encode an - sfixed64 field, including the tag. - - - - - Computes the number of bytes that would be needed to encode an - sint32 field, including the tag. - - - - - Computes the number of bytes that would be needed to encode an - sint64 field, including the tag. - - - - - Computes the number of bytes that would be needed to encode a length, - as written by . - - - - - Computes the number of bytes that would be needed to encode a varint. - - - - - Computes the number of bytes that would be needed to encode a varint. - - - - - Computes the number of bytes that would be needed to encode a tag. - - - - - The buffer size used by CreateInstance(Stream). - - - - - Creates a new CodedOutputStream that writes directly to the given - byte array. If more bytes are written than fit in the array, - OutOfSpaceException will be thrown. - - - - - Creates a new CodedOutputStream that writes directly to the given - byte array slice. If more bytes are written than fit in the array, - OutOfSpaceException will be thrown. - - - - - Creates a new which write to the given stream, and disposes of that - stream when the returned CodedOutputStream is disposed. - - The stream to write to. It will be disposed when the returned CodedOutputStream is disposed. - - - - Creates a new CodedOutputStream which write to the given stream and uses - the specified buffer size. - - The stream to write to. It will be disposed when the returned CodedOutputStream is disposed. - The size of buffer to use internally. - - - - Creates a new CodedOutputStream which write to the given stream. - - The stream to write to. - If true, is left open when the returned CodedOutputStream is disposed; - if false, the provided stream is disposed as well. - - - - Creates a new CodedOutputStream which write to the given stream and uses - the specified buffer size. - - The stream to write to. - The size of buffer to use internally. - If true, is left open when the returned CodedOutputStream is disposed; - if false, the provided stream is disposed as well. - - - - Returns the current position in the stream, or the position in the output buffer - - - - - Writes a double field value, without a tag, to the stream. - - The value to write - - - - Writes a float field value, without a tag, to the stream. - - The value to write - - - - Writes a uint64 field value, without a tag, to the stream. - - The value to write - - - - Writes an int64 field value, without a tag, to the stream. - - The value to write - - - - Writes an int32 field value, without a tag, to the stream. - - The value to write - - - - Writes a fixed64 field value, without a tag, to the stream. - - The value to write - - - - Writes a fixed32 field value, without a tag, to the stream. - - The value to write - - - - Writes a bool field value, without a tag, to the stream. - - The value to write - - - - Writes a string field value, without a tag, to the stream. - The data is length-prefixed. - - The value to write - - - - Writes a message, without a tag, to the stream. - The data is length-prefixed. - - The value to write - - - - Writes a message, without a tag, to the stream. - Only the message data is written, without a length-delimiter. - - The value to write - - - - Writes a group, without a tag, to the stream. - - The value to write - - - - Write a byte string, without a tag, to the stream. - The data is length-prefixed. - - The value to write - - - - Writes a uint32 value, without a tag, to the stream. - - The value to write - - - - Writes an enum value, without a tag, to the stream. - - The value to write - - - - Writes an sfixed32 value, without a tag, to the stream. - - The value to write. - - - - Writes an sfixed64 value, without a tag, to the stream. - - The value to write - - - - Writes an sint32 value, without a tag, to the stream. - - The value to write - - - - Writes an sint64 value, without a tag, to the stream. - - The value to write - - - - Writes a length (in bytes) for length-delimited data. - - - This method simply writes a rawint, but exists for clarity in calling code. - - Length value, in bytes. - - - - Encodes and writes a tag. - - The number of the field to write the tag for - The wire format type of the tag to write - - - - Writes an already-encoded tag. - - The encoded tag - - - - Writes the given single-byte tag directly to the stream. - - The encoded tag - - - - Writes the given two-byte tag directly to the stream. - - The first byte of the encoded tag - The second byte of the encoded tag - - - - Writes the given three-byte tag directly to the stream. - - The first byte of the encoded tag - The second byte of the encoded tag - The third byte of the encoded tag - - - - Writes the given four-byte tag directly to the stream. - - The first byte of the encoded tag - The second byte of the encoded tag - The third byte of the encoded tag - The fourth byte of the encoded tag - - - - Writes the given five-byte tag directly to the stream. - - The first byte of the encoded tag - The second byte of the encoded tag - The third byte of the encoded tag - The fourth byte of the encoded tag - The fifth byte of the encoded tag - - - - Writes a 32 bit value as a varint. The fast route is taken when - there's enough buffer space left to whizz through without checking - for each byte; otherwise, we resort to calling WriteRawByte each time. - - - - - Writes out an array of bytes. - - - - - Writes out part of an array of bytes. - - - - - Indicates that a CodedOutputStream wrapping a flat byte array - ran out of space. - - - - - Flushes any buffered data and optionally closes the underlying stream, if any. - - - - By default, any underlying stream is closed by this method. To configure this behaviour, - use a constructor overload with a leaveOpen parameter. If this instance does not - have an underlying stream, this method does nothing. - - - For the sake of efficiency, calling this method does not prevent future write calls - but - if a later write ends up writing to a stream which has been disposed, that is likely to - fail. It is recommend that you not call any other methods after this. - - - - - - Flushes any buffered data to the underlying stream (if there is one). - - - - - Verifies that SpaceLeft returns zero. It's common to create a byte array - that is exactly big enough to hold a message, then write to it with - a CodedOutputStream. Calling CheckNoSpaceLeft after writing verifies that - the message was actually as big as expected, which can help finding bugs. - - - - - If writing to a flat array, returns the space left in the array. Otherwise, - throws an InvalidOperationException. - - - - - Utility to compare if two Lists are the same, and the hash code - of a List. - - - - - Checks if two lists are equal. - - - - - Gets the list's hash code. - - - - - Representation of a map field in a Protocol Buffer message. - - Key type in the map. Must be a type supported by Protocol Buffer map keys. - Value type in the map. Must be a type supported by Protocol Buffers. - - - For string keys, the equality comparison is provided by . - - - Null values are not permitted in the map, either for wrapper types or regular messages. - If a map is deserialized from a data stream and the value is missing from an entry, a default value - is created instead. For primitive types, that is the regular default value (0, the empty string and so - on); for message types, an empty instance of the message is created, as if the map entry contained a 0-length - encoded value for the field. - - - This implementation does not generally prohibit the use of key/value types which are not - supported by Protocol Buffers (e.g. using a key type of byte) but nor does it guarantee - that all operations will work in such cases. - - - The order in which entries are returned when iterating over this object is undefined, and may change - in future versions. - - - - - - Creates a deep clone of this object. - - - A deep clone of this object. - - - - - Adds the specified key/value pair to the map. - - - This operation fails if the key already exists in the map. To replace an existing entry, use the indexer. - - The key to add - The value to add. - The given key already exists in map. - - - - Determines whether the specified key is present in the map. - - The key to check. - true if the map contains the given key; false otherwise. - - - - Removes the entry identified by the given key from the map. - - The key indicating the entry to remove from the map. - true if the map contained the given key before the entry was removed; false otherwise. - - - - Gets the value associated with the specified key. - - The key whose value to get. - When this method returns, the value associated with the specified key, if the key is found; - otherwise, the default value for the type of the parameter. - This parameter is passed uninitialized. - true if the map contains an element with the specified key; otherwise, false. - - - - Gets or sets the value associated with the specified key. - - The key of the value to get or set. - The property is retrieved and key does not exist in the collection. - The value associated with the specified key. If the specified key is not found, - a get operation throws a , and a set operation creates a new element with the specified key. - - - - Gets a collection containing the keys in the map. - - - - - Gets a collection containing the values in the map. - - - - - Adds the specified entries to the map. The keys and values are not automatically cloned. - - The entries to add to the map. - - - - Returns an enumerator that iterates through the collection. - - - An enumerator that can be used to iterate through the collection. - - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Adds the specified item to the map. - - The item to add to the map. - - - - Removes all items from the map. - - - - - Determines whether map contains an entry equivalent to the given key/value pair. - - The key/value pair to find. - - - - - Copies the key/value pairs in this map to an array. - - The array to copy the entries into. - The index of the array at which to start copying values. - - - - Removes the specified key/value pair from the map. - - Both the key and the value must be found for the entry to be removed. - The key/value pair to remove. - true if the key/value pair was found and removed; false otherwise. - - - - Gets the number of elements contained in the map. - - - - - Gets a value indicating whether the map is read-only. - - - - - Determines whether the specified , is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Compares this map with another for equality. - - - The order of the key/value pairs in the maps is not deemed significant in this comparison. - - The map to compare this with. - true if refers to an equal map; false otherwise. - - - - Adds entries to the map from the given stream. - - - It is assumed that the stream is initially positioned after the tag specified by the codec. - This method will continue reading entries from the stream until the end is reached, or - a different tag is encountered. - - Stream to read from - Codec describing how the key/value pairs are encoded - - - - Adds entries to the map from the given parse context. - - - It is assumed that the input is initially positioned after the tag specified by the codec. - This method will continue reading entries from the input until the end is reached, or - a different tag is encountered. - - Input to read from - Codec describing how the key/value pairs are encoded - - - - Writes the contents of this map to the given coded output stream, using the specified codec - to encode each entry. - - The output stream to write to. - The codec to use for each entry. - - - - Writes the contents of this map to the given write context, using the specified codec - to encode each entry. - - The write context to write to. - The codec to use for each entry. - - - - Calculates the size of this map based on the given entry codec. - - The codec to use to encode each entry. - - - - - Returns a string representation of this repeated field, in the same - way as it would be represented by the default JSON formatter. - - - - - A codec for a specific map field. This contains all the information required to encode and - decode the nested messages. - - - - - Creates a new entry codec based on a separate key codec and value codec, - and the tag to use for each map entry. - - The key codec. - The value codec. - The map tag to use to introduce each map entry. - - - - The key codec. - - - - - The value codec. - - - - - The tag used in the enclosing message to indicate map entries. - - - - - Provides a central place to implement equality comparisons, primarily for bitwise float/double equality. - - - - - Returns an equality comparer for suitable for Protobuf equality comparisons. - This is usually just the default equality comparer for the type, but floating point numbers are compared - bitwise. - - The type of equality comparer to return. - The equality comparer. - - - - Returns an equality comparer suitable for comparing 64-bit floating point values, by bitwise comparison. - (NaN values are considered equal, but only when they have the same representation.) - - - - - Returns an equality comparer suitable for comparing 32-bit floating point values, by bitwise comparison. - (NaN values are considered equal, but only when they have the same representation.) - - - - - Returns an equality comparer suitable for comparing nullable 64-bit floating point values, by bitwise comparison. - (NaN values are considered equal, but only when they have the same representation.) - - - - - Returns an equality comparer suitable for comparing nullable 32-bit floating point values, by bitwise comparison. - (NaN values are considered equal, but only when they have the same representation.) - - - - - Read-only wrapper around another dictionary. - - - - - The contents of a repeated field: essentially, a collection with some extra - restrictions (no null values) and capabilities (deep cloning). - - - This implementation does not generally prohibit the use of types which are not - supported by Protocol Buffers but nor does it guarantee that all operations will work in such cases. - - The element type of the repeated field. - - - - Creates a deep clone of this repeated field. - - - If the field type is - a message type, each element is also cloned; otherwise, it is - assumed that the field type is primitive (including string and - bytes, both of which are immutable) and so a simple copy is - equivalent to a deep clone. - - A deep clone of this repeated field. - - - - Adds the entries from the given input stream, decoding them with the specified codec. - - The input stream to read from. - The codec to use in order to read each entry. - - - - Adds the entries from the given parse context, decoding them with the specified codec. - - The input to read from. - The codec to use in order to read each entry. - - - - Calculates the size of this collection based on the given codec. - - The codec to use when encoding each field. - The number of bytes that would be written to an output by one of the WriteTo methods, - using the same codec. - - - - Writes the contents of this collection to the given , - encoding each value using the specified codec. - - The output stream to write to. - The codec to use when encoding each value. - - - - Writes the contents of this collection to the given write context, - encoding each value using the specified codec. - - The write context to write to. - The codec to use when encoding each value. - - - - Gets and sets the capacity of the RepeatedField's internal array. WHen set, the internal array is reallocated to the given capacity. - The new value is less than Count -or- when Count is less than 0. - - - - - Adds the specified item to the collection. - - The item to add. - - - - Removes all items from the collection. - - - - - Determines whether this collection contains the given item. - - The item to find. - true if this collection contains the given item; false otherwise. - - - - Copies this collection to the given array. - - The array to copy to. - The first index of the array to copy to. - - - - Removes the specified item from the collection - - The item to remove. - true if the item was found and removed; false otherwise. - - - - Gets the number of elements contained in the collection. - - - - - Gets a value indicating whether the collection is read-only. - - - - - Adds all of the specified values into this collection. - - The values to add to this collection. - - - - Adds all of the specified values into this collection. This method is present to - allow repeated fields to be constructed from queries within collection initializers. - Within non-collection-initializer code, consider using the equivalent - method instead for clarity. - - The values to add to this collection. - - - - Returns an enumerator that iterates through the collection. - - - An enumerator that can be used to iterate through the collection. - - - - - Determines whether the specified , is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Compares this repeated field with another for equality. - - The repeated field to compare this with. - true if refers to an equal repeated field; false otherwise. - - - - Returns the index of the given item within the collection, or -1 if the item is not - present. - - The item to find in the collection. - The zero-based index of the item, or -1 if it is not found. - - - - Inserts the given item at the specified index. - - The index at which to insert the item. - The item to insert. - - - - Removes the item at the given index. - - The zero-based index of the item to remove. - - - - Returns a string representation of this repeated field, in the same - way as it would be represented by the default JSON formatter. - - - - - Gets or sets the item at the specified index. - - - The element at the specified index. - - The zero-based index of the element to get or set. - The item at the specified index. - - - - Extension methods for , effectively providing - the familiar members from previous desktop framework versions while - targeting the newer releases, .NET Core etc. - - - - - Returns the public getter of a property, or null if there is no such getter - (either because it's read-only, or the getter isn't public). - - - - - Returns the public setter of a property, or null if there is no such setter - (either because it's write-only, or the setter isn't public). - - - - - Provides extension methods on Type that just proxy to TypeInfo. - These are used to support the new type system from .NET 4.5, without - having calls to GetTypeInfo all over the place. While the methods here are meant to be - broadly compatible with the desktop framework, there are some subtle differences in behaviour - but - they're not expected to affect our use cases. While the class is internal, that should be fine: we can - evaluate each new use appropriately. - - - - - See https://msdn.microsoft.com/en-us/library/system.type.isassignablefrom - - - - - Returns a representation of the public property associated with the given name in the given type, - including inherited properties or null if there is no such public property. - Here, "public property" means a property where either the getter, or the setter, or both, is public. - - - - - Returns a representation of the public method associated with the given name in the given type, - including inherited methods. - - - This has a few differences compared with Type.GetMethod in the desktop framework. It will throw - if there is an ambiguous match even between a private method and a public one, but it *won't* throw - if there are two overloads at different levels in the type hierarchy (e.g. class Base declares public void Foo(int) and - class Child : Base declares public void Foo(long)). - - One type in the hierarchy declared more than one method with the same name - - - - Represents a non-generic extension definition. This API is experimental and subject to change. - - - - - Internal use. Creates a new extension with the specified field number. - - - - - Gets the field number of this extension - - - - - Represents a type-safe extension identifier used for getting and setting single extension values in instances. - This API is experimental and subject to change. - - The message type this field applies to - The field value type of this extension - - - - Creates a new extension identifier with the specified field number and codec - - - - - Represents a type-safe extension identifier used for getting repeated extension values in instances. - This API is experimental and subject to change. - - The message type this field applies to - The repeated field value type of this extension - - - - Creates a new repeated extension identifier with the specified field number and codec - - - - - Provides extensions to messages while parsing. This API is experimental and subject to change. - - - - - Creates a new empty extension registry - - - - - Gets the total number of extensions in this extension registry - - - - - Returns whether the registry is readonly - - - - - Adds the specified extension to the registry - - - - - Adds the specified extensions to the registry - - - - - Clears the registry of all values - - - - - Gets whether the extension registry contains the specified extension - - - - - Copies the arrays in the registry set to the specified array at the specified index - - The array to copy to - The array index to start at - - - - Returns an enumerator to enumerate through the items in the registry - - Returns an enumerator for the extensions in this registry - - - - Removes the specified extension from the set - - The extension - true if the extension was removed, otherwise false - - - - Clones the registry into a new registry - - - - - Methods for managing s with null checking. - - Most users will not use this class directly and its API is experimental and subject to change. - - - - - Gets the value of the specified extension - - - - - Gets the value of the specified repeated extension or null if it doesn't exist in this set - - - - - Gets the value of the specified repeated extension, registering it if it doesn't exist - - - - - Sets the value of the specified extension. This will make a new instance of ExtensionSet if the set is null. - - - - - Gets whether the value of the specified extension is set - - - - - Clears the value of the specified extension - - - - - Clears the value of the specified extension - - - - - Tries to merge a field from the coded input, returning true if the field was merged. - If the set is null or the field was not otherwise merged, this returns false. - - - - - Tries to merge a field from the coded input, returning true if the field was merged. - If the set is null or the field was not otherwise merged, this returns false. - - - - - Merges the second set into the first set, creating a new instance if first is null - - - - - Clones the set into a new set. If the set is null, this returns null - - - - - Used for keeping track of extensions in messages. - methods route to this set. - - Most users will not need to use this class directly - - The message type that extensions in this set target - - - - Gets a hash code of the set - - - - - Returns whether this set is equal to the other object - - - - - Calculates the size of this extension set - - - - - Writes the extension values in this set to the output stream - - - - - Writes the extension values in this set to the write context - - - - - Factory methods for . - - - - - Retrieves a codec suitable for a string field with the given tag. - - The tag. - A codec for the given tag. - - - - Retrieves a codec suitable for a bytes field with the given tag. - - The tag. - A codec for the given tag. - - - - Retrieves a codec suitable for a bool field with the given tag. - - The tag. - A codec for the given tag. - - - - Retrieves a codec suitable for an int32 field with the given tag. - - The tag. - A codec for the given tag. - - - - Retrieves a codec suitable for an sint32 field with the given tag. - - The tag. - A codec for the given tag. - - - - Retrieves a codec suitable for a fixed32 field with the given tag. - - The tag. - A codec for the given tag. - - - - Retrieves a codec suitable for an sfixed32 field with the given tag. - - The tag. - A codec for the given tag. - - - - Retrieves a codec suitable for a uint32 field with the given tag. - - The tag. - A codec for the given tag. - - - - Retrieves a codec suitable for an int64 field with the given tag. - - The tag. - A codec for the given tag. - - - - Retrieves a codec suitable for an sint64 field with the given tag. - - The tag. - A codec for the given tag. - - - - Retrieves a codec suitable for a fixed64 field with the given tag. - - The tag. - A codec for the given tag. - - - - Retrieves a codec suitable for an sfixed64 field with the given tag. - - The tag. - A codec for the given tag. - - - - Retrieves a codec suitable for a uint64 field with the given tag. - - The tag. - A codec for the given tag. - - - - Retrieves a codec suitable for a float field with the given tag. - - The tag. - A codec for the given tag. - - - - Retrieves a codec suitable for a double field with the given tag. - - The tag. - A codec for the given tag. - - - - Retrieves a codec suitable for an enum field with the given tag. - - The tag. - A conversion function from to the enum type. - A conversion function from the enum type to . - A codec for the given tag. - - - - Retrieves a codec suitable for a string field with the given tag. - - The tag. - The default value. - A codec for the given tag. - - - - Retrieves a codec suitable for a bytes field with the given tag. - - The tag. - The default value. - A codec for the given tag. - - - - Retrieves a codec suitable for a bool field with the given tag. - - The tag. - The default value. - A codec for the given tag. - - - - Retrieves a codec suitable for an int32 field with the given tag. - - The tag. - The default value. - A codec for the given tag. - - - - Retrieves a codec suitable for an sint32 field with the given tag. - - The tag. - The default value. - A codec for the given tag. - - - - Retrieves a codec suitable for a fixed32 field with the given tag. - - The tag. - The default value. - A codec for the given tag. - - - - Retrieves a codec suitable for an sfixed32 field with the given tag. - - The tag. - The default value. - A codec for the given tag. - - - - Retrieves a codec suitable for a uint32 field with the given tag. - - The tag. - The default value. - A codec for the given tag. - - - - Retrieves a codec suitable for an int64 field with the given tag. - - The tag. - The default value. - A codec for the given tag. - - - - Retrieves a codec suitable for an sint64 field with the given tag. - - The tag. - The default value. - A codec for the given tag. - - - - Retrieves a codec suitable for a fixed64 field with the given tag. - - The tag. - The default value. - A codec for the given tag. - - - - Retrieves a codec suitable for an sfixed64 field with the given tag. - - The tag. - The default value. - A codec for the given tag. - - - - Retrieves a codec suitable for a uint64 field with the given tag. - - The tag. - The default value. - A codec for the given tag. - - - - Retrieves a codec suitable for a float field with the given tag. - - The tag. - The default value. - A codec for the given tag. - - - - Retrieves a codec suitable for a double field with the given tag. - - The tag. - The default value. - A codec for the given tag. - - - - Retrieves a codec suitable for an enum field with the given tag. - - The tag. - A conversion function from to the enum type. - A conversion function from the enum type to . - The default value. - A codec for the given tag. - - - - Retrieves a codec suitable for a message field with the given tag. - - The tag. - A parser to use for the message type. - A codec for the given tag. - - - - Retrieves a codec suitable for a group field with the given tag. - - The start group tag. - The end group tag. - A parser to use for the group message type. - A codec for given tag - - - - Creates a codec for a wrapper type of a class - which must be string or ByteString. - - - - - Creates a codec for a wrapper type of a struct - which must be Int32, Int64, UInt32, UInt64, - Bool, Single or Double. - - - - - Helper code to create codecs for wrapper types. - - - Somewhat ugly with all the static methods, but the conversions involved to/from nullable types make it - slightly tricky to improve. So long as we keep the public API (ForClassWrapper, ForStructWrapper) in place, - we can refactor later if we come up with something cleaner. - - - - - Returns a field codec which effectively wraps a value of type T in a message. - - - - - - - An encode/decode pair for a single field. This effectively encapsulates - all the information needed to read or write the field value from/to a coded - stream. - - - This class is public and has to be as it is used by generated code, but its public - API is very limited - just what the generated code needs to call directly. - - - - This never writes default values to the stream, and does not address "packedness" - in repeated fields itself, other than to know whether or not the field *should* be packed. - - - - - Merges an input stream into a value - - - - - Merges a value into a reference to another value, returning a boolean if the value was set - - - - - Returns a delegate to write a value (unconditionally) to a coded output stream. - - - - - Returns the size calculator for just a value. - - - - - Returns a delegate to read a value from a coded input stream. It is assumed that - the stream is already positioned on the appropriate tag. - - - - - Returns a delegate to merge a value from a coded input stream. - It is assumed that the stream is already positioned on the appropriate tag - - - - - Returns a delegate to merge two values together. - - - - - Returns the fixed size for an entry, or 0 if sizes vary. - - - - - Gets the tag of the codec. - - - The tag of the codec. - - - - - Gets the end tag of the codec or 0 if there is no end tag - - - The end tag of the codec. - - - - - Default value for this codec. Usually the same for every instance of the same type, but - for string/ByteString wrapper fields the codec's default value is null, whereas for - other string/ByteString fields it's "" or ByteString.Empty. - - - The default value of the codec's type. - - - - - Write a tag and the given value, *if* the value is not the default. - - - - - Write a tag and the given value, *if* the value is not the default. - - - - - Reads a value of the codec type from the given . - - The input stream to read from. - The value read from the stream. - - - - Reads a value of the codec type from the given . - - The parse context to read from. - The value read. - - - - Calculates the size required to write the given value, with a tag, - if the value is not the default. - - - - - Calculates the size required to write the given value, with a tag, even - if the value is the default. - - - - - A tree representation of a FieldMask. Each leaf node in this tree represent - a field path in the FieldMask. - - For example, FieldMask "foo.bar,foo.baz,bar.baz" as a tree will be: - - [root] -+- foo -+- bar - | | - | +- baz - | - +- bar --- baz - - - By representing FieldMasks with this tree structure we can easily convert - a FieldMask to a canonical form, merge two FieldMasks, calculate the - intersection to two FieldMasks and traverse all fields specified by the - FieldMask in a message tree. - - - - - Creates an empty FieldMaskTree. - - - - - Creates a FieldMaskTree for a given FieldMask. - - - - - Adds a field path to the tree. In a FieldMask, every field path matches the - specified field as well as all its sub-fields. For example, a field path - "foo.bar" matches field "foo.bar" and also "foo.bar.baz", etc. When adding - a field path to the tree, redundant sub-paths will be removed. That is, - after adding "foo.bar" to the tree, "foo.bar.baz" will be removed if it - exists, which will turn the tree node for "foo.bar" to a leaf node. - Likewise, if the field path to add is a sub-path of an existing leaf node, - nothing will be changed in the tree. - - - - - Merges all field paths in a FieldMask into this tree. - - - - - Converts this tree to a FieldMask. - - - - - Gathers all field paths in a sub-tree. - - - - - Adds the intersection of this tree with the given to . - - - - - Merges all fields specified by this FieldMaskTree from to . - - - - - Merges all fields specified by a sub-tree from to . - - - - - Class containing helpful workarounds for various platform compatibility - - - - - Interface for a Protocol Buffers message, supporting - parsing from and writing to . - - - - - Internal implementation of merging data from given parse context into this message. - Users should never invoke this method directly. - - - - - Internal implementation of writing this message to a given write context. - Users should never invoke this method directly. - - - - - A message type that has a custom string format for diagnostic purposes. - - - - Calling on a generated message type normally - returns the JSON representation. If a message type implements this interface, - then the method will be called instead of the regular - JSON formatting code, but only when ToString() is called either on the message itself - or on another message which contains it. This does not affect the normal JSON formatting of - the message. - - - For example, if you create a proto message representing a GUID, the internal - representation may be a bytes field or four fixed32 fields. However, when debugging - it may be more convenient to see a result in the same format as provides. - - This interface extends to avoid it accidentally being implemented - on types other than messages, where it would not be used by anything in the framework. - - - - - Returns a string representation of this object, for diagnostic purposes. - - - This method is called when a message is formatted as part of a - call. It does not affect the JSON representation used by other than - in calls to . While it is recommended - that the result is valid JSON, this is never assumed by the Protobuf library. - - A string representation of this object, for diagnostic purposes. - - - - Generic interface for a deeply cloneable type. - - - - All generated messages implement this interface, but so do some non-message types. - Additionally, due to the type constraint on T in , - it is simpler to keep this as a separate interface. - - - The type itself, returned by the method. - - - - Creates a deep clone of this object. - - A deep clone of this object. - - - - Generic interface for a Protocol Buffers message containing one or more extensions, where the type parameter is expected to be the same type as the implementation class. - This interface is experiemental and is subject to change. - - - - - Gets the value of the specified extension - - - - - Gets the value of the specified repeated extension or null if the extension isn't registered in this set. - For a version of this method that never returns null, use - - - - - Gets the value of the specified repeated extension, registering it if it hasn't already been registered. - - - - - Sets the value of the specified extension - - - - - Gets whether the value of the specified extension is set - - - - - Clears the value of the specified extension - - - - - Clears the value of the specified repeated extension - - - - - Interface for a Protocol Buffers message, supporting - basic operations required for serialization. - - - - - Merges the data from the specified coded input stream with the current message. - - See the user guide for precise merge semantics. - - - - - Writes the data to the given coded output stream. - - Coded output stream to write the data to. Must not be null. - - - - Calculates the size of this message in Protocol Buffer wire format, in bytes. - - The number of bytes required to write this message - to a coded output stream. - - - - Descriptor for this message. All instances are expected to return the same descriptor, - and for generated types this will be an explicitly-implemented member, returning the - same value as the static property declared on the type. - - - - - Generic interface for a Protocol Buffers message, - where the type parameter is expected to be the same type as - the implementation class. - - The message type. - - - - Merges the given message into this one. - - See the user guide for precise merge semantics. - The message to merge with this one. Must not be null. - - - - Thrown when an attempt is made to parse invalid JSON, e.g. using - a non-string property key, or including a redundant comma. Parsing a protocol buffer - message represented in JSON using can throw both this - exception and depending on the situation. This - exception is only thrown for "pure JSON" errors, whereas InvalidProtocolBufferException - is thrown when the JSON may be valid in and of itself, but cannot be parsed as a protocol buffer - message. - - - - - Thrown when a protocol message being parsed is invalid in some way, - e.g. it contains a malformed varint or a negative byte length. - - - - - Creates an exception for an error condition of an invalid tag being encountered. - - - - - Reflection-based converter from messages to JSON. - - - - Instances of this class are thread-safe, with no mutable state. - - - This is a simple start to get JSON formatting working. As it's reflection-based, - it's not as quick as baking calls into generated messages - but is a simpler implementation. - (This code is generally not heavily optimized.) - - - - - - Returns a formatter using the default settings. - - - - - The JSON representation of the first 160 characters of Unicode. - Empty strings are replaced by the static constructor. - - - - - Creates a new formatted with the given settings. - - The settings. - - - - Formats the specified message as JSON. - - The message to format. - The formatted message. - - - - Formats the specified message as JSON. - - The message to format. - The TextWriter to write the formatted message to. - The formatted message. - - - - Converts a message to JSON for diagnostic purposes with no extra context. - - - - This differs from calling on the default JSON - formatter in its handling of . As no type registry is available - in calls, the normal way of resolving the type of - an Any message cannot be applied. Instead, a JSON property named @value - is included with the base64 data from the property of the message. - - The value returned by this method is only designed to be used for diagnostic - purposes. It may not be parsable by , and may not be parsable - by other Protocol Buffer implementations. - - The message to format for diagnostic purposes. - The diagnostic-only JSON representation of the message - - - - Determines whether or not a field value should be serialized according to the field, - its value in the message, and the settings of this formatter. - - - - - Writes a single value to the given writer as JSON. Only types understood by - Protocol Buffers can be written in this way. This method is only exposed for - advanced use cases; most users should be using - or . - - The writer to write the value to. Must not be null. - The value to write. May be null. - - - - Central interception point for well-known type formatting. Any well-known types which - don't need special handling can fall back to WriteMessage. We avoid assuming that the - values are using the embedded well-known types, in order to allow for dynamic messages - in the future. - - - - - Writes a string (including leading and trailing double quotes) to a builder, escaping as required. - - - Other than surrogate pair handling, this code is mostly taken from src/google/protobuf/util/internal/json_escaping.cc. - - - - - Settings controlling JSON formatting. - - - - - Default settings, as used by - - - - - Whether fields which would otherwise not be included in the formatted data - should be formatted even when the value is not present, or has the default value. - This option only affects fields which don't support "presence" (e.g. - singular non-optional proto3 primitive fields). - - - - - The type registry used to format messages. - - - - - Whether to format enums as ints. Defaults to false. - - - - - Whether to use the original proto field names as defined in the .proto file. Defaults to false. - - - - - Creates a new object with the specified formatting of default values - and an empty type registry. - - true if default values (0, empty strings etc) should be formatted; false otherwise. - - - - Creates a new object with the specified formatting of default values - and type registry. - - true if default values (0, empty strings etc) should be formatted; false otherwise. - The to use when formatting messages. - - - - Creates a new object with the specified parameters. - - true if default values (0, empty strings etc) should be formatted; false otherwise. - The to use when formatting messages. TypeRegistry.Empty will be used if it is null. - true to format the enums as integers; false to format enums as enum names. - true to preserve proto field names; false to convert them to lowerCamelCase. - - - - Creates a new object with the specified formatting of default values and the current settings. - - true if default values (0, empty strings etc) should be formatted; false otherwise. - - - - Creates a new object with the specified type registry and the current settings. - - The to use when formatting messages. - - - - Creates a new object with the specified enums formatting option and the current settings. - - true to format the enums as integers; false to format enums as enum names. - - - - Creates a new object with the specified field name formatting option and the current settings. - - true to preserve proto field names; false to convert them to lowerCamelCase. - - - - Reflection-based converter from JSON to messages. - - - - Instances of this class are thread-safe, with no mutable state. - - - This is a simple start to get JSON parsing working. As it's reflection-based, - it's not as quick as baking calls into generated messages - but is a simpler implementation. - (This code is generally not heavily optimized.) - - - - - - Returns a formatter using the default settings. - - - - - Creates a new formatted with the given settings. - - The settings. - - - - Parses and merges the information into the given message. - - The message to merge the JSON information into. - The JSON to parse. - - - - Parses JSON read from and merges the information into the given message. - - The message to merge the JSON information into. - Reader providing the JSON to parse. - - - - Merges the given message using data from the given tokenizer. In most cases, the next - token should be a "start object" token, but wrapper types and nullity can invalidate - that assumption. This is implemented as an LL(1) recursive descent parser over the stream - of tokens provided by the tokenizer. This token stream is assumed to be valid JSON, with the - tokenizer performing that validation - but not every token stream is valid "protobuf JSON". - - - - - Parses into a new message. - - The type of message to create. - The JSON to parse. - The JSON does not comply with RFC 7159 - The JSON does not represent a Protocol Buffers message correctly - - - - Parses JSON read from into a new message. - - The type of message to create. - Reader providing the JSON to parse. - The JSON does not comply with RFC 7159 - The JSON does not represent a Protocol Buffers message correctly - - - - Parses into a new message. - - The JSON to parse. - Descriptor of message type to parse. - The JSON does not comply with RFC 7159 - The JSON does not represent a Protocol Buffers message correctly - - - - Parses JSON read from into a new message. - - Reader providing the JSON to parse. - Descriptor of message type to parse. - The JSON does not comply with RFC 7159 - The JSON does not represent a Protocol Buffers message correctly - - - - Creates a new instance of the message type for the given field. - - - - - Checks that any infinite/NaN values originated from the correct text. - This corrects the lenient whitespace handling of double.Parse/float.Parse, as well as the - way that Mono parses out-of-range values as infinity. - - - - - Settings controlling JSON parsing. - - - - - Default settings, as used by . This has the same default - recursion limit as , and an empty type registry. - - - - - The maximum depth of messages to parse. Note that this limit only applies to parsing - messages, not collections - so a message within a collection within a message only counts as - depth 2, not 3. - - - - - The type registry used to parse messages. - - - - - Whether the parser should ignore unknown fields (true) or throw an exception when - they are encountered (false). - - - - - Creates a new object with the specified recursion limit. - - The maximum depth of messages to parse - - - - Creates a new object with the specified recursion limit and type registry. - - The maximum depth of messages to parse - The type registry used to parse messages - - - - Creates a new object set to either ignore unknown fields, or throw an exception - when unknown fields are encountered. - - true if unknown fields should be ignored when parsing; false to throw an exception. - - - - Creates a new object based on this one, but with the specified recursion limit. - - The new recursion limit. - - - - Creates a new object based on this one, but with the specified type registry. - - The new type registry. Must not be null. - - - - Simple but strict JSON tokenizer, rigidly following RFC 7159. - - - - This tokenizer is stateful, and only returns "useful" tokens - names, values etc. - It does not create tokens for the separator between names and values, or for the comma - between values. It validates the token stream as it goes - so callers can assume that the - tokens it produces are appropriate. For example, it would never produce "start object, end array." - - Implementation details: the base class handles single token push-back and - Not thread-safe. - - - - - Creates a tokenizer that reads from the given text reader. - - - - - Creates a tokenizer that first replays the given list of tokens, then continues reading - from another tokenizer. Note that if the returned tokenizer is "pushed back", that does not push back - on the continuation tokenizer, or vice versa. Care should be taken when using this method - it was - created for the sake of Any parsing. - - - - - Returns the depth of the stack, purely in objects (not collections). - Informally, this is the number of remaining unclosed '{' characters we have. - - - - - Returns the next JSON token in the stream. An EndDocument token is returned to indicate the end of the stream, - after which point Next() should not be called again. - - This implementation provides single-token buffering, and calls if there is no buffered token. - The next token in the stream. This is never null. - This method is called after an EndDocument token has been returned - The input text does not comply with RFC 7159 - - - - Returns the next JSON token in the stream, when requested by the base class. (The method delegates - to this if it doesn't have a buffered token.) - - This method is called after an EndDocument token has been returned - The input text does not comply with RFC 7159 - - - - Skips the value we're about to read. This must only be called immediately after reading a property name. - If the value is an object or an array, the complete object/array is skipped. - - - - - Tokenizer which first exhausts a list of tokens, then consults another tokenizer. - - - - - Tokenizer which does all the *real* work of parsing JSON. - - - - - This method essentially just loops through characters skipping whitespace, validating and - changing state (e.g. from ObjectBeforeColon to ObjectAfterColon) - until it reaches something which will be a genuine token (e.g. a start object, or a value) at which point - it returns the token. Although the method is large, it would be relatively hard to break down further... most - of it is the large switch statement, which sometimes returns and sometimes doesn't. - - - - - Reads a string token. It is assumed that the opening " has already been read. - - - - - Reads an escaped character. It is assumed that the leading backslash has already been read. - - - - - Reads an escaped Unicode 4-nybble hex sequence. It is assumed that the leading \u has already been read. - - - - - Consumes a text-only literal, throwing an exception if the read text doesn't match it. - It is assumed that the first letter of the literal has already been read. - - - - - Validates that we're in a valid state to read a value (using the given error prefix if necessary) - and changes the state to the appropriate one, e.g. ObjectAfterColon to ObjectAfterProperty. - - - - - Pops the top-most container, and sets the state to the appropriate one for the end of a value - in the parent container. - - - - - Possible states of the tokenizer. - - - This is a flags enum purely so we can simply and efficiently represent a set of valid states - for checking. - - Each is documented with an example, - where ^ represents the current position within the text stream. The examples all use string values, - but could be any value, including nested objects/arrays. - The complete state of the tokenizer also includes a stack to indicate the contexts (arrays/objects). - Any additional notional state of "AfterValue" indicates that a value has been completed, at which - point there's an immediate transition to ExpectedEndOfDocument, ObjectAfterProperty or ArrayAfterValue. - - - These states were derived manually by reading RFC 7159 carefully. - - - - - - ^ { "foo": "bar" } - Before the value in a document. Next states: ObjectStart, ArrayStart, "AfterValue" - - - - - { "foo": "bar" } ^ - After the value in a document. Next states: ReaderExhausted - - - - - { "foo": "bar" } ^ (and already read to the end of the reader) - Terminal state. - - - - - { ^ "foo": "bar" } - Before the *first* property in an object. - Next states: - "AfterValue" (empty object) - ObjectBeforeColon (read a name) - - - - - { "foo" ^ : "bar", "x": "y" } - Next state: ObjectAfterColon - - - - - { "foo" : ^ "bar", "x": "y" } - Before any property other than the first in an object. - (Equivalently: after any property in an object) - Next states: - "AfterValue" (value is simple) - ObjectStart (value is object) - ArrayStart (value is array) - - - - - { "foo" : "bar" ^ , "x" : "y" } - At the end of a property, so expecting either a comma or end-of-object - Next states: ObjectAfterComma or "AfterValue" - - - - - { "foo":"bar", ^ "x":"y" } - Read the comma after the previous property, so expecting another property. - This is like ObjectStart, but closing brace isn't valid here - Next state: ObjectBeforeColon. - - - - - [ ^ "foo", "bar" ] - Before the *first* value in an array. - Next states: - "AfterValue" (read a value) - "AfterValue" (end of array; will pop stack) - - - - - [ "foo" ^ , "bar" ] - After any value in an array, so expecting either a comma or end-of-array - Next states: ArrayAfterComma or "AfterValue" - - - - - [ "foo", ^ "bar" ] - After a comma in an array, so there *must* be another value (simple or complex). - Next states: "AfterValue" (simple value), StartObject, StartArray - - - - - Wrapper around a text reader allowing small amounts of buffering and location handling. - - - - - The buffered next character, if we have one. - - - - - Returns the next character in the stream, or null if we have reached the end. - - - - - - Creates a new exception appropriate for the current state of the reader. - - - - - Stream implementation which proxies another stream, only allowing a certain amount - of data to be read. Note that this is only used to read delimited streams, so it - doesn't attempt to implement everything. - - - - - Extension methods on and . - - - - - Merges data from the given byte array into an existing message. - - The message to merge the data into. - The data to merge, which must be protobuf-encoded binary data. - - - - Merges data from the given byte array slice into an existing message. - - The message to merge the data into. - The data containing the slice to merge, which must be protobuf-encoded binary data. - The offset of the slice to merge. - The length of the slice to merge. - - - - Merges data from the given byte string into an existing message. - - The message to merge the data into. - The data to merge, which must be protobuf-encoded binary data. - - - - Merges data from the given stream into an existing message. - - The message to merge the data into. - Stream containing the data to merge, which must be protobuf-encoded binary data. - - - - Merges data from the given span into an existing message. - - The message to merge the data into. - Span containing the data to merge, which must be protobuf-encoded binary data. - - - - Merges length-delimited data from the given stream into an existing message. - - - The stream is expected to contain a length and then the data. Only the amount of data - specified by the length will be consumed. - - The message to merge the data into. - Stream containing the data to merge, which must be protobuf-encoded binary data. - - - - Converts the given message into a byte array in protobuf encoding. - - The message to convert. - The message data as a byte array. - - - - Writes the given message data to the given stream in protobuf encoding. - - The message to write to the stream. - The stream to write to. - - - - Writes the length and then data of the given message to a stream. - - The message to write. - The output stream to write to. - - - - Converts the given message into a byte string in protobuf encoding. - - The message to convert. - The message data as a byte string. - - - - Writes the given message data to the given buffer writer in protobuf encoding. - - The message to write to the stream. - The stream to write to. - - - - Writes the given message data to the given span in protobuf encoding. - The size of the destination span needs to fit the serialized size - of the message exactly, otherwise an exception is thrown. - - The message to write to the stream. - The span to write to. Size must match size of the message exactly. - - - - Checks if all required fields in a message have values set. For proto3 messages, this returns true - - - - - A general message parser, typically used by reflection-based code as all the methods - return simple . - - - - - Creates a template instance ready for population. - - An empty message. - - - - Parses a message from a byte array. - - The byte array containing the message. Must not be null. - The newly parsed message. - - - - Parses a message from a byte array slice. - - The byte array containing the message. Must not be null. - The offset of the slice to parse. - The length of the slice to parse. - The newly parsed message. - - - - Parses a message from the given byte string. - - The data to parse. - The parsed message. - - - - Parses a message from the given stream. - - The stream to parse. - The parsed message. - - - - Parses a message from the given sequence. - - The data to parse. - The parsed message. - - - - Parses a message from the given span. - - The data to parse. - The parsed message. - - - - Parses a length-delimited message from the given stream. - - - The stream is expected to contain a length and then the data. Only the amount of data - specified by the length will be consumed. - - The stream to parse. - The parsed message. - - - - Parses a message from the given coded input stream. - - The stream to parse. - The parsed message. - - - - Parses a message from the given JSON. - - The JSON to parse. - The parsed message. - The JSON does not comply with RFC 7159 - The JSON does not represent a Protocol Buffers message correctly - - - - Creates a new message parser which optionally discards unknown fields when parsing. - - Whether or not to discard unknown fields when parsing. - A newly configured message parser. - - - - Creates a new message parser which registers extensions from the specified registry upon creating the message instance - - The extensions to register - A newly configured message parser. - - - - A parser for a specific message type. - - -

- This delegates most behavior to the - implementation within the original type, but - provides convenient overloads to parse from a variety of sources. -

-

- Most applications will never need to create their own instances of this type; - instead, use the static Parser property of a generated message type to obtain a - parser for that type. -

-
- The type of message to be parsed. -
- - - Creates a new parser. - - - The factory method is effectively an optimization over using a generic constraint - to require a parameterless constructor: delegates are significantly faster to execute. - - Function to invoke when a new, empty message is required. - - - - Creates a template instance ready for population. - - An empty message. - - - - Parses a message from a byte array. - - The byte array containing the message. Must not be null. - The newly parsed message. - - - - Parses a message from a byte array slice. - - The byte array containing the message. Must not be null. - The offset of the slice to parse. - The length of the slice to parse. - The newly parsed message. - - - - Parses a message from the given byte string. - - The data to parse. - The parsed message. - - - - Parses a message from the given stream. - - The stream to parse. - The parsed message. - - - - Parses a message from the given sequence. - - The data to parse. - The parsed message. - - - - Parses a message from the given span. - - The data to parse. - The parsed message. - - - - Parses a length-delimited message from the given stream. - - - The stream is expected to contain a length and then the data. Only the amount of data - specified by the length will be consumed. - - The stream to parse. - The parsed message. - - - - Parses a message from the given coded input stream. - - The stream to parse. - The parsed message. - - - - Parses a message from the given JSON. - - The JSON to parse. - The parsed message. - The JSON does not comply with RFC 7159 - The JSON does not represent a Protocol Buffers message correctly - - - - Creates a new message parser which optionally discards unknown fields when parsing. - - Whether or not to discard unknown fields when parsing. - A newly configured message parser. - - - - Creates a new message parser which registers extensions from the specified registry upon creating the message instance - - The extensions to register - A newly configured message parser. - - - - Struct used to hold the keys for the fieldByNumber table in DescriptorPool and the keys for the - extensionByNumber table in ExtensionRegistry. - - - - - An opaque struct that represents the current parsing state and is passed along - as the parsing proceeds. - All the public methods are intended to be invoked only by the generated code, - users should never invoke them directly. - - - - - Initialize a , building all from defaults and - the given . - - - - - Initialize a using existing , e.g. from . - - - - - Creates a ParseContext instance from CodedInputStream. - WARNING: internally this copies the CodedInputStream's state, so after done with the ParseContext, - the CodedInputStream's state needs to be updated. - - - - - Returns the last tag read, or 0 if no tags have been read or we've read beyond - the end of the input. - - - - - Internal-only property; when set to true, unknown fields will be discarded while parsing. - - - - - Internal-only property; provides extension identifiers to compatible messages while parsing. - - - - - Reads a field tag, returning the tag of 0 for "end of input". - - - If this method returns 0, it doesn't necessarily mean the end of all - the data in this CodedInputReader; it may be the end of the logical input - for an embedded message, for example. - - The next field tag, or 0 for end of input. (0 is never a valid tag.) - - - - Reads a double field from the input. - - - - - Reads a float field from the input. - - - - - Reads a uint64 field from the input. - - - - - Reads an int64 field from the input. - - - - - Reads an int32 field from the input. - - - - - Reads a fixed64 field from the input. - - - - - Reads a fixed32 field from the input. - - - - - Reads a bool field from the input. - - - - - Reads a string field from the input. - - - - - Reads an embedded message field value from the input. - - - - - Reads an embedded group field from the input. - - - - - Reads a bytes field value from the input. - - - - - Reads a uint32 field value from the input. - - - - - Reads an enum field value from the input. - - - - - Reads an sfixed32 field value from the input. - - - - - Reads an sfixed64 field value from the input. - - - - - Reads an sint32 field value from the input. - - - - - Reads an sint64 field value from the input. - - - - - Reads a length for length-delimited data. - - - This is internally just reading a varint, but this method exists - to make the calling code clearer. - - - - - The position within the current buffer (i.e. the next byte to read) - - - - - Size of the current buffer - - - - - If we are currently inside a length-delimited block, this is the number of - bytes in the buffer that are still available once we leave the delimited block. - - - - - The absolute position of the end of the current length-delimited block (including totalBytesRetired) - - - - - The total number of consumed before the start of the current buffer. The - total bytes read up to the current position can be computed as - totalBytesRetired + bufferPos. - - - - - The last tag we read. 0 indicates we've read to the end of the stream - (or haven't read anything yet). - - - - - The next tag, used to store the value read by PeekTag. - - - - - Internal-only property; when set to true, unknown fields will be discarded while parsing. - - - - - Internal-only property; provides extension identifiers to compatible messages while parsing. - - - - - Primitives for parsing protobuf wire format. - - - - - Reads a length for length-delimited data. - - - This is internally just reading a varint, but this method exists - to make the calling code clearer. - - - - - Parses the next tag. - If the end of logical stream was reached, an invalid tag of 0 is returned. - - - - - Peeks at the next tag in the stream. If it matches , - the tag is consumed and the method returns true; otherwise, the - stream is left in the original position and the method returns false. - - - - - Peeks at the next field tag. This is like calling , but the - tag is not consumed. (So a subsequent call to will return the - same value.) - - - - - Parses a raw varint. - - - - - Parses a raw Varint. If larger than 32 bits, discard the upper bits. - This method is optimised for the case where we've got lots of data in the buffer. - That means we can check the size just once, then just read directly from the buffer - without constant rechecking of the buffer length. - - - - - Parses a 32-bit little-endian integer. - - - - - Parses a 64-bit little-endian integer. - - - - - Parses a double value. - - - - - Parses a float value. - - - - - Reads a fixed size of bytes from the input. - - - the end of the stream or the current limit was reached - - - - - Reads and discards bytes. - - the end of the stream - or the current limit was reached - - - - Reads a string field value from the input. - - - - - Reads a bytes field value from the input. - - - - - Reads a UTF-8 string from the next "length" bytes. - - - the end of the stream or the current limit was reached - - - - - Reads a string assuming that it is spread across multiple spans in a . - - - - - Validates that the specified size doesn't exceed the current limit. If it does then remaining bytes - are skipped and an error is thrown. - - - - - Reads a varint from the input one byte at a time, so that it does not - read any bytes after the end of the varint. If you simply wrapped the - stream in a CodedInputStream and used ReadRawVarint32(Stream) - then you would probably end up reading past the end of the varint since - CodedInputStream buffers its input. - - - - - - - Decode a 32-bit value with ZigZag encoding. - - - ZigZag encodes signed integers into values that can be efficiently - encoded with varint. (Otherwise, negative values must be - sign-extended to 32 bits to be varint encoded, thus always taking - 5 bytes on the wire.) - - - - - Decode a 64-bit value with ZigZag encoding. - - - ZigZag encodes signed integers into values that can be efficiently - encoded with varint. (Otherwise, negative values must be - sign-extended to 64 bits to be varint encoded, thus always taking - 10 bytes on the wire.) - - - - - Checks whether there is known data available of the specified size remaining to parse. - When parsing from a Stream this can return false because we have no knowledge of the amount - of data remaining in the stream until it is read. - - - - - Checks whether there is known data available of the specified size remaining to parse - in the underlying data source. - When parsing from a Stream this will return false because we have no knowledge of the amount - of data remaining in the stream until it is read. - - - - - Read raw bytes of the specified length into a span. The amount of data available and the current limit should - be checked before calling this method. - - - - - Reading and skipping messages / groups - - - - - Skip a group. - - - - - Verifies that the last call to ReadTag() returned tag 0 - in other words, - we've reached the end of the stream when we expected to. - - The - tag read was not the one specified - - - - Fast parsing primitives for wrapper types - - - - - Helper methods for throwing exceptions when preconditions are not met. - - - This class is used internally and by generated code; it is not particularly - expected to be used from application code, although nothing prevents it - from being used that way. - - - - - Throws an ArgumentNullException if the given value is null, otherwise - return the value to the caller. - - - - - Throws an ArgumentNullException if the given value is null, otherwise - return the value to the caller. - - - This is equivalent to but without the type parameter - constraint. In most cases, the constraint is useful to prevent you from calling CheckNotNull - with a value type - but it gets in the way if either you want to use it with a nullable - value type, or you want to use it with an unconstrained type parameter. - - - - - Container for a set of custom options specified within a message, field etc. - - - - This type is publicly immutable, but internally mutable. It is only populated - by the descriptor parsing code - by the time any user code is able to see an instance, - it will be fully initialized. - - - If an option is requested using the incorrect method, an answer may still be returned: all - of the numeric types are represented internally using 64-bit integers, for example. It is up to - the caller to ensure that they make the appropriate method call for the option they're interested in. - Note that enum options are simply stored as integers, so the value should be fetched using - and then cast appropriately. - - - Repeated options are currently not supported. Asking for a single value of an option - which was actually repeated will return the last value, except for message types where - all the set values are merged together. - - - - - - Retrieves a Boolean value for the specified option field. - - The field to fetch the value for. - The output variable to populate. - true if a suitable value for the field was found; false otherwise. - - - - Retrieves a signed 32-bit integer value for the specified option field. - - The field to fetch the value for. - The output variable to populate. - true if a suitable value for the field was found; false otherwise. - - - - Retrieves a signed 64-bit integer value for the specified option field. - - The field to fetch the value for. - The output variable to populate. - true if a suitable value for the field was found; false otherwise. - - - - Retrieves an unsigned 32-bit integer value for the specified option field, - assuming a fixed-length representation. - - The field to fetch the value for. - The output variable to populate. - true if a suitable value for the field was found; false otherwise. - - - - Retrieves an unsigned 64-bit integer value for the specified option field, - assuming a fixed-length representation. - - The field to fetch the value for. - The output variable to populate. - true if a suitable value for the field was found; false otherwise. - - - - Retrieves a signed 32-bit integer value for the specified option field, - assuming a fixed-length representation. - - The field to fetch the value for. - The output variable to populate. - true if a suitable value for the field was found; false otherwise. - - - - Retrieves a signed 64-bit integer value for the specified option field, - assuming a fixed-length representation. - - The field to fetch the value for. - The output variable to populate. - true if a suitable value for the field was found; false otherwise. - - - - Retrieves a signed 32-bit integer value for the specified option field, - assuming a zigzag encoding. - - The field to fetch the value for. - The output variable to populate. - true if a suitable value for the field was found; false otherwise. - - - - Retrieves a signed 64-bit integer value for the specified option field, - assuming a zigzag encoding. - - The field to fetch the value for. - The output variable to populate. - true if a suitable value for the field was found; false otherwise. - - - - Retrieves an unsigned 32-bit integer value for the specified option field. - - The field to fetch the value for. - The output variable to populate. - true if a suitable value for the field was found; false otherwise. - - - - Retrieves an unsigned 64-bit integer value for the specified option field. - - The field to fetch the value for. - The output variable to populate. - true if a suitable value for the field was found; false otherwise. - - - - Retrieves a 32-bit floating point value for the specified option field. - - The field to fetch the value for. - The output variable to populate. - true if a suitable value for the field was found; false otherwise. - - - - Retrieves a 64-bit floating point value for the specified option field. - - The field to fetch the value for. - The output variable to populate. - true if a suitable value for the field was found; false otherwise. - - - - Retrieves a string value for the specified option field. - - The field to fetch the value for. - The output variable to populate. - true if a suitable value for the field was found; false otherwise. - - - - Retrieves a bytes value for the specified option field. - - The field to fetch the value for. - The output variable to populate. - true if a suitable value for the field was found; false otherwise. - - - - Retrieves a message value for the specified option field. - - The field to fetch the value for. - The output variable to populate. - true if a suitable value for the field was found; false otherwise. - - - Holder for reflection information generated from google/protobuf/descriptor.proto - - - File descriptor for google/protobuf/descriptor.proto - - - - The protocol compiler can output a FileDescriptorSet containing the .proto - files it parses. - - - - Field number for the "file" field. - - - - Describes a complete .proto file. - - - - Field number for the "name" field. - - - - file name, relative to root of source tree - - - - Gets whether the "name" field is set - - - Clears the value of the "name" field - - - Field number for the "package" field. - - - - e.g. "foo", "foo.bar", etc. - - - - Gets whether the "package" field is set - - - Clears the value of the "package" field - - - Field number for the "dependency" field. - - - - Names of files imported by this file. - - - - Field number for the "public_dependency" field. - - - - Indexes of the public imported files in the dependency list above. - - - - Field number for the "weak_dependency" field. - - - - Indexes of the weak imported files in the dependency list. - For Google-internal migration only. Do not use. - - - - Field number for the "message_type" field. - - - - All top-level definitions in this file. - - - - Field number for the "enum_type" field. - - - Field number for the "service" field. - - - Field number for the "extension" field. - - - Field number for the "options" field. - - - Field number for the "source_code_info" field. - - - - This field contains optional information about the original source code. - You may safely remove this entire field without harming runtime - functionality of the descriptors -- the information is needed only by - development tools. - - - - Field number for the "syntax" field. - - - - The syntax of the proto file. - The supported values are "proto2" and "proto3". - - - - Gets whether the "syntax" field is set - - - Clears the value of the "syntax" field - - - - Describes a message type. - - - - Field number for the "name" field. - - - Gets whether the "name" field is set - - - Clears the value of the "name" field - - - Field number for the "field" field. - - - Field number for the "extension" field. - - - Field number for the "nested_type" field. - - - Field number for the "enum_type" field. - - - Field number for the "extension_range" field. - - - Field number for the "oneof_decl" field. - - - Field number for the "options" field. - - - Field number for the "reserved_range" field. - - - Field number for the "reserved_name" field. - - - - Reserved field names, which may not be used by fields in the same message. - A given name may only be reserved once. - - - - Container for nested types declared in the DescriptorProto message type. - - - Field number for the "start" field. - - - - Inclusive. - - - - Gets whether the "start" field is set - - - Clears the value of the "start" field - - - Field number for the "end" field. - - - - Exclusive. - - - - Gets whether the "end" field is set - - - Clears the value of the "end" field - - - Field number for the "options" field. - - - - Range of reserved tag numbers. Reserved tag numbers may not be used by - fields or extension ranges in the same message. Reserved ranges may - not overlap. - - - - Field number for the "start" field. - - - - Inclusive. - - - - Gets whether the "start" field is set - - - Clears the value of the "start" field - - - Field number for the "end" field. - - - - Exclusive. - - - - Gets whether the "end" field is set - - - Clears the value of the "end" field - - - Field number for the "uninterpreted_option" field. - - - - The parser stores options it doesn't recognize here. See above. - - - - - Describes a field within a message. - - - - Field number for the "name" field. - - - Gets whether the "name" field is set - - - Clears the value of the "name" field - - - Field number for the "number" field. - - - Gets whether the "number" field is set - - - Clears the value of the "number" field - - - Field number for the "label" field. - - - Gets whether the "label" field is set - - - Clears the value of the "label" field - - - Field number for the "type" field. - - - - If type_name is set, this need not be set. If both this and type_name - are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - - - - Gets whether the "type" field is set - - - Clears the value of the "type" field - - - Field number for the "type_name" field. - - - - For message and enum types, this is the name of the type. If the name - starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - rules are used to find the type (i.e. first the nested types within this - message are searched, then within the parent, on up to the root - namespace). - - - - Gets whether the "type_name" field is set - - - Clears the value of the "type_name" field - - - Field number for the "extendee" field. - - - - For extensions, this is the name of the type being extended. It is - resolved in the same manner as type_name. - - - - Gets whether the "extendee" field is set - - - Clears the value of the "extendee" field - - - Field number for the "default_value" field. - - - - For numeric types, contains the original text representation of the value. - For booleans, "true" or "false". - For strings, contains the default text contents (not escaped in any way). - For bytes, contains the C escaped value. All bytes >= 128 are escaped. - - - - Gets whether the "default_value" field is set - - - Clears the value of the "default_value" field - - - Field number for the "oneof_index" field. - - - - If set, gives the index of a oneof in the containing type's oneof_decl - list. This field is a member of that oneof. - - - - Gets whether the "oneof_index" field is set - - - Clears the value of the "oneof_index" field - - - Field number for the "json_name" field. - - - - JSON name of this field. The value is set by protocol compiler. If the - user has set a "json_name" option on this field, that option's value - will be used. Otherwise, it's deduced from the field's name by converting - it to camelCase. - - - - Gets whether the "json_name" field is set - - - Clears the value of the "json_name" field - - - Field number for the "options" field. - - - Field number for the "proto3_optional" field. - - - - If true, this is a proto3 "optional". When a proto3 field is optional, it - tracks presence regardless of field type. - - When proto3_optional is true, this field must be belong to a oneof to - signal to old proto3 clients that presence is tracked for this field. This - oneof is known as a "synthetic" oneof, and this field must be its sole - member (each proto3 optional field gets its own synthetic oneof). Synthetic - oneofs exist in the descriptor only, and do not generate any API. Synthetic - oneofs must be ordered after all "real" oneofs. - - For message fields, proto3_optional doesn't create any semantic change, - since non-repeated message fields always track presence. However it still - indicates the semantic detail of whether the user wrote "optional" or not. - This can be useful for round-tripping the .proto file. For consistency we - give message fields a synthetic oneof also, even though it is not required - to track presence. This is especially important because the parser can't - tell if a field is a message or an enum, so it must always create a - synthetic oneof. - - Proto2 optional fields do not set this flag, because they already indicate - optional with `LABEL_OPTIONAL`. - - - - Gets whether the "proto3_optional" field is set - - - Clears the value of the "proto3_optional" field - - - Container for nested types declared in the FieldDescriptorProto message type. - - - - 0 is reserved for errors. - Order is weird for historical reasons. - - - - - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - negative values are likely. - - - - - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - negative values are likely. - - - - - Tag-delimited aggregate. - Group type is deprecated and not supported in proto3. However, Proto3 - implementations should still be able to parse the group wire format and - treat group fields as unknown fields. - - - - - Length-delimited aggregate. - - - - - New in version 2. - - - - - Uses ZigZag encoding. - - - - - Uses ZigZag encoding. - - - - - 0 is reserved for errors - - - - - Describes a oneof. - - - - Field number for the "name" field. - - - Gets whether the "name" field is set - - - Clears the value of the "name" field - - - Field number for the "options" field. - - - - Describes an enum type. - - - - Field number for the "name" field. - - - Gets whether the "name" field is set - - - Clears the value of the "name" field - - - Field number for the "value" field. - - - Field number for the "options" field. - - - Field number for the "reserved_range" field. - - - - Range of reserved numeric values. Reserved numeric values may not be used - by enum values in the same enum declaration. Reserved ranges may not - overlap. - - - - Field number for the "reserved_name" field. - - - - Reserved enum value names, which may not be reused. A given name may only - be reserved once. - - - - Container for nested types declared in the EnumDescriptorProto message type. - - - - Range of reserved numeric values. Reserved values may not be used by - entries in the same enum. Reserved ranges may not overlap. - - Note that this is distinct from DescriptorProto.ReservedRange in that it - is inclusive such that it can appropriately represent the entire int32 - domain. - - - - Field number for the "start" field. - - - - Inclusive. - - - - Gets whether the "start" field is set - - - Clears the value of the "start" field - - - Field number for the "end" field. - - - - Inclusive. - - - - Gets whether the "end" field is set - - - Clears the value of the "end" field - - - - Describes a value within an enum. - - - - Field number for the "name" field. - - - Gets whether the "name" field is set - - - Clears the value of the "name" field - - - Field number for the "number" field. - - - Gets whether the "number" field is set - - - Clears the value of the "number" field - - - Field number for the "options" field. - - - - Describes a service. - - - - Field number for the "name" field. - - - Gets whether the "name" field is set - - - Clears the value of the "name" field - - - Field number for the "method" field. - - - Field number for the "options" field. - - - - Describes a method of a service. - - - - Field number for the "name" field. - - - Gets whether the "name" field is set - - - Clears the value of the "name" field - - - Field number for the "input_type" field. - - - - Input and output type names. These are resolved in the same way as - FieldDescriptorProto.type_name, but must refer to a message type. - - - - Gets whether the "input_type" field is set - - - Clears the value of the "input_type" field - - - Field number for the "output_type" field. - - - Gets whether the "output_type" field is set - - - Clears the value of the "output_type" field - - - Field number for the "options" field. - - - Field number for the "client_streaming" field. - - - - Identifies if client streams multiple client messages - - - - Gets whether the "client_streaming" field is set - - - Clears the value of the "client_streaming" field - - - Field number for the "server_streaming" field. - - - - Identifies if server streams multiple server messages - - - - Gets whether the "server_streaming" field is set - - - Clears the value of the "server_streaming" field - - - Field number for the "java_package" field. - - - - Sets the Java package where classes generated from this .proto will be - placed. By default, the proto package is used, but this is often - inappropriate because proto packages do not normally start with backwards - domain names. - - - - Gets whether the "java_package" field is set - - - Clears the value of the "java_package" field - - - Field number for the "java_outer_classname" field. - - - - Controls the name of the wrapper Java class generated for the .proto file. - That class will always contain the .proto file's getDescriptor() method as - well as any top-level extensions defined in the .proto file. - If java_multiple_files is disabled, then all the other classes from the - .proto file will be nested inside the single wrapper outer class. - - - - Gets whether the "java_outer_classname" field is set - - - Clears the value of the "java_outer_classname" field - - - Field number for the "java_multiple_files" field. - - - - If enabled, then the Java code generator will generate a separate .java - file for each top-level message, enum, and service defined in the .proto - file. Thus, these types will *not* be nested inside the wrapper class - named by java_outer_classname. However, the wrapper class will still be - generated to contain the file's getDescriptor() method as well as any - top-level extensions defined in the file. - - - - Gets whether the "java_multiple_files" field is set - - - Clears the value of the "java_multiple_files" field - - - Field number for the "java_generate_equals_and_hash" field. - - - - This option does nothing. - - - - Gets whether the "java_generate_equals_and_hash" field is set - - - Clears the value of the "java_generate_equals_and_hash" field - - - Field number for the "java_string_check_utf8" field. - - - - If set true, then the Java2 code generator will generate code that - throws an exception whenever an attempt is made to assign a non-UTF-8 - byte sequence to a string field. - Message reflection will do the same. - However, an extension field still accepts non-UTF-8 byte sequences. - This option has no effect on when used with the lite runtime. - - - - Gets whether the "java_string_check_utf8" field is set - - - Clears the value of the "java_string_check_utf8" field - - - Field number for the "optimize_for" field. - - - Gets whether the "optimize_for" field is set - - - Clears the value of the "optimize_for" field - - - Field number for the "go_package" field. - - - - Sets the Go package where structs generated from this .proto will be - placed. If omitted, the Go package will be derived from the following: - - The basename of the package import path, if provided. - - Otherwise, the package statement in the .proto file, if present. - - Otherwise, the basename of the .proto file, without extension. - - - - Gets whether the "go_package" field is set - - - Clears the value of the "go_package" field - - - Field number for the "cc_generic_services" field. - - - - Should generic services be generated in each language? "Generic" services - are not specific to any particular RPC system. They are generated by the - main code generators in each language (without additional plugins). - Generic services were the only kind of service generation supported by - early versions of google.protobuf. - - Generic services are now considered deprecated in favor of using plugins - that generate code specific to your particular RPC system. Therefore, - these default to false. Old code which depends on generic services should - explicitly set them to true. - - - - Gets whether the "cc_generic_services" field is set - - - Clears the value of the "cc_generic_services" field - - - Field number for the "java_generic_services" field. - - - Gets whether the "java_generic_services" field is set - - - Clears the value of the "java_generic_services" field - - - Field number for the "py_generic_services" field. - - - Gets whether the "py_generic_services" field is set - - - Clears the value of the "py_generic_services" field - - - Field number for the "php_generic_services" field. - - - Gets whether the "php_generic_services" field is set - - - Clears the value of the "php_generic_services" field - - - Field number for the "deprecated" field. - - - - Is this file deprecated? - Depending on the target platform, this can emit Deprecated annotations - for everything in the file, or it will be completely ignored; in the very - least, this is a formalization for deprecating files. - - - - Gets whether the "deprecated" field is set - - - Clears the value of the "deprecated" field - - - Field number for the "cc_enable_arenas" field. - - - - Enables the use of arenas for the proto messages in this file. This applies - only to generated classes for C++. - - - - Gets whether the "cc_enable_arenas" field is set - - - Clears the value of the "cc_enable_arenas" field - - - Field number for the "objc_class_prefix" field. - - - - Sets the objective c class prefix which is prepended to all objective c - generated classes from this .proto. There is no default. - - - - Gets whether the "objc_class_prefix" field is set - - - Clears the value of the "objc_class_prefix" field - - - Field number for the "csharp_namespace" field. - - - - Namespace for generated classes; defaults to the package. - - - - Gets whether the "csharp_namespace" field is set - - - Clears the value of the "csharp_namespace" field - - - Field number for the "swift_prefix" field. - - - - By default Swift generators will take the proto package and CamelCase it - replacing '.' with underscore and use that to prefix the types/symbols - defined. When this options is provided, they will use this value instead - to prefix the types/symbols defined. - - - - Gets whether the "swift_prefix" field is set - - - Clears the value of the "swift_prefix" field - - - Field number for the "php_class_prefix" field. - - - - Sets the php class prefix which is prepended to all php generated classes - from this .proto. Default is empty. - - - - Gets whether the "php_class_prefix" field is set - - - Clears the value of the "php_class_prefix" field - - - Field number for the "php_namespace" field. - - - - Use this option to change the namespace of php generated classes. Default - is empty. When this option is empty, the package name will be used for - determining the namespace. - - - - Gets whether the "php_namespace" field is set - - - Clears the value of the "php_namespace" field - - - Field number for the "php_metadata_namespace" field. - - - - Use this option to change the namespace of php generated metadata classes. - Default is empty. When this option is empty, the proto file name will be - used for determining the namespace. - - - - Gets whether the "php_metadata_namespace" field is set - - - Clears the value of the "php_metadata_namespace" field - - - Field number for the "ruby_package" field. - - - - Use this option to change the package of ruby generated classes. Default - is empty. When this option is not set, the package name will be used for - determining the ruby package. - - - - Gets whether the "ruby_package" field is set - - - Clears the value of the "ruby_package" field - - - Field number for the "uninterpreted_option" field. - - - - The parser stores options it doesn't recognize here. - See the documentation for the "Options" section above. - - - - Container for nested types declared in the FileOptions message type. - - - - Generated classes can be optimized for speed or code size. - - - - - Generate complete code for parsing, serialization, - - - - - etc. - - - - - Generate code using MessageLite and the lite runtime. - - - - Field number for the "message_set_wire_format" field. - - - - Set true to use the old proto1 MessageSet wire format for extensions. - This is provided for backwards-compatibility with the MessageSet wire - format. You should not use this for any other reason: It's less - efficient, has fewer features, and is more complicated. - - The message must be defined exactly as follows: - message Foo { - option message_set_wire_format = true; - extensions 4 to max; - } - Note that the message cannot have any defined fields; MessageSets only - have extensions. - - All extensions of your type must be singular messages; e.g. they cannot - be int32s, enums, or repeated messages. - - Because this is an option, the above two restrictions are not enforced by - the protocol compiler. - - - - Gets whether the "message_set_wire_format" field is set - - - Clears the value of the "message_set_wire_format" field - - - Field number for the "no_standard_descriptor_accessor" field. - - - - Disables the generation of the standard "descriptor()" accessor, which can - conflict with a field of the same name. This is meant to make migration - from proto1 easier; new code should avoid fields named "descriptor". - - - - Gets whether the "no_standard_descriptor_accessor" field is set - - - Clears the value of the "no_standard_descriptor_accessor" field - - - Field number for the "deprecated" field. - - - - Is this message deprecated? - Depending on the target platform, this can emit Deprecated annotations - for the message, or it will be completely ignored; in the very least, - this is a formalization for deprecating messages. - - - - Gets whether the "deprecated" field is set - - - Clears the value of the "deprecated" field - - - Field number for the "map_entry" field. - - - - Whether the message is an automatically generated map entry type for the - maps field. - - For maps fields: - map<KeyType, ValueType> map_field = 1; - The parsed descriptor looks like: - message MapFieldEntry { - option map_entry = true; - optional KeyType key = 1; - optional ValueType value = 2; - } - repeated MapFieldEntry map_field = 1; - - Implementations may choose not to generate the map_entry=true message, but - use a native map in the target language to hold the keys and values. - The reflection APIs in such implementations still need to work as - if the field is a repeated message field. - - NOTE: Do not set the option in .proto files. Always use the maps syntax - instead. The option should only be implicitly set by the proto compiler - parser. - - - - Gets whether the "map_entry" field is set - - - Clears the value of the "map_entry" field - - - Field number for the "uninterpreted_option" field. - - - - The parser stores options it doesn't recognize here. See above. - - - - Field number for the "ctype" field. - - - - The ctype option instructs the C++ code generator to use a different - representation of the field than it normally would. See the specific - options below. This option is not yet implemented in the open source - release -- sorry, we'll try to include it in a future version! - - - - Gets whether the "ctype" field is set - - - Clears the value of the "ctype" field - - - Field number for the "packed" field. - - - - The packed option can be enabled for repeated primitive fields to enable - a more efficient representation on the wire. Rather than repeatedly - writing the tag and type for each element, the entire array is encoded as - a single length-delimited blob. In proto3, only explicit setting it to - false will avoid using packed encoding. - - - - Gets whether the "packed" field is set - - - Clears the value of the "packed" field - - - Field number for the "jstype" field. - - - - The jstype option determines the JavaScript type used for values of the - field. The option is permitted only for 64 bit integral and fixed types - (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - is represented as JavaScript string, which avoids loss of precision that - can happen when a large value is converted to a floating point JavaScript. - Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - use the JavaScript "number" type. The behavior of the default option - JS_NORMAL is implementation dependent. - - This option is an enum to permit additional types to be added, e.g. - goog.math.Integer. - - - - Gets whether the "jstype" field is set - - - Clears the value of the "jstype" field - - - Field number for the "lazy" field. - - - - Should this field be parsed lazily? Lazy applies only to message-type - fields. It means that when the outer message is initially parsed, the - inner message's contents will not be parsed but instead stored in encoded - form. The inner message will actually be parsed when it is first accessed. - - This is only a hint. Implementations are free to choose whether to use - eager or lazy parsing regardless of the value of this option. However, - setting this option true suggests that the protocol author believes that - using lazy parsing on this field is worth the additional bookkeeping - overhead typically needed to implement it. - - This option does not affect the public interface of any generated code; - all method signatures remain the same. Furthermore, thread-safety of the - interface is not affected by this option; const methods remain safe to - call from multiple threads concurrently, while non-const methods continue - to require exclusive access. - - Note that implementations may choose not to check required fields within - a lazy sub-message. That is, calling IsInitialized() on the outer message - may return true even if the inner message has missing required fields. - This is necessary because otherwise the inner message would have to be - parsed in order to perform the check, defeating the purpose of lazy - parsing. An implementation which chooses not to check required fields - must be consistent about it. That is, for any particular sub-message, the - implementation must either *always* check its required fields, or *never* - check its required fields, regardless of whether or not the message has - been parsed. - - As of 2021, lazy does no correctness checks on the byte stream during - parsing. This may lead to crashes if and when an invalid byte stream is - finally parsed upon access. - - TODO(b/211906113): Enable validation on lazy fields. - - - - Gets whether the "lazy" field is set - - - Clears the value of the "lazy" field - - - Field number for the "unverified_lazy" field. - - - - unverified_lazy does no correctness checks on the byte stream. This should - only be used where lazy with verification is prohibitive for performance - reasons. - - - - Gets whether the "unverified_lazy" field is set - - - Clears the value of the "unverified_lazy" field - - - Field number for the "deprecated" field. - - - - Is this field deprecated? - Depending on the target platform, this can emit Deprecated annotations - for accessors, or it will be completely ignored; in the very least, this - is a formalization for deprecating fields. - - - - Gets whether the "deprecated" field is set - - - Clears the value of the "deprecated" field - - - Field number for the "weak" field. - - - - For Google-internal migration only. Do not use. - - - - Gets whether the "weak" field is set - - - Clears the value of the "weak" field - - - Field number for the "uninterpreted_option" field. - - - - The parser stores options it doesn't recognize here. See above. - - - - Container for nested types declared in the FieldOptions message type. - - - - Default mode. - - - - - Use the default type. - - - - - Use JavaScript strings. - - - - - Use JavaScript numbers. - - - - Field number for the "uninterpreted_option" field. - - - - The parser stores options it doesn't recognize here. See above. - - - - Field number for the "allow_alias" field. - - - - Set this option to true to allow mapping different tag names to the same - value. - - - - Gets whether the "allow_alias" field is set - - - Clears the value of the "allow_alias" field - - - Field number for the "deprecated" field. - - - - Is this enum deprecated? - Depending on the target platform, this can emit Deprecated annotations - for the enum, or it will be completely ignored; in the very least, this - is a formalization for deprecating enums. - - - - Gets whether the "deprecated" field is set - - - Clears the value of the "deprecated" field - - - Field number for the "uninterpreted_option" field. - - - - The parser stores options it doesn't recognize here. See above. - - - - Field number for the "deprecated" field. - - - - Is this enum value deprecated? - Depending on the target platform, this can emit Deprecated annotations - for the enum value, or it will be completely ignored; in the very least, - this is a formalization for deprecating enum values. - - - - Gets whether the "deprecated" field is set - - - Clears the value of the "deprecated" field - - - Field number for the "uninterpreted_option" field. - - - - The parser stores options it doesn't recognize here. See above. - - - - Field number for the "deprecated" field. - - - - Is this service deprecated? - Depending on the target platform, this can emit Deprecated annotations - for the service, or it will be completely ignored; in the very least, - this is a formalization for deprecating services. - - - - Gets whether the "deprecated" field is set - - - Clears the value of the "deprecated" field - - - Field number for the "uninterpreted_option" field. - - - - The parser stores options it doesn't recognize here. See above. - - - - Field number for the "deprecated" field. - - - - Is this method deprecated? - Depending on the target platform, this can emit Deprecated annotations - for the method, or it will be completely ignored; in the very least, - this is a formalization for deprecating methods. - - - - Gets whether the "deprecated" field is set - - - Clears the value of the "deprecated" field - - - Field number for the "idempotency_level" field. - - - Gets whether the "idempotency_level" field is set - - - Clears the value of the "idempotency_level" field - - - Field number for the "uninterpreted_option" field. - - - - The parser stores options it doesn't recognize here. See above. - - - - Container for nested types declared in the MethodOptions message type. - - - - Is this method side-effect-free (or safe in HTTP parlance), or idempotent, - or neither? HTTP based RPC implementation may choose GET verb for safe - methods, and PUT verb for idempotent methods instead of the default POST. - - - - - implies idempotent - - - - - idempotent, but may have side effects - - - - - A message representing a option the parser does not recognize. This only - appears in options protos created by the compiler::Parser class. - DescriptorPool resolves these when building Descriptor objects. Therefore, - options protos in descriptor objects (e.g. returned by Descriptor::options(), - or produced by Descriptor::CopyTo()) will never have UninterpretedOptions - in them. - - - - Field number for the "name" field. - - - Field number for the "identifier_value" field. - - - - The value of the uninterpreted option, in whatever type the tokenizer - identified it as during parsing. Exactly one of these should be set. - - - - Gets whether the "identifier_value" field is set - - - Clears the value of the "identifier_value" field - - - Field number for the "positive_int_value" field. - - - Gets whether the "positive_int_value" field is set - - - Clears the value of the "positive_int_value" field - - - Field number for the "negative_int_value" field. - - - Gets whether the "negative_int_value" field is set - - - Clears the value of the "negative_int_value" field - - - Field number for the "double_value" field. - - - Gets whether the "double_value" field is set - - - Clears the value of the "double_value" field - - - Field number for the "string_value" field. - - - Gets whether the "string_value" field is set - - - Clears the value of the "string_value" field - - - Field number for the "aggregate_value" field. - - - Gets whether the "aggregate_value" field is set - - - Clears the value of the "aggregate_value" field - - - Container for nested types declared in the UninterpretedOption message type. - - - - The name of the uninterpreted option. Each string represents a segment in - a dot-separated name. is_extension is true iff a segment represents an - extension (denoted with parentheses in options specs in .proto files). - E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents - "foo.(bar.baz).moo". - - - - Field number for the "name_part" field. - - - Gets whether the "name_part" field is set - - - Clears the value of the "name_part" field - - - Field number for the "is_extension" field. - - - Gets whether the "is_extension" field is set - - - Clears the value of the "is_extension" field - - - - Encapsulates information about the original source file from which a - FileDescriptorProto was generated. - - - - Field number for the "location" field. - - - - A Location identifies a piece of source code in a .proto file which - corresponds to a particular definition. This information is intended - to be useful to IDEs, code indexers, documentation generators, and similar - tools. - - For example, say we have a file like: - message Foo { - optional string foo = 1; - } - Let's look at just the field definition: - optional string foo = 1; - ^ ^^ ^^ ^ ^^^ - a bc de f ghi - We have the following locations: - span path represents - [a,i) [ 4, 0, 2, 0 ] The whole field definition. - [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - - Notes: - - A location may refer to a repeated field itself (i.e. not to any - particular index within it). This is used whenever a set of elements are - logically enclosed in a single code segment. For example, an entire - extend block (possibly containing multiple extension definitions) will - have an outer location whose path refers to the "extensions" repeated - field without an index. - - Multiple locations may have the same path. This happens when a single - logical declaration is spread out across multiple places. The most - obvious example is the "extend" block again -- there may be multiple - extend blocks in the same scope, each of which will have the same path. - - A location's span is not always a subset of its parent's span. For - example, the "extendee" of an extension declaration appears at the - beginning of the "extend" block and is shared by all extensions within - the block. - - Just because a location's span is a subset of some other location's span - does not mean that it is a descendant. For example, a "group" defines - both a type and a field in a single declaration. Thus, the locations - corresponding to the type and field and their components will overlap. - - Code which tries to interpret locations should probably be designed to - ignore those that it doesn't understand, as more types of locations could - be recorded in the future. - - - - Container for nested types declared in the SourceCodeInfo message type. - - - Field number for the "path" field. - - - - Identifies which part of the FileDescriptorProto was defined at this - location. - - Each element is a field number or an index. They form a path from - the root FileDescriptorProto to the place where the definition occurs. - For example, this path: - [ 4, 3, 2, 7, 1 ] - refers to: - file.message_type(3) // 4, 3 - .field(7) // 2, 7 - .name() // 1 - This is because FileDescriptorProto.message_type has field number 4: - repeated DescriptorProto message_type = 4; - and DescriptorProto.field has field number 2: - repeated FieldDescriptorProto field = 2; - and FieldDescriptorProto.name has field number 1: - optional string name = 1; - - Thus, the above path gives the location of a field name. If we removed - the last element: - [ 4, 3, 2, 7 ] - this path refers to the whole field declaration (from the beginning - of the label to the terminating semicolon). - - - - Field number for the "span" field. - - - - Always has exactly three or four elements: start line, start column, - end line (optional, otherwise assumed same as start line), end column. - These are packed into a single field for efficiency. Note that line - and column numbers are zero-based -- typically you will want to add - 1 to each before displaying to a user. - - - - Field number for the "leading_comments" field. - - - - If this SourceCodeInfo represents a complete declaration, these are any - comments appearing before and after the declaration which appear to be - attached to the declaration. - - A series of line comments appearing on consecutive lines, with no other - tokens appearing on those lines, will be treated as a single comment. - - leading_detached_comments will keep paragraphs of comments that appear - before (but not connected to) the current element. Each paragraph, - separated by empty lines, will be one comment element in the repeated - field. - - Only the comment content is provided; comment markers (e.g. //) are - stripped out. For block comments, leading whitespace and an asterisk - will be stripped from the beginning of each line other than the first. - Newlines are included in the output. - - Examples: - - optional int32 foo = 1; // Comment attached to foo. - // Comment attached to bar. - optional int32 bar = 2; - - optional string baz = 3; - // Comment attached to baz. - // Another line attached to baz. - - // Comment attached to moo. - // - // Another line attached to moo. - optional double moo = 4; - - // Detached comment for corge. This is not leading or trailing comments - // to moo or corge because there are blank lines separating it from - // both. - - // Detached comment for corge paragraph 2. - - optional string corge = 5; - /* Block comment attached - * to corge. Leading asterisks - * will be removed. */ - /* Block comment attached to - * grault. */ - optional int32 grault = 6; - - // ignored detached comments. - - - - Gets whether the "leading_comments" field is set - - - Clears the value of the "leading_comments" field - - - Field number for the "trailing_comments" field. - - - Gets whether the "trailing_comments" field is set - - - Clears the value of the "trailing_comments" field - - - Field number for the "leading_detached_comments" field. - - - - Describes the relationship between generated code and its original source - file. A GeneratedCodeInfo message is associated with only one generated - source file, but may contain references to different source .proto files. - - - - Field number for the "annotation" field. - - - - An Annotation connects some span of text in generated code to an element - of its generating .proto file. - - - - Container for nested types declared in the GeneratedCodeInfo message type. - - - Field number for the "path" field. - - - - Identifies the element in the original source .proto file. This field - is formatted the same as SourceCodeInfo.Location.path. - - - - Field number for the "source_file" field. - - - - Identifies the filesystem path to the original source .proto. - - - - Gets whether the "source_file" field is set - - - Clears the value of the "source_file" field - - - Field number for the "begin" field. - - - - Identifies the starting offset in bytes in the generated code - that relates to the identified object. - - - - Gets whether the "begin" field is set - - - Clears the value of the "begin" field - - - Field number for the "end" field. - - - - Identifies the ending offset in bytes in the generated code that - relates to the identified offset. The end offset should be one past - the last relevant byte (so the length of the text = end - begin). - - - - Gets whether the "end" field is set - - - Clears the value of the "end" field - - - - Base class for nearly all descriptors, providing common functionality. - - - - - The index of this descriptor within its parent descriptor. - - - This returns the index of this descriptor within its parent, for - this descriptor's type. (There can be duplicate values for different - types, e.g. one enum type with index 0 and one message type with index 0.) - - - - - Returns the name of the entity (field, message etc) being described. - - - - - The fully qualified name of the descriptor's target. - - - - - The file this descriptor was declared in. - - - - - The declaration information about the descriptor, or null if no declaration information - is available for this descriptor. - - - This information is typically only available for dynamically loaded descriptors, - for example within a protoc plugin where the full descriptors, including source info, - are passed to the code by protoc. - - - - - Retrieves the list of nested descriptors corresponding to the given field number, if any. - If the field is unknown or not a nested descriptor list, return null to terminate the search. - The default implementation returns null. - - - - - Provides additional information about the declaration of a descriptor, - such as source location and comments. - - - - - The descriptor this declaration relates to. - - - - - The start line of the declaration within the source file. This value is 1-based. - - - - - The start column of the declaration within the source file. This value is 1-based. - - - - - // The end line of the declaration within the source file. This value is 1-based. - - - - - The end column of the declaration within the source file. This value is 1-based, and - exclusive. (The final character of the declaration is on the column before this value.) - - - - - Comments appearing before the declaration. Never null, but may be empty. Multi-line comments - are represented as a newline-separated string. Leading whitespace and the comment marker ("//") - are removed from each line. - - - - - Comments appearing after the declaration. Never null, but may be empty. Multi-line comments - are represented as a newline-separated string. Leading whitespace and the comment marker ("//") - are removed from each line. - - - - - Comments appearing before the declaration, but separated from it by blank - lines. Each string represents a newline-separated paragraph of comments. - Leading whitespace and the comment marker ("//") are removed from each line. - The list is never null, but may be empty. Likewise each element is never null, but may be empty. - - - - - Contains lookup tables containing all the descriptors defined in a particular file. - - - - - Finds a symbol of the given name within the pool. - - The type of symbol to look for - Fully-qualified name to look up - The symbol with the given name and type, - or null if the symbol doesn't exist or has the wrong type - - - - Adds a package to the symbol tables. If a package by the same name - already exists, that is fine, but if some other kind of symbol - exists under the same name, an exception is thrown. If the package - has multiple components, this also adds the parent package(s). - - - - - Adds a symbol to the symbol table. - - The symbol already existed - in the symbol table. - - - - Verifies that the descriptor's name is valid (i.e. it contains - only letters, digits and underscores, and does not start with a digit). - - - - - - Returns the field with the given number in the given descriptor, - or null if it can't be found. - - - - - Adds a field to the fieldsByNumber table. - - A field with the same - containing type and number already exists. - - - - Adds an enum value to the enumValuesByNumber table. If an enum value - with the same type and number already exists, this method does nothing. - (This is allowed; the first value defined with the number takes precedence.) - - - - - Looks up a descriptor by name, relative to some other descriptor. - The name may be fully-qualified (with a leading '.'), partially-qualified, - or unqualified. C++-like name lookup semantics are used to search for the - matching descriptor. - - - This isn't heavily optimized, but it's only used during cross linking anyway. - If it starts being used more widely, we should look at performance more carefully. - - - - - Internal class containing utility methods when working with descriptors. - - - - - Equivalent to Func[TInput, int, TOutput] but usable in .NET 2.0. Only used to convert - arrays. - - - - - Converts the given array into a read-only list, applying the specified conversion to - each input element. - - - - - Thrown when building descriptors fails because the source DescriptorProtos - are not valid. - - - - - The full name of the descriptor where the error occurred. - - - - - A human-readable description of the error. (The Message property - is made up of the descriptor's name and this description.) - - - - - Descriptor for an enum type in a .proto file. - - - - - Returns a clone of the underlying describing this enum. - Note that a copy is taken every time this method is called, so clients using it frequently - (and not modifying it) may want to cache the returned value. - - A protobuf representation of this enum descriptor. - - - - The brief name of the descriptor's target. - - - - - The CLR type for this enum. For generated code, this will be a CLR enum type. - - - - - If this is a nested type, get the outer descriptor, otherwise null. - - - - - An unmodifiable list of defined value descriptors for this enum. - - - - - Finds an enum value by number. If multiple enum values have the - same number, this returns the first defined value with that number. - If there is no value for the given number, this returns null. - - - - - Finds an enum value by name. - - The unqualified name of the value (e.g. "FOO"). - The value's descriptor, or null if not found. - - - - The (possibly empty) set of custom options for this enum. - - - - - The EnumOptions, defined in descriptor.proto. - If the options message is not present (i.e. there are no options), null is returned. - Custom options can be retrieved as extensions of the returned message. - NOTE: A defensive copy is created each time this property is retrieved. - - - - - Gets a single value enum option for this descriptor - - - - - Gets a repeated value enum option for this descriptor - - - - - Descriptor for a single enum value within an enum in a .proto file. - - - - - Returns a clone of the underlying describing this enum value. - Note that a copy is taken every time this method is called, so clients using it frequently - (and not modifying it) may want to cache the returned value. - - A protobuf representation of this enum value descriptor. - - - - Returns the name of the enum value described by this object. - - - - - Returns the number associated with this enum value. - - - - - Returns the enum descriptor that this value is part of. - - - - - The (possibly empty) set of custom options for this enum value. - - - - - The EnumValueOptions, defined in descriptor.proto. - If the options message is not present (i.e. there are no options), null is returned. - Custom options can be retrieved as extensions of the returned message. - NOTE: A defensive copy is created each time this property is retrieved. - - - - - Gets a single value enum value option for this descriptor - - - - - Gets a repeated value enum value option for this descriptor - - - - - A collection to simplify retrieving the descriptors of extensions in a descriptor for a message - - - - - Returns a readonly list of all the extensions defined in this type in - the order they were defined in the source .proto file - - - - - Returns a readonly list of all the extensions define in this type that extend - the provided descriptor type in the order they were defined in the source .proto file - - - - - Returns a readonly list of all the extensions define in this type that extend - the provided descriptor type in ascending field order - - - - - Base class for field accessors. - - - - - Descriptor for a field or extension within a message in a .proto file. - - - - - Get the field's containing message type, or null if it is a field defined at the top level of a file as an extension. - - - - - Returns the oneof containing this field, or null if it is not part of a oneof. - - - - - Returns the oneof containing this field if it's a "real" oneof, or null if either this - field is not part of a oneof, or the oneof is synthetic. - - - - - The effective JSON name for this field. This is usually the lower-camel-cased form of the field name, - but can be overridden using the json_name option in the .proto file. - - - - - The name of the property in the ContainingType.ClrType class. - - - - - Indicates whether this field supports presence, either implicitly (e.g. due to it being a message - type field) or explicitly via Has/Clear members. If this returns true, it is safe to call - and - on this field's accessor with a suitable message. - - - - - Returns a clone of the underlying describing this field. - Note that a copy is taken every time this method is called, so clients using it frequently - (and not modifying it) may want to cache the returned value. - - A protobuf representation of this field descriptor. - - - - An extension identifier for this field, or null if this field isn't an extension. - - - - - The brief name of the descriptor's target. - - - - - Returns the accessor for this field. - - - - While a describes the field, it does not provide - any way of obtaining or changing the value of the field within a specific message; - that is the responsibility of the accessor. - - - In descriptors for generated code, the value returned by this property will be non-null for all - regular fields. However, if a message containing a map field is introspected, the list of nested messages will include - an auto-generated nested key/value pair message for the field. This is not represented in any - generated type, and the value of the map field itself is represented by a dictionary in the - reflection API. There are never instances of those "hidden" messages, so no accessor is provided - and this property will return null. - - - In dynamically loaded descriptors, the value returned by this property will current be null; - if and when dynamic messages are supported, it will return a suitable accessor to work with - them. - - - - - - Maps a field type as included in the .proto file to a FieldType. - - - - - Returns true if this field is a repeated field; false otherwise. - - - - - Returns true if this field is a required field; false otherwise. - - - - - Returns true if this field is a map field; false otherwise. - - - - - Returns true if this field is a packed, repeated field; false otherwise. - - - - - Returns true if this field extends another message type; false otherwise. - - - - - Returns the type of the field. - - - - - Returns the field number declared in the proto file. - - - - - Compares this descriptor with another one, ordering in "canonical" order - which simply means ascending order by field number. - must be a field of the same type, i.e. the of - both fields must be the same. - - - - - For enum fields, returns the field's type. - - - - - For embedded message and group fields, returns the field's type. - - - - - For extension fields, returns the extended type - - - - - The (possibly empty) set of custom options for this field. - - - - - The FieldOptions, defined in descriptor.proto. - If the options message is not present (i.e. there are no options), null is returned. - Custom options can be retrieved as extensions of the returned message. - NOTE: A defensive copy is created each time this property is retrieved. - - - - - Gets a single value field option for this descriptor - - - - - Gets a repeated value field option for this descriptor - - - - - Look up and cross-link all field types etc. - - - - - Enumeration of all the possible field types. - - - - - The double field type. - - - - - The float field type. - - - - - The int64 field type. - - - - - The uint64 field type. - - - - - The int32 field type. - - - - - The fixed64 field type. - - - - - The fixed32 field type. - - - - - The bool field type. - - - - - The string field type. - - - - - The field type used for groups. - - - - - The field type used for message fields. - - - - - The bytes field type. - - - - - The uint32 field type. - - - - - The sfixed32 field type. - - - - - The sfixed64 field type. - - - - - The sint32 field type. - - - - - The sint64 field type. - - - - - The field type used for enum fields. - - - - - The syntax of a .proto file - - - - - Proto2 syntax - - - - - Proto3 syntax - - - - - An unknown declared syntax - - - - - Describes a .proto file, including everything defined within. - IDescriptor is implemented such that the File property returns this descriptor, - and the FullName is the same as the Name. - - - - - Computes the full name of a descriptor within this file, with an optional parent message. - - - - - Extracts public dependencies from direct dependencies. This is a static method despite its - first parameter, as the value we're in the middle of constructing is only used for exceptions. - - - - - The descriptor in its protocol message representation. - - - - - Returns a clone of the underlying describing this file. - Note that a copy is taken every time this method is called, so clients using it frequently - (and not modifying it) may want to cache the returned value. - - A protobuf representation of this file descriptor. - - - - The syntax of the file - - - - - The file name. - - - - - The package as declared in the .proto file. This may or may not - be equivalent to the .NET namespace of the generated classes. - - - - - Unmodifiable list of top-level message types declared in this file. - - - - - Unmodifiable list of top-level enum types declared in this file. - - - - - Unmodifiable list of top-level services declared in this file. - - - - - Unmodifiable list of top-level extensions declared in this file. - Note that some extensions may be incomplete (FieldDescriptor.Extension may be null) - if this descriptor was generated using a version of protoc that did not fully - support extensions in C#. - - - - - Unmodifiable list of this file's dependencies (imports). - - - - - Unmodifiable list of this file's public dependencies (public imports). - - - - - The original serialized binary form of this descriptor. - - - - - Implementation of IDescriptor.FullName - just returns the same as Name. - - - - - Implementation of IDescriptor.File - just returns this descriptor. - - - - - Pool containing symbol descriptors. - - - - - Finds a type (message, enum, service or extension) in the file by name. Does not find nested types. - - The unqualified type name to look for. - The type of descriptor to look for - The type's descriptor, or null if not found. - - - - Builds a FileDescriptor from its protocol buffer representation. - - The original serialized descriptor data. - We have only limited proto2 support, so serializing FileDescriptorProto - would not necessarily give us this. - The protocol message form of the FileDescriptor. - FileDescriptors corresponding to all of the - file's dependencies, in the exact order listed in the .proto file. May be null, - in which case it is treated as an empty array. - Whether unknown dependencies are ignored (true) or cause an exception to be thrown (false). - Details about generated code, for the purposes of reflection. - If is not - a valid descriptor. This can occur for a number of reasons, such as a field - having an undefined type or because two messages were defined with the same name. - - - - Creates a descriptor for generated code. - - - This method is only designed to be used by the results of generating code with protoc, - which creates the appropriate dependencies etc. It has to be public because the generated - code is "external", but should not be called directly by end users. - - - - - Converts the given descriptor binary data into FileDescriptor objects. - Note: reflection using the returned FileDescriptors is not currently supported. - - The binary file descriptor proto data. Must not be null, and any - dependencies must come before the descriptor which depends on them. (If A depends on B, and B - depends on C, then the descriptors must be presented in the order C, B, A.) This is compatible - with the order in which protoc provides descriptors to plugins. - The extension registry to use when parsing, or null if no extensions are required. - The file descriptors corresponding to . - - - - Converts the given descriptor binary data into FileDescriptor objects. - Note: reflection using the returned FileDescriptors is not currently supported. - - The binary file descriptor proto data. Must not be null, and any - dependencies must come before the descriptor which depends on them. (If A depends on B, and B - depends on C, then the descriptors must be presented in the order C, B, A.) This is compatible - with the order in which protoc provides descriptors to plugins. - The file descriptors corresponding to . - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Returns the file descriptor for descriptor.proto. - - - This is used for protos which take a direct dependency on descriptor.proto, typically for - annotations. While descriptor.proto is a proto2 file, it is built into the Google.Protobuf - runtime for reflection purposes. The messages are internal to the runtime as they would require - proto2 semantics for full support, but the file descriptor is available via this property. The - C# codegen in protoc automatically uses this property when it detects a dependency on descriptor.proto. - - - The file descriptor for descriptor.proto. - - - - - The (possibly empty) set of custom options for this file. - - - - - The FileOptions, defined in descriptor.proto. - If the options message is not present (i.e. there are no options), null is returned. - Custom options can be retrieved as extensions of the returned message. - NOTE: A defensive copy is created each time this property is retrieved. - - - - - Gets a single value file option for this descriptor - - - - - Gets a repeated value file option for this descriptor - - - - - Performs initialization for the given generic type argument. - - - This method is present for the sake of AOT compilers. It allows code (whether handwritten or generated) - to make calls into the reflection machinery of this library to express an intention to use that type - reflectively (e.g. for JSON parsing and formatting). The call itself does almost nothing, but AOT compilers - attempting to determine which generic type arguments need to be handled will spot the code path and act - accordingly. - - The type to force initialization for. - - - - Extra information provided by generated code when initializing a message or file descriptor. - These are constructed as required, and are not long-lived. Hand-written code should - never need to use this type. - - - - - Irrelevant for file descriptors; the CLR type for the message for message descriptors. - - - - - Irrelevant for file descriptors; the parser for message descriptors. - - - - - Irrelevant for file descriptors; the CLR property names (in message descriptor field order) - for fields in the message for message descriptors. - - - - - The extensions defined within this file/message descriptor - - - - - Irrelevant for file descriptors; the CLR property "base" names (in message descriptor oneof order) - for oneofs in the message for message descriptors. It is expected that for a oneof name of "Foo", - there will be a "FooCase" property and a "ClearFoo" method. - - - - - The reflection information for types within this file/message descriptor. Elements may be null - if there is no corresponding generated type, e.g. for map entry types. - - - - - The CLR types for enums within this file/message descriptor. - - - - - Creates a GeneratedClrTypeInfo for a message descriptor, with nested types, nested enums, the CLR type, property names and oneof names. - Each array parameter may be null, to indicate a lack of values. - The parameter order is designed to make it feasible to format the generated code readably. - - - - - Creates a GeneratedClrTypeInfo for a message descriptor, with nested types, nested enums, the CLR type, property names and oneof names. - Each array parameter may be null, to indicate a lack of values. - The parameter order is designed to make it feasible to format the generated code readably. - - - - - Creates a GeneratedClrTypeInfo for a file descriptor, with only types, enums, and extensions. - - - - - Creates a GeneratedClrTypeInfo for a file descriptor, with only types and enums. - - - - - Interface implemented by all descriptor types. - - - - - Returns the name of the entity (message, field etc) being described. - - - - - Returns the fully-qualified name of the entity being described. - - - - - Returns the descriptor for the .proto file that this entity is part of. - - - - - Allows fields to be reflectively accessed. - - - - - Returns the descriptor associated with this field. - - - - - Clears the field in the specified message. (For repeated fields, - this clears the list.) - - - - - Fetches the field value. For repeated values, this will be an - implementation. For map values, this will be an - implementation. - - - - - Indicates whether the field in the specified message is set. - For proto3 fields that aren't explicitly optional, this throws an - - - - - Mutator for single "simple" fields only. - - - Repeated fields are mutated by fetching the value and manipulating it as a list. - Map fields are mutated by fetching the value and manipulating it as a dictionary. - - The field is not a "simple" field. - - - - Accessor for map fields. - - - - - Describes a message type. - - - - - The brief name of the descriptor's target. - - - - - Returns a clone of the underlying describing this message. - Note that a copy is taken every time this method is called, so clients using it frequently - (and not modifying it) may want to cache the returned value. - - A protobuf representation of this message descriptor. - - - - The CLR type used to represent message instances from this descriptor. - - - - The value returned by this property will be non-null for all regular fields. However, - if a message containing a map field is introspected, the list of nested messages will include - an auto-generated nested key/value pair message for the field. This is not represented in any - generated type, so this property will return null in such cases. - - - For wrapper types ( and the like), the type returned here - will be the generated message type, not the native type used by reflection for fields of those types. Code - using reflection should call to determine whether a message descriptor represents - a wrapper type, and handle the result appropriately. - - - - - - A parser for this message type. - - - - As is not generic, this cannot be statically - typed to the relevant type, but it should produce objects of a type compatible with . - - - The value returned by this property will be non-null for all regular fields. However, - if a message containing a map field is introspected, the list of nested messages will include - an auto-generated nested key/value pair message for the field. No message parser object is created for - such messages, so this property will return null in such cases. - - - For wrapper types ( and the like), the parser returned here - will be the generated message type, not the native type used by reflection for fields of those types. Code - using reflection should call to determine whether a message descriptor represents - a wrapper type, and handle the result appropriately. - - - - - - Returns whether this message is one of the "well known types" which may have runtime/protoc support. - - - - - Returns whether this message is one of the "wrapper types" used for fields which represent primitive values - with the addition of presence. - - - - - If this is a nested type, get the outer descriptor, otherwise null. - - - - - A collection of fields, which can be retrieved by name or field number. - - - - - An unmodifiable list of extensions defined in this message's scope. - Note that some extensions may be incomplete (FieldDescriptor.Extension may be null) - if they are declared in a file generated using a version of protoc that did not fully - support extensions in C#. - - - - - An unmodifiable list of this message type's nested types. - - - - - An unmodifiable list of this message type's enum types. - - - - - An unmodifiable list of the "oneof" field collections in this message type. - All "real" oneofs (where returns false) - come before synthetic ones. - - - - - The number of real "oneof" descriptors in this message type. Every element in - with an index less than this will have a property value - of false; every element with an index greater than or equal to this will have a - property value of true. - - - - - Finds a field by field name. - - The unqualified name of the field (e.g. "foo"). - The field's descriptor, or null if not found. - - - - Finds a field by field number. - - The field number within this message type. - The field's descriptor, or null if not found. - - - - Finds a nested descriptor by name. The is valid for fields, nested - message types, oneofs and enums. - - The unqualified name of the descriptor, e.g. "Foo" - The descriptor, or null if not found. - - - - The (possibly empty) set of custom options for this message. - - - - - The MessageOptions, defined in descriptor.proto. - If the options message is not present (i.e. there are no options), null is returned. - Custom options can be retrieved as extensions of the returned message. - NOTE: A defensive copy is created each time this property is retrieved. - - - - - Gets a single value message option for this descriptor - - - - - Gets a repeated value message option for this descriptor - - - - - Looks up and cross-links all fields and nested types. - - - - - A collection to simplify retrieving the field accessor for a particular field. - - - - - Returns the fields in the message as an immutable list, in the order in which they - are declared in the source .proto file. - - - - - Returns the fields in the message as an immutable list, in ascending field number - order. Field numbers need not be contiguous, so there is no direct mapping from the - index in the list to the field number; to retrieve a field by field number, it is better - to use the indexer. - - - - - Returns a read-only dictionary mapping the field names in this message as they're available - in the JSON representation to the field descriptors. For example, a field foo_bar - in the message would result two entries, one with a key fooBar and one with a key - foo_bar, both referring to the same field. - - - - - Retrieves the descriptor for the field with the given number. - - Number of the field to retrieve the descriptor for - The accessor for the given field - The message descriptor does not contain a field - with the given number - - - - Retrieves the descriptor for the field with the given name. - - Name of the field to retrieve the descriptor for - The descriptor for the given field - The message descriptor does not contain a field - with the given name - - - - Describes a single method in a service. - - - - - The service this method belongs to. - - - - - The method's input type. - - - - - The method's input type. - - - - - Indicates if client streams multiple requests. - - - - - Indicates if server streams multiple responses. - - - - - The (possibly empty) set of custom options for this method. - - - - - The MethodOptions, defined in descriptor.proto. - If the options message is not present (i.e. there are no options), null is returned. - Custom options can be retrieved as extensions of the returned message. - NOTE: A defensive copy is created each time this property is retrieved. - - - - - Gets a single value method option for this descriptor - - - - - Gets a repeated value method option for this descriptor - - - - - Returns a clone of the underlying describing this method. - Note that a copy is taken every time this method is called, so clients using it frequently - (and not modifying it) may want to cache the returned value. - - A protobuf representation of this method descriptor. - - - - The brief name of the descriptor's target. - - - - - Reflection access for a oneof, allowing clear and "get case" actions. - - - - - Gets the descriptor for this oneof. - - - The descriptor of the oneof. - - - - - Clears the oneof in the specified message. - - - - - Indicates which field in the oneof is set for specified message - - - - - Describes a "oneof" field collection in a message type: a set of - fields of which at most one can be set in any particular message. - - - - - The brief name of the descriptor's target. - - - - - Returns a clone of the underlying describing this oneof. - Note that a copy is taken every time this method is called, so clients using it frequently - (and not modifying it) may want to cache the returned value. - - A protobuf representation of this oneof descriptor. - - - - Gets the message type containing this oneof. - - - The message type containing this oneof. - - - - - Gets the fields within this oneof, in declaration order. - - - The fields within this oneof, in declaration order. - - - - - Returns true if this oneof is a synthetic oneof containing a proto3 optional field; - false otherwise. - - - - - Gets an accessor for reflective access to the values associated with the oneof - in a particular message. - - - - In descriptors for generated code, the value returned by this property will always be non-null. - - - In dynamically loaded descriptors, the value returned by this property will current be null; - if and when dynamic messages are supported, it will return a suitable accessor to work with - them. - - - - The accessor used for reflective access. - - - - - The (possibly empty) set of custom options for this oneof. - - - - - The OneofOptions, defined in descriptor.proto. - If the options message is not present (i.e. there are no options), null is returned. - Custom options can be retrieved as extensions of the returned message. - NOTE: A defensive copy is created each time this property is retrieved. - - - - - Gets a single value oneof option for this descriptor - - - - - Gets a repeated value oneof option for this descriptor - - - - - Specifies the original name (in the .proto file) of a named element, - such as an enum value. - - - - - The name of the element in the .proto file. - - - - - If the name is preferred in the .proto file. - - - - - Constructs a new attribute instance for the given name. - - The name of the element in the .proto file. - - - - Represents a package in the symbol table. We use PackageDescriptors - just as placeholders so that someone cannot define, say, a message type - that has the same name as an existing package. - - - - - The methods in this class are somewhat evil, and should not be tampered with lightly. - Basically they allow the creation of relatively weakly typed delegates from MethodInfos - which are more strongly typed. They do this by creating an appropriate strongly typed - delegate from the MethodInfo, and then calling that within an anonymous method. - Mind-bending stuff (at least to your humble narrator) but the resulting delegates are - very fast compared with calling Invoke later on. - - - - - Empty Type[] used when calling GetProperty to force property instead of indexer fetching. - - - - - Creates a delegate which will cast the argument to the type that declares the method, - call the method on it, then convert the result to object. - - The method to create a delegate for, which must be declared in an IMessage - implementation. - - - - Creates a delegate which will cast the argument to the type that declares the method, - call the method on it, then convert the result to the specified type. The method is expected - to actually return an enum (because of where we're calling it - for oneof cases). Sometimes that - means we need some extra work to perform conversions. - - The method to create a delegate for, which must be declared in an IMessage - implementation. - - - - Creates a delegate which will execute the given method after casting the first argument to - the type that declares the method, and the second argument to the first parameter type of the method. - - The method to create a delegate for, which must be declared in an IMessage - implementation. - - - - Creates a delegate which will execute the given method after casting the first argument to - type that declares the method. - - The method to create a delegate for, which must be declared in an IMessage - implementation. - - - - Creates a delegate which will execute the given method after casting the first argument to - the type that declares the method, and the second argument to the first parameter type of the method. - - - - - Creates a reflection helper for the given type arguments. Currently these are created on demand - rather than cached; this will be "busy" when initially loading a message's descriptor, but after that - they can be garbage collected. We could cache them by type if that proves to be important, but creating - an object is pretty cheap. - - - - - Accessor for repeated fields. - - - - - Describes a service type. - - - - - The brief name of the descriptor's target. - - - - - Returns a clone of the underlying describing this service. - Note that a copy is taken every time this method is called, so clients using it frequently - (and not modifying it) may want to cache the returned value. - - A protobuf representation of this service descriptor. - - - - An unmodifiable list of methods in this service. - - - - - Finds a method by name. - - The unqualified name of the method (e.g. "Foo"). - The method's descriptor, or null if not found. - - - - The (possibly empty) set of custom options for this service. - - - - - The ServiceOptions, defined in descriptor.proto. - If the options message is not present (i.e. there are no options), null is returned. - Custom options can be retrieved as extensions of the returned message. - NOTE: A defensive copy is created each time this property is retrieved. - - - - - Gets a single value service option for this descriptor - - - - - Gets a repeated value service option for this descriptor - - - - - Accessor for single fields. - - - - - An immutable registry of types which can be looked up by their full name. - - - - - An empty type registry, containing no types. - - - - - Attempts to find a message descriptor by its full name. - - The full name of the message, which is the dot-separated - combination of package, containing messages and message name - The message descriptor corresponding to or null - if there is no such message descriptor. - - - - Creates a type registry from the specified set of file descriptors. - - - This is a convenience overload for - to allow calls such as TypeRegistry.FromFiles(descriptor1, descriptor2). - - The set of files to include in the registry. Must not contain null values. - A type registry for the given files. - - - - Creates a type registry from the specified set of file descriptors. - - - All message types within all the specified files are added to the registry, and - the dependencies of the specified files are also added, recursively. - - The set of files to include in the registry. Must not contain null values. - A type registry for the given files. - - - - Creates a type registry from the file descriptor parents of the specified set of message descriptors. - - - This is a convenience overload for - to allow calls such as TypeRegistry.FromFiles(descriptor1, descriptor2). - - The set of message descriptors to use to identify file descriptors to include in the registry. - Must not contain null values. - A type registry for the given files. - - - - Creates a type registry from the file descriptor parents of the specified set of message descriptors. - - - The specified message descriptors are only used to identify their file descriptors; the returned registry - contains all the types within the file descriptors which contain the specified message descriptors (and - the dependencies of those files), not just the specified messages. - - The set of message descriptors to use to identify file descriptors to include in the registry. - Must not contain null values. - A type registry for the given files. - - - - Builder class which isn't exposed, but acts as a convenient alternative to passing round two dictionaries in recursive calls. - - - - - Abstraction for reading from a stream / read only sequence. - Parsing from the buffer is a loop of reading from current buffer / refreshing the buffer once done. - - - - - Initialize an instance with a coded input stream. - This approach is faster than using a constructor because the instance to initialize is passed by reference - and we can write directly into it without copying. - - - - - Initialize an instance with a read only sequence. - This approach is faster than using a constructor because the instance to initialize is passed by reference - and we can write directly into it without copying. - - - - - Sets currentLimit to (current position) + byteLimit. This is called - when descending into a length-delimited embedded message. The previous - limit is returned. - - The old limit. - - - - Discards the current limit, returning the previous limit. - - - - - Returns whether or not all the data before the limit has been read. - - - - - - Returns true if the stream has reached the end of the input. This is the - case if either the end of the underlying input source has been reached or - the stream has reached a limit created using PushLimit. - - - - - Represents a single field in an UnknownFieldSet. - - An UnknownField consists of four lists of values. The lists correspond - to the four "wire types" used in the protocol buffer binary format. - Normally, only one of the four lists will contain any values, since it - is impossible to define a valid message type that declares two different - types for the same field number. However, the code is designed to allow - for the case where the same unknown field number is encountered using - multiple different wire types. - - - - - - Creates a new UnknownField. - - - - - Checks if two unknown field are equal. - - - - - Get the hash code of the unknown field. - - - - - Serializes the field, including the field number, and writes it to - - - The unknown field number. - The write context to write to. - - - - Computes the number of bytes required to encode this field, including field - number. - - - - - Merge the values in into this field. For each list - of values, 's values are append to the ones in this - field. - - - - - Returns a new list containing all of the given specified values from - both the and lists. - If is null and is null or empty, - null is returned. Otherwise, either a new list is created (if - is null) or the elements of are added to . - - - - - Adds a varint value. - - - - - Adds a fixed32 value. - - - - - Adds a fixed64 value. - - - - - Adds a length-delimited value. - - - - - Adds to the , creating - a new list if is null. The list is returned - either - the original reference or the new list. - - - - - Used to keep track of fields which were seen when parsing a protocol message - but whose field numbers or types are unrecognized. This most frequently - occurs when new fields are added to a message type and then messages containing - those fields are read by old software that was built before the new types were - added. - - Most users will never need to use this class directly. - - - - - Creates a new UnknownFieldSet. - - - - - Checks whether or not the given field number is present in the set. - - - - - Serializes the set and writes it to . - - - - - Serializes the set and writes it to . - - - - - Gets the number of bytes required to encode this set. - - - - - Checks if two unknown field sets are equal. - - - - - Gets the unknown field set's hash code. - - - - - Adds a field to the set. If a field with the same number already exists, it - is replaced. - - - - - Parse a single field from and merge it - into this set. - - The parse context from which to read the field - false if the tag is an "end group" tag, true otherwise - - - - Create a new UnknownFieldSet if unknownFields is null. - Parse a single field from and merge it - into unknownFields. If is configured to discard unknown fields, - will be returned as-is and the field will be skipped. - - The UnknownFieldSet which need to be merged - The coded input stream containing the field - The merged UnknownFieldSet - - - - Create a new UnknownFieldSet if unknownFields is null. - Parse a single field from and merge it - into unknownFields. If is configured to discard unknown fields, - will be returned as-is and the field will be skipped. - - The UnknownFieldSet which need to be merged - The parse context from which to read the field - The merged UnknownFieldSet - - - - Merges the fields from into this set. - If a field number exists in both sets, the values in - will be appended to the values in this set. - - - - - Created a new UnknownFieldSet to if - needed and merges the fields from into the first set. - If a field number exists in both sets, the values in - will be appended to the values in this set. - - - - - Adds a field to the unknown field set. If a field with the same - number already exists, the two are merged. - - - - - Clone an unknown field set from . - - - - - Provides a number of unsafe byte operations to be used by advanced applications with high performance - requirements. These methods are referred to as "unsafe" due to the fact that they potentially expose - the backing buffer of a to the application. - - - - The methods in this class should only be called if it is guaranteed that the buffer backing the - will never change! Mutation of a can lead to unexpected - and undesirable consequences in your application, and will likely be difficult to debug. Proceed with caution! - - - This can have a number of significant side affects that have spooky-action-at-a-distance-like behavior. In - particular, if the bytes value changes out from under a Protocol Buffer: - - - - serialization may throw - - - serialization may succeed but the wrong bytes may be written out - - - objects that are normally immutable (such as ByteString) are no longer immutable - - - hashCode may be incorrect - - - - - - - Constructs a new from the given bytes. The bytes are not copied, - and must not be modified while the is in use. - This API is experimental and subject to change. - - - - Holder for reflection information generated from google/protobuf/any.proto - - - File descriptor for google/protobuf/any.proto - - - - `Any` contains an arbitrary serialized protocol buffer message along with a - URL that describes the type of the serialized message. - - Protobuf library provides support to pack/unpack Any values in the form - of utility functions or additional generated methods of the Any type. - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - 'type.googleapis.com/full.type.name' as the type URL and the unpack - methods only use the fully qualified type name after the last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". - - JSON - - The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": <string>, - "lastName": <string> - } - - If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a field - `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - - - - Field number for the "type_url" field. - - - - A URL/resource name that uniquely identifies the type of the serialized - protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must represent - the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a canonical form - (e.g., leading "." is not accepted). - - In practice, teams usually precompile into the binary all types that they - expect it to use in the context of Any. However, for URLs which use the - scheme `http`, `https`, or no scheme, one can optionally set up a type - server that maps type URLs to message definitions as follows: - - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the official - protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. - - Schemes other than `http`, `https` (or the empty scheme) might be - used with implementation specific semantics. - - - - Field number for the "value" field. - - - - Must be a valid serialized protocol buffer of the above specified type. - - - - - Retrieves the type name for a type URL, matching the - of the packed message type. - - - - This is always just the last part of the URL, after the final slash. No validation of - anything before the trailing slash is performed. If the type URL does not include a slash, - an empty string is returned rather than an exception being thrown; this won't match any types, - and the calling code is probably in a better position to give a meaningful error. - - - There is no handling of fragments or queries at the moment. - - - The URL to extract the type name from - The type name - - - - Returns a bool indictating whether this Any message is of the target message type - - The descriptor of the message type - true if the type name matches the descriptor's full name or false otherwise - - - - Unpacks the content of this Any message into the target message type, - which must match the type URL within this Any message. - - The type of message to unpack the content into. - The unpacked message. - The target message type doesn't match the type URL in this message - - - - Attempts to unpack the content of this Any message into the target message type, - if it matches the type URL within this Any message. - - The type of message to attempt to unpack the content into. - true if the message was successfully unpacked; false if the type name didn't match - - - - Packs the specified message into an Any message using a type URL prefix of "type.googleapis.com". - - The message to pack. - An Any message with the content and type URL of . - - - - Packs the specified message into an Any message using the specified type URL prefix. - - The message to pack. - The prefix for the type URL. - An Any message with the content and type URL of . - - - Holder for reflection information generated from google/protobuf/api.proto - - - File descriptor for google/protobuf/api.proto - - - - Api is a light-weight descriptor for an API Interface. - - Interfaces are also described as "protocol buffer services" in some contexts, - such as by the "service" keyword in a .proto file, but they are different - from API Services, which represent a concrete implementation of an interface - as opposed to simply a description of methods and bindings. They are also - sometimes simply referred to as "APIs" in other contexts, such as the name of - this message itself. See https://cloud.google.com/apis/design/glossary for - detailed terminology. - - - - Field number for the "name" field. - - - - The fully qualified name of this interface, including package name - followed by the interface's simple name. - - - - Field number for the "methods" field. - - - - The methods of this interface, in unspecified order. - - - - Field number for the "options" field. - - - - Any metadata attached to the interface. - - - - Field number for the "version" field. - - - - A version string for this interface. If specified, must have the form - `major-version.minor-version`, as in `1.10`. If the minor version is - omitted, it defaults to zero. If the entire version field is empty, the - major version is derived from the package name, as outlined below. If the - field is not empty, the version in the package name will be verified to be - consistent with what is provided here. - - The versioning schema uses [semantic - versioning](http://semver.org) where the major version number - indicates a breaking change and the minor version an additive, - non-breaking change. Both version numbers are signals to users - what to expect from different versions, and should be carefully - chosen based on the product plan. - - The major version is also reflected in the package name of the - interface, which must end in `v<major-version>`, as in - `google.feature.v1`. For major versions 0 and 1, the suffix can - be omitted. Zero major versions must only be used for - experimental, non-GA interfaces. - - - - Field number for the "source_context" field. - - - - Source context for the protocol buffer service represented by this - message. - - - - Field number for the "mixins" field. - - - - Included interfaces. See [Mixin][]. - - - - Field number for the "syntax" field. - - - - The source syntax of the service. - - - - - Method represents a method of an API interface. - - - - Field number for the "name" field. - - - - The simple name of this method. - - - - Field number for the "request_type_url" field. - - - - A URL of the input message type. - - - - Field number for the "request_streaming" field. - - - - If true, the request is streamed. - - - - Field number for the "response_type_url" field. - - - - The URL of the output message type. - - - - Field number for the "response_streaming" field. - - - - If true, the response is streamed. - - - - Field number for the "options" field. - - - - Any metadata attached to the method. - - - - Field number for the "syntax" field. - - - - The source syntax of this method. - - - - - Declares an API Interface to be included in this interface. The including - interface must redeclare all the methods from the included interface, but - documentation and options are inherited as follows: - - - If after comment and whitespace stripping, the documentation - string of the redeclared method is empty, it will be inherited - from the original method. - - - Each annotation belonging to the service config (http, - visibility) which is not set in the redeclared method will be - inherited. - - - If an http annotation is inherited, the path pattern will be - modified as follows. Any version prefix will be replaced by the - version of the including interface plus the [root][] path if - specified. - - Example of a simple mixin: - - package google.acl.v1; - service AccessControl { - // Get the underlying ACL object. - rpc GetAcl(GetAclRequest) returns (Acl) { - option (google.api.http).get = "/v1/{resource=**}:getAcl"; - } - } - - package google.storage.v2; - service Storage { - rpc GetAcl(GetAclRequest) returns (Acl); - - // Get a data record. - rpc GetData(GetDataRequest) returns (Data) { - option (google.api.http).get = "/v2/{resource=**}"; - } - } - - Example of a mixin configuration: - - apis: - - name: google.storage.v2.Storage - mixins: - - name: google.acl.v1.AccessControl - - The mixin construct implies that all methods in `AccessControl` are - also declared with same name and request/response types in - `Storage`. A documentation generator or annotation processor will - see the effective `Storage.GetAcl` method after inheriting - documentation and annotations as follows: - - service Storage { - // Get the underlying ACL object. - rpc GetAcl(GetAclRequest) returns (Acl) { - option (google.api.http).get = "/v2/{resource=**}:getAcl"; - } - ... - } - - Note how the version in the path pattern changed from `v1` to `v2`. - - If the `root` field in the mixin is specified, it should be a - relative path under which inherited HTTP paths are placed. Example: - - apis: - - name: google.storage.v2.Storage - mixins: - - name: google.acl.v1.AccessControl - root: acls - - This implies the following inherited HTTP annotation: - - service Storage { - // Get the underlying ACL object. - rpc GetAcl(GetAclRequest) returns (Acl) { - option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; - } - ... - } - - - - Field number for the "name" field. - - - - The fully qualified name of the interface which is included. - - - - Field number for the "root" field. - - - - If non-empty specifies a path under which inherited HTTP paths - are rooted. - - - - Holder for reflection information generated from google/protobuf/duration.proto - - - File descriptor for google/protobuf/duration.proto - - - - A Duration represents a signed, fixed-length span of time represented - as a count of seconds and fractions of seconds at nanosecond - resolution. It is independent of any calendar and concepts like "day" - or "month". It is related to Timestamp in that the difference between - two Timestamp values is a Duration and it can be added or subtracted - from a Timestamp. Range is approximately +-10,000 years. - - # Examples - - Example 1: Compute Duration from two Timestamps in pseudo code. - - Timestamp start = ...; - Timestamp end = ...; - Duration duration = ...; - - duration.seconds = end.seconds - start.seconds; - duration.nanos = end.nanos - start.nanos; - - if (duration.seconds < 0 && duration.nanos > 0) { - duration.seconds += 1; - duration.nanos -= 1000000000; - } else if (duration.seconds > 0 && duration.nanos < 0) { - duration.seconds -= 1; - duration.nanos += 1000000000; - } - - Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - - Timestamp start = ...; - Duration duration = ...; - Timestamp end = ...; - - end.seconds = start.seconds + duration.seconds; - end.nanos = start.nanos + duration.nanos; - - if (end.nanos < 0) { - end.seconds -= 1; - end.nanos += 1000000000; - } else if (end.nanos >= 1000000000) { - end.seconds += 1; - end.nanos -= 1000000000; - } - - Example 3: Compute Duration from datetime.timedelta in Python. - - td = datetime.timedelta(days=3, minutes=10) - duration = Duration() - duration.FromTimedelta(td) - - # JSON Mapping - - In JSON format, the Duration type is encoded as a string rather than an - object, where the string ends in the suffix "s" (indicating seconds) and - is preceded by the number of seconds, with nanoseconds expressed as - fractional seconds. For example, 3 seconds with 0 nanoseconds should be - encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - microsecond should be expressed in JSON format as "3.000001s". - - - - Field number for the "seconds" field. - - - - Signed seconds of the span of time. Must be from -315,576,000,000 - to +315,576,000,000 inclusive. Note: these bounds are computed from: - 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - - - - Field number for the "nanos" field. - - - - Signed fractions of a second at nanosecond resolution of the span - of time. Durations less than one second are represented with a 0 - `seconds` field and a positive or negative `nanos` field. For durations - of one second or more, a non-zero value for the `nanos` field must be - of the same sign as the `seconds` field. Must be from -999,999,999 - to +999,999,999 inclusive. - - - - - The number of nanoseconds in a second. - - - - - The number of nanoseconds in a BCL tick (as used by and ). - - - - - The maximum permitted number of seconds. - - - - - The minimum permitted number of seconds. - - - - - Converts this to a . - - If the duration is not a precise number of ticks, it is truncated towards 0. - The value of this duration, as a TimeSpan. - This value isn't a valid normalized duration, as - described in the documentation. - - - - Converts the given to a . - - The TimeSpan to convert. - The value of the given TimeSpan, as a Duration. - - - - Returns the result of negating the duration. For example, the negation of 5 minutes is -5 minutes. - - The duration to negate. Must not be null. - The negated value of this duration. - - - - Adds the two specified values together. - - The first value to add. Must not be null. - The second value to add. Must not be null. - - - - - Subtracts one from another. - - The duration to subtract from. Must not be null. - The duration to subtract. Must not be null. - The difference between the two specified durations. - - - - Creates a duration with the normalized values from the given number of seconds and - nanoseconds, conforming with the description in the proto file. - - - - - Converts a duration specified in seconds/nanoseconds to a string. - - - If the value is a normalized duration in the range described in duration.proto, - is ignored. Otherwise, if the parameter is true, - a JSON object with a warning is returned; if it is false, an is thrown. - - Seconds portion of the duration. - Nanoseconds portion of the duration. - Determines the handling of non-normalized values - The represented duration is invalid, and is false. - - - - Returns a string representation of this for diagnostic purposes. - - - Normally the returned value will be a JSON string value (including leading and trailing quotes) but - when the value is non-normalized or out of range, a JSON object representation will be returned - instead, including a warning. This is to avoid exceptions being thrown when trying to - diagnose problems - the regular JSON formatter will still throw an exception for non-normalized - values. - - A string representation of this value. - - - - Appends a number of nanoseconds to a StringBuilder. Either 0 digits are added (in which - case no "." is appended), or 3 6 or 9 digits. This is internal for use in Timestamp as well - as Duration. - - - - Holder for reflection information generated from google/protobuf/empty.proto - - - File descriptor for google/protobuf/empty.proto - - - - A generic empty message that you can re-use to avoid defining duplicated - empty messages in your APIs. A typical example is to use it as the request - or the response type of an API method. For instance: - - service Foo { - rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - } - - - - Holder for reflection information generated from google/protobuf/field_mask.proto - - - File descriptor for google/protobuf/field_mask.proto - - - - `FieldMask` represents a set of symbolic field paths, for example: - - paths: "f.a" - paths: "f.b.d" - - Here `f` represents a field in some root message, `a` and `b` - fields in the message found in `f`, and `d` a field found in the - message in `f.b`. - - Field masks are used to specify a subset of fields that should be - returned by a get operation or modified by an update operation. - Field masks also have a custom JSON encoding (see below). - - # Field Masks in Projections - - When used in the context of a projection, a response message or - sub-message is filtered by the API to only contain those fields as - specified in the mask. For example, if the mask in the previous - example is applied to a response message as follows: - - f { - a : 22 - b { - d : 1 - x : 2 - } - y : 13 - } - z: 8 - - The result will not contain specific values for fields x,y and z - (their value will be set to the default, and omitted in proto text - output): - - f { - a : 22 - b { - d : 1 - } - } - - A repeated field is not allowed except at the last position of a - paths string. - - If a FieldMask object is not present in a get operation, the - operation applies to all fields (as if a FieldMask of all fields - had been specified). - - Note that a field mask does not necessarily apply to the - top-level response message. In case of a REST get operation, the - field mask applies directly to the response, but in case of a REST - list operation, the mask instead applies to each individual message - in the returned resource list. In case of a REST custom method, - other definitions may be used. Where the mask applies will be - clearly documented together with its declaration in the API. In - any case, the effect on the returned resource/resources is required - behavior for APIs. - - # Field Masks in Update Operations - - A field mask in update operations specifies which fields of the - targeted resource are going to be updated. The API is required - to only change the values of the fields as specified in the mask - and leave the others untouched. If a resource is passed in to - describe the updated values, the API ignores the values of all - fields not covered by the mask. - - If a repeated field is specified for an update operation, new values will - be appended to the existing repeated field in the target resource. Note that - a repeated field is only allowed in the last position of a `paths` string. - - If a sub-message is specified in the last position of the field mask for an - update operation, then new value will be merged into the existing sub-message - in the target resource. - - For example, given the target message: - - f { - b { - d: 1 - x: 2 - } - c: [1] - } - - And an update message: - - f { - b { - d: 10 - } - c: [2] - } - - then if the field mask is: - - paths: ["f.b", "f.c"] - - then the result will be: - - f { - b { - d: 10 - x: 2 - } - c: [1, 2] - } - - An implementation may provide options to override this default behavior for - repeated and message fields. - - In order to reset a field's value to the default, the field must - be in the mask and set to the default value in the provided resource. - Hence, in order to reset all fields of a resource, provide a default - instance of the resource and set all fields in the mask, or do - not provide a mask as described below. - - If a field mask is not present on update, the operation applies to - all fields (as if a field mask of all fields has been specified). - Note that in the presence of schema evolution, this may mean that - fields the client does not know and has therefore not filled into - the request will be reset to their default. If this is unwanted - behavior, a specific service may require a client to always specify - a field mask, producing an error if not. - - As with get operations, the location of the resource which - describes the updated values in the request message depends on the - operation kind. In any case, the effect of the field mask is - required to be honored by the API. - - ## Considerations for HTTP REST - - The HTTP kind of an update operation which uses a field mask must - be set to PATCH instead of PUT in order to satisfy HTTP semantics - (PUT must only be used for full updates). - - # JSON Encoding of Field Masks - - In JSON, a field mask is encoded as a single string where paths are - separated by a comma. Fields name in each path are converted - to/from lower-camel naming conventions. - - As an example, consider the following message declarations: - - message Profile { - User user = 1; - Photo photo = 2; - } - message User { - string display_name = 1; - string address = 2; - } - - In proto a field mask for `Profile` may look as such: - - mask { - paths: "user.display_name" - paths: "photo" - } - - In JSON, the same mask is represented as below: - - { - mask: "user.displayName,photo" - } - - # Field Masks and Oneof Fields - - Field masks treat fields in oneofs just as regular fields. Consider the - following message: - - message SampleMessage { - oneof test_oneof { - string name = 4; - SubMessage sub_message = 9; - } - } - - The field mask can be: - - mask { - paths: "name" - } - - Or: - - mask { - paths: "sub_message" - } - - Note that oneof type names ("test_oneof" in this case) cannot be used in - paths. - - ## Field Mask Verification - - The implementation of any API method which has a FieldMask type field in the - request should verify the included field paths, and return an - `INVALID_ARGUMENT` error if any path is unmappable. - - - - Field number for the "paths" field. - - - - The set of field mask paths. - - - - - Converts a field mask specified by paths to a string. - - - If the value is a normalized duration in the range described in field_mask.proto, - is ignored. Otherwise, if the parameter is true, - a JSON object with a warning is returned; if it is false, an is thrown. - - Paths in the field mask - Determines the handling of non-normalized values - The represented field mask is invalid, and is false. - - - - Returns a string representation of this for diagnostic purposes. - - - Normally the returned value will be a JSON string value (including leading and trailing quotes) but - when the value is non-normalized or out of range, a JSON object representation will be returned - instead, including a warning. This is to avoid exceptions being thrown when trying to - diagnose problems - the regular JSON formatter will still throw an exception for non-normalized - values. - - A string representation of this value. - - - - Parses from a string to a FieldMask. - - - - - Parses from a string to a FieldMask and validates all field paths. - - The type to validate the field paths against. - - - - Constructs a FieldMask for a list of field paths in a certain type. - - The type to validate the field paths against. - - - - Constructs a FieldMask from the passed field numbers. - - The type to validate the field paths against. - - - - Constructs a FieldMask from the passed field numbers. - - The type to validate the field paths against. - - - - Checks whether the given path is valid for a field mask. - - true if the path is valid; false otherwise - - - - Checks whether paths in a given fields mask are valid. - - The type to validate the field paths against. - - - - Checks whether paths in a given fields mask are valid. - - - - - Checks whether a given field path is valid. - - The type to validate the field paths against. - - - - Checks whether paths in a given fields mask are valid. - - - - - Converts this FieldMask to its canonical form. In the canonical form of a - FieldMask, all field paths are sorted alphabetically and redundant field - paths are removed. - - - - - Creates a union of two or more FieldMasks. - - - - - Calculates the intersection of two FieldMasks. - - - - - Merges fields specified by this FieldMask from one message to another with the - specified merge options. - - - - - Merges fields specified by this FieldMask from one message to another. - - - - - Options to customize merging behavior. - - - - - Whether to replace message fields(i.e., discard existing content in - destination message fields) when merging. - Default behavior is to merge the source message field into the - destination message field. - - - - - Whether to replace repeated fields (i.e., discard existing content in - destination repeated fields) when merging. - Default behavior is to append elements from source repeated field to the - destination repeated field. - - - - - Whether to replace primitive (non-repeated and non-message) fields in - destination message fields with the source primitive fields (i.e., if the - field is set in the source, the value is copied to the - destination; if the field is unset in the source, the field is cleared - from the destination) when merging. - - Default behavior is to always set the value of the source primitive - field to the destination primitive field, and if the source field is - unset, the default value of the source field is copied to the - destination. - - - - Holder for reflection information generated from google/protobuf/source_context.proto - - - File descriptor for google/protobuf/source_context.proto - - - - `SourceContext` represents information about the source of a - protobuf element, like the file in which it is defined. - - - - Field number for the "file_name" field. - - - - The path-qualified name of the .proto file that contained the associated - protobuf element. For example: `"google/protobuf/source_context.proto"`. - - - - Holder for reflection information generated from google/protobuf/struct.proto - - - File descriptor for google/protobuf/struct.proto - - - - `NullValue` is a singleton enumeration to represent the null value for the - `Value` type union. - - The JSON representation for `NullValue` is JSON `null`. - - - - - Null value. - - - - - `Struct` represents a structured data value, consisting of fields - which map to dynamically typed values. In some languages, `Struct` - might be supported by a native representation. For example, in - scripting languages like JS a struct is represented as an - object. The details of that representation are described together - with the proto support for the language. - - The JSON representation for `Struct` is JSON object. - - - - Field number for the "fields" field. - - - - Unordered map of dynamically typed values. - - - - - `Value` represents a dynamically typed value which can be either - null, a number, a string, a boolean, a recursive struct value, or a - list of values. A producer of value is expected to set one of these - variants. Absence of any variant indicates an error. - - The JSON representation for `Value` is JSON value. - - - - Field number for the "null_value" field. - - - - Represents a null value. - - - - Field number for the "number_value" field. - - - - Represents a double value. - - - - Field number for the "string_value" field. - - - - Represents a string value. - - - - Field number for the "bool_value" field. - - - - Represents a boolean value. - - - - Field number for the "struct_value" field. - - - - Represents a structured value. - - - - Field number for the "list_value" field. - - - - Represents a repeated `Value`. - - - - Enum of possible cases for the "kind" oneof. - - - - Convenience method to create a Value message with a string value. - - Value to set for the StringValue property. - A newly-created Value message with the given value. - - - - Convenience method to create a Value message with a number value. - - Value to set for the NumberValue property. - A newly-created Value message with the given value. - - - - Convenience method to create a Value message with a Boolean value. - - Value to set for the BoolValue property. - A newly-created Value message with the given value. - - - - Convenience method to create a Value message with a null initial value. - - A newly-created Value message a null initial value. - - - - Convenience method to create a Value message with an initial list of values. - - The values provided are not cloned; the references are copied directly. - A newly-created Value message an initial list value. - - - - Convenience method to create a Value message with an initial struct value - - The value provided is not cloned; the reference is copied directly. - A newly-created Value message an initial struct value. - - - - `ListValue` is a wrapper around a repeated field of values. - - The JSON representation for `ListValue` is JSON array. - - - - Field number for the "values" field. - - - - Repeated field of dynamically typed values. - - - - - Extension methods on BCL time-related types, converting to protobuf types. - - - - - Converts the given to a . - - The date and time to convert to a timestamp. - The value has a other than Utc. - The converted timestamp. - - - - Converts the given to a - - The offset is taken into consideration when converting the value (so the same instant in time - is represented) but is not a separate part of the resulting value. In other words, there is no - roundtrip operation to retrieve the original DateTimeOffset. - The date and time (with UTC offset) to convert to a timestamp. - The converted timestamp. - - - - Converts the given to a . - - The time span to convert. - The converted duration. - - - Holder for reflection information generated from google/protobuf/timestamp.proto - - - File descriptor for google/protobuf/timestamp.proto - - - - A Timestamp represents a point in time independent of any time zone or local - calendar, encoded as a count of seconds and fractions of seconds at - nanosecond resolution. The count is relative to an epoch at UTC midnight on - January 1, 1970, in the proleptic Gregorian calendar which extends the - Gregorian calendar backwards to year one. - - All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - second table is needed for interpretation, using a [24-hour linear - smear](https://developers.google.com/time/smear). - - The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - restricting to that range, we ensure that we can convert to and from [RFC - 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - - # Examples - - Example 1: Compute Timestamp from POSIX `time()`. - - Timestamp timestamp; - timestamp.set_seconds(time(NULL)); - timestamp.set_nanos(0); - - Example 2: Compute Timestamp from POSIX `gettimeofday()`. - - struct timeval tv; - gettimeofday(&tv, NULL); - - Timestamp timestamp; - timestamp.set_seconds(tv.tv_sec); - timestamp.set_nanos(tv.tv_usec * 1000); - - Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - - FILETIME ft; - GetSystemTimeAsFileTime(&ft); - UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - - // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - Timestamp timestamp; - timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - - Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - - long millis = System.currentTimeMillis(); - - Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - .setNanos((int) ((millis % 1000) * 1000000)).build(); - - Example 5: Compute Timestamp from Java `Instant.now()`. - - Instant now = Instant.now(); - - Timestamp timestamp = - Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - .setNanos(now.getNano()).build(); - - Example 6: Compute Timestamp from current time in Python. - - timestamp = Timestamp() - timestamp.GetCurrentTime() - - # JSON Mapping - - In JSON format, the Timestamp type is encoded as a string in the - [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - where {year} is always expressed using four digits while {month}, {day}, - {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - is required. A proto3 JSON serializer should always use UTC (as indicated by - "Z") when printing the Timestamp type and a proto3 JSON parser should be - able to accept both UTC and other timezones (as indicated by an offset). - - For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - 01:30 UTC on January 15, 2017. - - In JavaScript, one can convert a Date object to this format using the - standard - [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - method. In Python, a standard `datetime.datetime` object can be converted - to this format using - [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - the Joda Time's [`ISODateTimeFormat.dateTime()`]( - http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - ) to obtain a formatter capable of generating timestamps in this format. - - - - Field number for the "seconds" field. - - - - Represents seconds of UTC time since Unix epoch - 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - 9999-12-31T23:59:59Z inclusive. - - - - Field number for the "nanos" field. - - - - Non-negative fractions of a second at nanosecond resolution. Negative - second values with fractions must still have non-negative nanos values - that count forward in time. Must be from 0 to 999,999,999 - inclusive. - - - - - Returns the difference between one and another, as a . - - The timestamp to subtract from. Must not be null. - The timestamp to subtract. Must not be null. - The difference between the two specified timestamps. - - - - Adds a to a , to obtain another Timestamp. - - The timestamp to add the duration to. Must not be null. - The duration to add. Must not be null. - The result of adding the duration to the timestamp. - - - - Subtracts a from a , to obtain another Timestamp. - - The timestamp to subtract the duration from. Must not be null. - The duration to subtract. - The result of subtracting the duration from the timestamp. - - - - Converts this timestamp into a . - - - The resulting DateTime will always have a Kind of Utc. - If the timestamp is not a precise number of ticks, it will be truncated towards the start - of time. For example, a timestamp with a value of 99 will result in a - value precisely on a second. - - This timestamp as a DateTime. - The timestamp contains invalid values; either it is - incorrectly normalized or is outside the valid range. - - - - Converts this timestamp into a . - - - The resulting DateTimeOffset will always have an Offset of zero. - If the timestamp is not a precise number of ticks, it will be truncated towards the start - of time. For example, a timestamp with a value of 99 will result in a - value precisely on a second. - - This timestamp as a DateTimeOffset. - The timestamp contains invalid values; either it is - incorrectly normalized or is outside the valid range. - - - - Converts the specified to a . - - - The Kind of is not DateTimeKind.Utc. - The converted timestamp. - - - - Converts the given to a - - The offset is taken into consideration when converting the value (so the same instant in time - is represented) but is not a separate part of the resulting value. In other words, there is no - roundtrip operation to retrieve the original DateTimeOffset. - The date and time (with UTC offset) to convert to a timestamp. - The converted timestamp. - - - - Converts a timestamp specified in seconds/nanoseconds to a string. - - - If the value is a normalized duration in the range described in timestamp.proto, - is ignored. Otherwise, if the parameter is true, - a JSON object with a warning is returned; if it is false, an is thrown. - - Seconds portion of the duration. - Nanoseconds portion of the duration. - Determines the handling of non-normalized values - The represented duration is invalid, and is false. - - - - Given another timestamp, returns 0 if the timestamps are equivalent, -1 if this timestamp precedes the other, and 1 otherwise - - - Make sure the timestamps are normalized. Comparing non-normalized timestamps is not specified and may give unexpected results. - - Timestamp to compare - an integer indicating whether this timestamp precedes or follows the other - - - - Compares two timestamps and returns whether the first is less than (chronologically precedes) the second - - - Make sure the timestamps are normalized. Comparing non-normalized timestamps is not specified and may give unexpected results. - - - - true if a precedes b - - - - Compares two timestamps and returns whether the first is greater than (chronologically follows) the second - - - Make sure the timestamps are normalized. Comparing non-normalized timestamps is not specified and may give unexpected results. - - - - true if a follows b - - - - Compares two timestamps and returns whether the first is less than (chronologically precedes) the second - - - Make sure the timestamps are normalized. Comparing non-normalized timestamps is not specified and may give unexpected results. - - - - true if a precedes b - - - - Compares two timestamps and returns whether the first is greater than (chronologically follows) the second - - - Make sure the timestamps are normalized. Comparing non-normalized timestamps is not specified and may give unexpected results. - - - - true if a follows b - - - - Returns whether two timestamps are equivalent - - - Make sure the timestamps are normalized. Comparing non-normalized timestamps is not specified and may give unexpected results. - - - - true if the two timestamps refer to the same nanosecond - - - - Returns whether two timestamps differ - - - Make sure the timestamps are normalized. Comparing non-normalized timestamps is not specified and may give unexpected results. - - - - true if the two timestamps differ - - - - Returns a string representation of this for diagnostic purposes. - - - Normally the returned value will be a JSON string value (including leading and trailing quotes) but - when the value is non-normalized or out of range, a JSON object representation will be returned - instead, including a warning. This is to avoid exceptions being thrown when trying to - diagnose problems - the regular JSON formatter will still throw an exception for non-normalized - values. - - A string representation of this value. - - - Holder for reflection information generated from google/protobuf/type.proto - - - File descriptor for google/protobuf/type.proto - - - - The syntax in which a protocol buffer element is defined. - - - - - Syntax `proto2`. - - - - - Syntax `proto3`. - - - - - A protocol buffer message type. - - - - Field number for the "name" field. - - - - The fully qualified message name. - - - - Field number for the "fields" field. - - - - The list of fields. - - - - Field number for the "oneofs" field. - - - - The list of types appearing in `oneof` definitions in this type. - - - - Field number for the "options" field. - - - - The protocol buffer options. - - - - Field number for the "source_context" field. - - - - The source context. - - - - Field number for the "syntax" field. - - - - The source syntax. - - - - - A single field of a message type. - - - - Field number for the "kind" field. - - - - The field type. - - - - Field number for the "cardinality" field. - - - - The field cardinality. - - - - Field number for the "number" field. - - - - The field number. - - - - Field number for the "name" field. - - - - The field name. - - - - Field number for the "type_url" field. - - - - The field type URL, without the scheme, for message or enumeration - types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. - - - - Field number for the "oneof_index" field. - - - - The index of the field type in `Type.oneofs`, for message or enumeration - types. The first type has index 1; zero means the type is not in the list. - - - - Field number for the "packed" field. - - - - Whether to use alternative packed wire representation. - - - - Field number for the "options" field. - - - - The protocol buffer options. - - - - Field number for the "json_name" field. - - - - The field JSON name. - - - - Field number for the "default_value" field. - - - - The string value of the default value of this field. Proto2 syntax only. - - - - Container for nested types declared in the Field message type. - - - - Basic field types. - - - - - Field type unknown. - - - - - Field type double. - - - - - Field type float. - - - - - Field type int64. - - - - - Field type uint64. - - - - - Field type int32. - - - - - Field type fixed64. - - - - - Field type fixed32. - - - - - Field type bool. - - - - - Field type string. - - - - - Field type group. Proto2 syntax only, and deprecated. - - - - - Field type message. - - - - - Field type bytes. - - - - - Field type uint32. - - - - - Field type enum. - - - - - Field type sfixed32. - - - - - Field type sfixed64. - - - - - Field type sint32. - - - - - Field type sint64. - - - - - Whether a field is optional, required, or repeated. - - - - - For fields with unknown cardinality. - - - - - For optional fields. - - - - - For required fields. Proto2 syntax only. - - - - - For repeated fields. - - - - - Enum type definition. - - - - Field number for the "name" field. - - - - Enum type name. - - - - Field number for the "enumvalue" field. - - - - Enum value definitions. - - - - Field number for the "options" field. - - - - Protocol buffer options. - - - - Field number for the "source_context" field. - - - - The source context. - - - - Field number for the "syntax" field. - - - - The source syntax. - - - - - Enum value definition. - - - - Field number for the "name" field. - - - - Enum value name. - - - - Field number for the "number" field. - - - - Enum value number. - - - - Field number for the "options" field. - - - - Protocol buffer options. - - - - - A protocol buffer option, which can be attached to a message, field, - enumeration, etc. - - - - Field number for the "name" field. - - - - The option's name. For protobuf built-in options (options defined in - descriptor.proto), this is the short name. For example, `"map_entry"`. - For custom options, it should be the fully-qualified name. For example, - `"google.api.http"`. - - - - Field number for the "value" field. - - - - The option's value packed in an Any message. If the value is a primitive, - the corresponding wrapper type defined in google/protobuf/wrappers.proto - should be used. If the value is an enum, it should be stored as an int32 - value using the google.protobuf.Int32Value type. - - - - Holder for reflection information generated from google/protobuf/wrappers.proto - - - File descriptor for google/protobuf/wrappers.proto - - - - Field number for the single "value" field in all wrapper types. - - - - - Wrapper message for `double`. - - The JSON representation for `DoubleValue` is JSON number. - - - - Field number for the "value" field. - - - - The double value. - - - - - Wrapper message for `float`. - - The JSON representation for `FloatValue` is JSON number. - - - - Field number for the "value" field. - - - - The float value. - - - - - Wrapper message for `int64`. - - The JSON representation for `Int64Value` is JSON string. - - - - Field number for the "value" field. - - - - The int64 value. - - - - - Wrapper message for `uint64`. - - The JSON representation for `UInt64Value` is JSON string. - - - - Field number for the "value" field. - - - - The uint64 value. - - - - - Wrapper message for `int32`. - - The JSON representation for `Int32Value` is JSON number. - - - - Field number for the "value" field. - - - - The int32 value. - - - - - Wrapper message for `uint32`. - - The JSON representation for `UInt32Value` is JSON number. - - - - Field number for the "value" field. - - - - The uint32 value. - - - - - Wrapper message for `bool`. - - The JSON representation for `BoolValue` is JSON `true` and `false`. - - - - Field number for the "value" field. - - - - The bool value. - - - - - Wrapper message for `string`. - - The JSON representation for `StringValue` is JSON string. - - - - Field number for the "value" field. - - - - The string value. - - - - - Wrapper message for `bytes`. - - The JSON representation for `BytesValue` is JSON string. - - - - Field number for the "value" field. - - - - The bytes value. - - - - - This class is used internally by the Protocol Buffer Library and generated - message implementations. It is public only for the sake of those generated - messages. Others should not use this class directly. - - This class contains constants and helper functions useful for dealing with - the Protocol Buffer wire format. - - - - - - Wire types within protobuf encoding. - - - - - Variable-length integer. - - - - - A fixed-length 64-bit value. - - - - - A length-delimited value, i.e. a length followed by that many bytes of data. - - - - - A "start group" value - - - - - An "end group" value - - - - - A fixed-length 32-bit value. - - - - - Given a tag value, determines the wire type (lower 3 bits). - - - - - Given a tag value, determines the field number (the upper 29 bits). - - - - - Makes a tag value given a field number and wire type. - - - - - Abstraction for writing to a steam / IBufferWriter - - - - - Initialize an instance with a coded output stream. - This approach is faster than using a constructor because the instance to initialize is passed by reference - and we can write directly into it without copying. - - - - - Initialize an instance with a buffer writer. - This approach is faster than using a constructor because the instance to initialize is passed by reference - and we can write directly into it without copying. - - - - - Initialize an instance with a buffer represented by a single span (i.e. buffer cannot be refreshed) - This approach is faster than using a constructor because the instance to initialize is passed by reference - and we can write directly into it without copying. - - - - - Verifies that SpaceLeft returns zero. - - - - - If writing to a flat array, returns the space left in the array. Otherwise, - throws an InvalidOperationException. - - - - - An opaque struct that represents the current serialization state and is passed along - as the serialization proceeds. - All the public methods are intended to be invoked only by the generated code, - users should never invoke them directly. - - - - - Creates a WriteContext instance from CodedOutputStream. - WARNING: internally this copies the CodedOutputStream's state, so after done with the WriteContext, - the CodedOutputStream's state needs to be updated. - - - - - Writes a double field value, without a tag. - - The value to write - - - - Writes a float field value, without a tag. - - The value to write - - - - Writes a uint64 field value, without a tag. - - The value to write - - - - Writes an int64 field value, without a tag. - - The value to write - - - - Writes an int32 field value, without a tag. - - The value to write - - - - Writes a fixed64 field value, without a tag. - - The value to write - - - - Writes a fixed32 field value, without a tag. - - The value to write - - - - Writes a bool field value, without a tag. - - The value to write - - - - Writes a string field value, without a tag. - The data is length-prefixed. - - The value to write - - - - Writes a message, without a tag. - The data is length-prefixed. - - The value to write - - - - Writes a group, without a tag, to the stream. - - The value to write - - - - Write a byte string, without a tag, to the stream. - The data is length-prefixed. - - The value to write - - - - Writes a uint32 value, without a tag. - - The value to write - - - - Writes an enum value, without a tag. - - The value to write - - - - Writes an sfixed32 value, without a tag. - - The value to write. - - - - Writes an sfixed64 value, without a tag. - - The value to write - - - - Writes an sint32 value, without a tag. - - The value to write - - - - Writes an sint64 value, without a tag. - - The value to write - - - - Writes a length (in bytes) for length-delimited data. - - - This method simply writes a rawint, but exists for clarity in calling code. - - Length value, in bytes. - - - - Encodes and writes a tag. - - The number of the field to write the tag for - The wire format type of the tag to write - - - - Writes an already-encoded tag. - - The encoded tag - - - - Writes the given single-byte tag. - - The encoded tag - - - - Writes the given two-byte tag. - - The first byte of the encoded tag - The second byte of the encoded tag - - - - Writes the given three-byte tag. - - The first byte of the encoded tag - The second byte of the encoded tag - The third byte of the encoded tag - - - - Writes the given four-byte tag. - - The first byte of the encoded tag - The second byte of the encoded tag - The third byte of the encoded tag - The fourth byte of the encoded tag - - - - Writes the given five-byte tag. - - The first byte of the encoded tag - The second byte of the encoded tag - The third byte of the encoded tag - The fourth byte of the encoded tag - The fifth byte of the encoded tag - - - - Primitives for encoding protobuf wire format. - - - - - Writes a double field value, without a tag, to the stream. - - - - - Writes a float field value, without a tag, to the stream. - - - - - Writes a uint64 field value, without a tag, to the stream. - - - - - Writes an int64 field value, without a tag, to the stream. - - - - - Writes an int32 field value, without a tag, to the stream. - - - - - Writes a fixed64 field value, without a tag, to the stream. - - - - - Writes a fixed32 field value, without a tag, to the stream. - - - - - Writes a bool field value, without a tag, to the stream. - - - - - Writes a string field value, without a tag, to the stream. - The data is length-prefixed. - - - - - Given a QWORD which represents a buffer of 4 ASCII chars in machine-endian order, - narrows each WORD to a BYTE, then writes the 4-byte result to the output buffer - also in machine-endian order. - - - - - Write a byte string, without a tag, to the stream. - The data is length-prefixed. - - - - - Writes a uint32 value, without a tag, to the stream. - - - - - Writes an enum value, without a tag, to the stream. - - - - - Writes an sfixed32 value, without a tag, to the stream. - - - - - Writes an sfixed64 value, without a tag, to the stream. - - - - - Writes an sint32 value, without a tag, to the stream. - - - - - Writes an sint64 value, without a tag, to the stream. - - - - - Writes a length (in bytes) for length-delimited data. - - - This method simply writes a rawint, but exists for clarity in calling code. - - - - - Writes a 32 bit value as a varint. The fast route is taken when - there's enough buffer space left to whizz through without checking - for each byte; otherwise, we resort to calling WriteRawByte each time. - - - - - Writes out an array of bytes. - - - - - Writes out part of an array of bytes. - - - - - Writes out part of an array of bytes. - - - - - Encodes and writes a tag. - - - - - Writes an already-encoded tag. - - - - - Writes the given single-byte tag directly to the stream. - - - - - Writes the given two-byte tag directly to the stream. - - - - - Writes the given three-byte tag directly to the stream. - - - - - Writes the given four-byte tag directly to the stream. - - - - - Writes the given five-byte tag directly to the stream. - - - - - Encode a 32-bit value with ZigZag encoding. - - - ZigZag encodes signed integers into values that can be efficiently - encoded with varint. (Otherwise, negative values must be - sign-extended to 64 bits to be varint encoded, thus always taking - 10 bytes on the wire.) - - - - - Encode a 64-bit value with ZigZag encoding. - - - ZigZag encodes signed integers into values that can be efficiently - encoded with varint. (Otherwise, negative values must be - sign-extended to 64 bits to be varint encoded, thus always taking - 10 bytes on the wire.) - - - - - Writing messages / groups. - - - - - Writes a message, without a tag. - The data is length-prefixed. - - - - - Writes a group, without a tag. - - - - - Writes a message, without a tag. - Message will be written without a length prefix. - - - - - Indicates that certain members on a specified are accessed dynamically, - for example through . - - - This allows tools to understand which members are being accessed during the execution - of a program. - - This attribute is valid on members whose type is or . - - When this attribute is applied to a location of type , the assumption is - that the string represents a fully qualified type name. - - When this attribute is applied to a class, interface, or struct, the members specified - can be accessed dynamically on instances returned from calling - on instances of that class, interface, or struct. - - If the attribute is applied to a method it's treated as a special case and it implies - the attribute should be applied to the "this" parameter of the method. As such the attribute - should only be used on instance methods of types assignable to System.Type (or string, but no methods - will use it there). - - - - - Initializes a new instance of the class - with the specified member types. - - The types of members dynamically accessed. - - - - Gets the which specifies the type - of members dynamically accessed. - - - - - Specifies the types of members that are dynamically accessed. - - This enumeration has a attribute that allows a - bitwise combination of its member values. - - - - - Specifies no members. - - - - - Specifies the default, parameterless public constructor. - - - - - Specifies all public constructors. - - - - - Specifies all non-public constructors. - - - - - Specifies all public methods. - - - - - Specifies all non-public methods. - - - - - Specifies all public fields. - - - - - Specifies all non-public fields. - - - - - Specifies all public nested types. - - - - - Specifies all non-public nested types. - - - - - Specifies all public properties. - - - - - Specifies all non-public properties. - - - - - Specifies all public events. - - - - - Specifies all non-public events. - - - - - Specifies all interfaces implemented by the type. - - - - - Specifies all members. - - - - - Indicates that the specified method requires dynamic access to code that is not referenced - statically, for example through . - - - This allows tools to understand which methods are unsafe to call when removing unreferenced - code from an application. - - - - - Initializes a new instance of the class - with the specified message. - - - A message that contains information about the usage of unreferenced code. - - - - - Gets a message that contains information about the usage of unreferenced code. - - - - - Gets or sets an optional URL that contains more information about the method, - why it requires unreferenced code, and what options a consumer has to deal with it. - - - - - Suppresses reporting of a specific rule violation, allowing multiple suppressions on a - single code artifact. - - - is different than - in that it doesn't have a - . So it is always preserved in the compiled assembly. - - - - - Initializes a new instance of the - class, specifying the category of the tool and the identifier for an analysis rule. - - The category for the attribute. - The identifier of the analysis rule the attribute applies to. - - - - Gets the category identifying the classification of the attribute. - - - The property describes the tool or tool analysis category - for which a message suppression attribute applies. - - - - - Gets the identifier of the analysis tool rule to be suppressed. - - - Concatenated together, the and - properties form a unique check identifier. - - - - - Gets or sets the scope of the code that is relevant for the attribute. - - - The Scope property is an optional argument that specifies the metadata scope for which - the attribute is relevant. - - - - - Gets or sets a fully qualified path that represents the target of the attribute. - - - The property is an optional argument identifying the analysis target - of the attribute. An example value is "System.IO.Stream.ctor():System.Void". - Because it is fully qualified, it can be long, particularly for targets such as parameters. - The analysis tool user interface should be capable of automatically formatting the parameter. - - - - - Gets or sets an optional argument expanding on exclusion criteria. - - - The property is an optional argument that specifies additional - exclusion where the literal metadata target is not sufficiently precise. For example, - the cannot be applied within a method, - and it may be desirable to suppress a violation against a statement in the method that will - give a rule violation, but not against all statements in the method. - - - - - Gets or sets the justification for suppressing the code analysis message. - - -
-
diff --git a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0.meta b/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0.meta deleted file mode 100644 index aa6506e1e..000000000 --- a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b4d5a28791112380aa5aea8031f224bf -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/LICENSE.TXT b/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/LICENSE.TXT deleted file mode 100644 index fa3121dfa..000000000 --- a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/LICENSE.TXT +++ /dev/null @@ -1,23 +0,0 @@ -The MIT License (MIT) - -Copyright (c) .NET Foundation and Contributors - -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/System.Buffers.4.4.0.nupkg b/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/System.Buffers.4.4.0.nupkg deleted file mode 100644 index c261fa8d8..000000000 Binary files a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/System.Buffers.4.4.0.nupkg and /dev/null differ diff --git a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/THIRD-PARTY-NOTICES.TXT b/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/THIRD-PARTY-NOTICES.TXT deleted file mode 100644 index 111123cd9..000000000 --- a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/THIRD-PARTY-NOTICES.TXT +++ /dev/null @@ -1,226 +0,0 @@ -.NET Core uses third-party libraries or other resources that may be -distributed under licenses different than the .NET Core software. - -In the event that we accidentally failed to list a required notice, please -bring it to our attention. Post an issue or email us: - - dotnet@microsoft.com - -The attached notices are provided for information only. - -License notice for Slicing-by-8 -------------------------------- - -http://sourceforge.net/projects/slicing-by-8/ - -Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved - - -This software program is licensed subject to the BSD License, available at -http://www.opensource.org/licenses/bsd-license.html. - - -License notice for Unicode data -------------------------------- - -http://www.unicode.org/copyright.html#License - -Copyright © 1991-2017 Unicode, Inc. All rights reserved. -Distributed under the Terms of Use in http://www.unicode.org/copyright.html. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Unicode data files and any associated documentation -(the "Data Files") or Unicode software and any associated documentation -(the "Software") to deal in the Data Files or Software -without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files -or Software are furnished to do so, provided that either -(a) this copyright and permission notice appear with all copies -of the Data Files or Software, or -(b) this copyright and permission notice appear in associated -Documentation. - -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT OF THIRD PARTY RIGHTS. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THE DATA FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in these Data Files or Software without prior -written authorization of the copyright holder. - -License notice for Zlib ------------------------ - -https://github.com/madler/zlib -http://zlib.net/zlib_license.html - -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.11, January 15th, 2017 - - Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - -*/ - -License notice for Mono -------------------------------- - -http://www.mono-project.com/docs/about-mono/ - -Copyright (c) .NET Foundation Contributors - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the Software), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -License notice for International Organization for Standardization ------------------------------------------------------------------ - -Portions (C) International Organization for Standardization 1986: - Permission to copy in any form is granted for use with - conforming SGML systems and applications as defined in - ISO 8879, provided this notice is included in all copies. - -License notice for Intel ------------------------- - -"Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -License notice for Xamarin and Novell -------------------------------------- - -Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -Copyright (c) 2011 Novell, Inc (http://www.novell.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -Third party notice for W3C --------------------------- - -"W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE -Status: This license takes effect 13 May, 2015. -This work is being provided by the copyright holders under the following license. -License -By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions. -Permission to copy, modify, and distribute this work, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the work or portions thereof, including modifications: -The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. -Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software and Document Short Notice should be included. -Notice of any changes or modifications, through a copyright statement on the new code or document such as "This software or document includes material copied from or derived from [title and URI of the W3C document]. Copyright © [YEAR] W3C® (MIT, ERCIM, Keio, Beihang)." -Disclaimers -THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. -COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT. -The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. Title to copyright in this work will at all times remain with copyright holders." - -License notice for Bit Twiddling Hacks --------------------------------------- - -Bit Twiddling Hacks - -By Sean Eron Anderson -seander@cs.stanford.edu - -Individually, the code snippets here are in the public domain (unless otherwise -noted) — feel free to use them however you please. The aggregate collection and -descriptions are © 1997-2005 Sean Eron Anderson. The code and descriptions are -distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY and -without even the implied warranty of merchantability or fitness for a particular -purpose. diff --git a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib.meta b/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib.meta deleted file mode 100644 index 2b98a2a12..000000000 --- a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 535f8a1d0cc8a894ea5f274344e72aed -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib/netstandard2.0.meta b/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib/netstandard2.0.meta deleted file mode 100644 index c00816cfa..000000000 --- a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib/netstandard2.0.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 8f9353842b054c551a60eb6fc26132b3 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.dll b/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.dll deleted file mode 100644 index b6d9c7782..000000000 Binary files a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.dll and /dev/null differ diff --git a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.dll.meta b/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.dll.meta deleted file mode 100644 index fa3533469..000000000 --- a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 942183adc788e0da2ba118ba81be0388 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.xml b/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.xml deleted file mode 100644 index 8b1b5cf90..000000000 --- a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - System.Buffers - - - - Provides a resource pool that enables reusing instances of type . - The type of the objects that are in the resource pool. - - - Initializes a new instance of the class. - - - Creates a new instance of the class. - A new instance of the class. - - - Creates a new instance of the class using the specifed configuration. - The maximum length of an array instance that may be stored in the pool. - The maximum number of array instances that may be stored in each bucket in the pool. The pool groups arrays of similar lengths into buckets for faster access. - A new instance of the class with the specified configuration. - - - Retrieves a buffer that is at least the requested length. - The minimum length of the array. - An array of type that is at least minimumLength in length. - - - Returns an array to the pool that was previously obtained using the method on the same instance. - A buffer to return to the pool that was previously obtained using the method. - Indicates whether the contents of the buffer should be cleared before reuse. If bufferLength is set to true, and if the pool will store the buffer to enable subsequent reuse, the method will clear the array of its contents so that a subsequent caller using the method will not see the content of the previous caller. If bufferLength is set to false or if the pool will release the buffer, the array's contents are left unchanged. - - - Gets a shared instance. - A shared instance. - - - \ No newline at end of file diff --git a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/useSharedDesignerContext.txt b/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/useSharedDesignerContext.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/useSharedDesignerContext.txt.meta b/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/useSharedDesignerContext.txt.meta deleted file mode 100644 index 7bdf2c029..000000000 --- a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/useSharedDesignerContext.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: b810deb288fffe9e7a41ad08ad835c80 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/version.txt b/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/version.txt deleted file mode 100644 index f35e2edd3..000000000 --- a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/version.txt +++ /dev/null @@ -1 +0,0 @@ -8321c729934c0f8be754953439b88e6e1c120c24 diff --git a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/version.txt.meta b/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/version.txt.meta deleted file mode 100644 index 627b93ea4..000000000 --- a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/version.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 011876b4b4422eddcba6bcd873099eca -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3.meta b/Assets/SpacetimeDB/Packages/System.Memory.4.5.3.meta deleted file mode 100644 index 4ddda577c..000000000 --- a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: bbbe1fbd2fc4df71bba55b1c2120d312 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/LICENSE.TXT b/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/LICENSE.TXT deleted file mode 100644 index fa3121dfa..000000000 --- a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/LICENSE.TXT +++ /dev/null @@ -1,23 +0,0 @@ -The MIT License (MIT) - -Copyright (c) .NET Foundation and Contributors - -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/LICENSE.TXT.meta b/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/LICENSE.TXT.meta deleted file mode 100644 index c4c0e5717..000000000 --- a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/LICENSE.TXT.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 9eaa875f814c8e128ab108799ca8e8b0 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/System.Memory.4.5.3.nupkg b/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/System.Memory.4.5.3.nupkg deleted file mode 100644 index 5fa15502c..000000000 Binary files a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/System.Memory.4.5.3.nupkg and /dev/null differ diff --git a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/THIRD-PARTY-NOTICES.TXT b/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/THIRD-PARTY-NOTICES.TXT deleted file mode 100644 index 207a2a734..000000000 --- a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/THIRD-PARTY-NOTICES.TXT +++ /dev/null @@ -1,309 +0,0 @@ -.NET Core uses third-party libraries or other resources that may be -distributed under licenses different than the .NET Core software. - -In the event that we accidentally failed to list a required notice, please -bring it to our attention. Post an issue or email us: - - dotnet@microsoft.com - -The attached notices are provided for information only. - -License notice for Slicing-by-8 -------------------------------- - -http://sourceforge.net/projects/slicing-by-8/ - -Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved - - -This software program is licensed subject to the BSD License, available at -http://www.opensource.org/licenses/bsd-license.html. - - -License notice for Unicode data -------------------------------- - -http://www.unicode.org/copyright.html#License - -Copyright © 1991-2017 Unicode, Inc. All rights reserved. -Distributed under the Terms of Use in http://www.unicode.org/copyright.html. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Unicode data files and any associated documentation -(the "Data Files") or Unicode software and any associated documentation -(the "Software") to deal in the Data Files or Software -without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files -or Software are furnished to do so, provided that either -(a) this copyright and permission notice appear with all copies -of the Data Files or Software, or -(b) this copyright and permission notice appear in associated -Documentation. - -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT OF THIRD PARTY RIGHTS. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THE DATA FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in these Data Files or Software without prior -written authorization of the copyright holder. - -License notice for Zlib ------------------------ - -https://github.com/madler/zlib -http://zlib.net/zlib_license.html - -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.11, January 15th, 2017 - - Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - -*/ - -License notice for Mono -------------------------------- - -http://www.mono-project.com/docs/about-mono/ - -Copyright (c) .NET Foundation Contributors - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the Software), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -License notice for International Organization for Standardization ------------------------------------------------------------------ - -Portions (C) International Organization for Standardization 1986: - Permission to copy in any form is granted for use with - conforming SGML systems and applications as defined in - ISO 8879, provided this notice is included in all copies. - -License notice for Intel ------------------------- - -"Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -License notice for Xamarin and Novell -------------------------------------- - -Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -Copyright (c) 2011 Novell, Inc (http://www.novell.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -Third party notice for W3C --------------------------- - -"W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE -Status: This license takes effect 13 May, 2015. -This work is being provided by the copyright holders under the following license. -License -By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions. -Permission to copy, modify, and distribute this work, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the work or portions thereof, including modifications: -The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. -Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software and Document Short Notice should be included. -Notice of any changes or modifications, through a copyright statement on the new code or document such as "This software or document includes material copied from or derived from [title and URI of the W3C document]. Copyright © [YEAR] W3C® (MIT, ERCIM, Keio, Beihang)." -Disclaimers -THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. -COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT. -The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. Title to copyright in this work will at all times remain with copyright holders." - -License notice for Bit Twiddling Hacks --------------------------------------- - -Bit Twiddling Hacks - -By Sean Eron Anderson -seander@cs.stanford.edu - -Individually, the code snippets here are in the public domain (unless otherwise -noted) — feel free to use them however you please. The aggregate collection and -descriptions are © 1997-2005 Sean Eron Anderson. The code and descriptions are -distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY and -without even the implied warranty of merchantability or fitness for a particular -purpose. - -License notice for Brotli --------------------------------------- - -Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -compress_fragment.c: -Copyright (c) 2011, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -decode_fuzzer.c: -Copyright (c) 2015 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." - diff --git a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/THIRD-PARTY-NOTICES.TXT.meta b/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/THIRD-PARTY-NOTICES.TXT.meta deleted file mode 100644 index 6e0890522..000000000 --- a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/THIRD-PARTY-NOTICES.TXT.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: b3fe6450b2adebdadb6f022c600c54ae -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib.meta b/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib.meta deleted file mode 100644 index e9b452b3e..000000000 --- a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: db995c57b21d2a886862da3e375894a2 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib/netstandard2.0.meta b/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib/netstandard2.0.meta deleted file mode 100644 index fd6c8e2d6..000000000 --- a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib/netstandard2.0.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6f9f81377355dade297ceb76b84bab10 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.dll b/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.dll deleted file mode 100644 index bdfc501e9..000000000 Binary files a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.dll and /dev/null differ diff --git a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.dll.meta b/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.dll.meta deleted file mode 100644 index 7e3cbb619..000000000 --- a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 30a29d5b265da523ca20d43a264e7877 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.xml b/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.xml deleted file mode 100644 index de9af8989..000000000 --- a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.xml +++ /dev/null @@ -1,355 +0,0 @@ - - - System.Memory - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.xml.meta b/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.xml.meta deleted file mode 100644 index aecf5eac9..000000000 --- a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.xml.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 3a1527b0a64676fe88542f420811e1c6 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/useSharedDesignerContext.txt b/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/useSharedDesignerContext.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/useSharedDesignerContext.txt.meta b/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/useSharedDesignerContext.txt.meta deleted file mode 100644 index f52950d84..000000000 --- a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/useSharedDesignerContext.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 245d848d2e32c738eaabe264d570fa28 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/version.txt b/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/version.txt deleted file mode 100644 index 840983379..000000000 --- a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/version.txt +++ /dev/null @@ -1 +0,0 @@ -c6cf790234e063b855fcdb50f3fb1b3cfac73275 diff --git a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/version.txt.meta b/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/version.txt.meta deleted file mode 100644 index 805c58fd0..000000000 --- a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/version.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: f8033dc14c362de7abb5c1d4ba82377b -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2.meta b/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2.meta deleted file mode 100644 index 597fb58df..000000000 --- a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 28121a23158a08fd099fee07651b6fe5 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/LICENSE.TXT b/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/LICENSE.TXT deleted file mode 100644 index fa3121dfa..000000000 --- a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/LICENSE.TXT +++ /dev/null @@ -1,23 +0,0 @@ -The MIT License (MIT) - -Copyright (c) .NET Foundation and Contributors - -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/LICENSE.TXT.meta b/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/LICENSE.TXT.meta deleted file mode 100644 index 3e33a2ffd..000000000 --- a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/LICENSE.TXT.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: a9abbe1e2cf90e99cb3200e0e16d127b -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/System.Runtime.CompilerServices.Unsafe.4.5.2.nupkg b/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/System.Runtime.CompilerServices.Unsafe.4.5.2.nupkg deleted file mode 100644 index 4f464e12e..000000000 Binary files a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/System.Runtime.CompilerServices.Unsafe.4.5.2.nupkg and /dev/null differ diff --git a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/System.Runtime.CompilerServices.Unsafe.4.5.2.nupkg.meta b/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/System.Runtime.CompilerServices.Unsafe.4.5.2.nupkg.meta deleted file mode 100644 index e670a731a..000000000 --- a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/System.Runtime.CompilerServices.Unsafe.4.5.2.nupkg.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: a0592ab03350126988dc73996196f102 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT b/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT deleted file mode 100644 index 207a2a734..000000000 --- a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT +++ /dev/null @@ -1,309 +0,0 @@ -.NET Core uses third-party libraries or other resources that may be -distributed under licenses different than the .NET Core software. - -In the event that we accidentally failed to list a required notice, please -bring it to our attention. Post an issue or email us: - - dotnet@microsoft.com - -The attached notices are provided for information only. - -License notice for Slicing-by-8 -------------------------------- - -http://sourceforge.net/projects/slicing-by-8/ - -Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved - - -This software program is licensed subject to the BSD License, available at -http://www.opensource.org/licenses/bsd-license.html. - - -License notice for Unicode data -------------------------------- - -http://www.unicode.org/copyright.html#License - -Copyright © 1991-2017 Unicode, Inc. All rights reserved. -Distributed under the Terms of Use in http://www.unicode.org/copyright.html. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Unicode data files and any associated documentation -(the "Data Files") or Unicode software and any associated documentation -(the "Software") to deal in the Data Files or Software -without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files -or Software are furnished to do so, provided that either -(a) this copyright and permission notice appear with all copies -of the Data Files or Software, or -(b) this copyright and permission notice appear in associated -Documentation. - -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT OF THIRD PARTY RIGHTS. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THE DATA FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in these Data Files or Software without prior -written authorization of the copyright holder. - -License notice for Zlib ------------------------ - -https://github.com/madler/zlib -http://zlib.net/zlib_license.html - -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.11, January 15th, 2017 - - Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - -*/ - -License notice for Mono -------------------------------- - -http://www.mono-project.com/docs/about-mono/ - -Copyright (c) .NET Foundation Contributors - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the Software), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -License notice for International Organization for Standardization ------------------------------------------------------------------ - -Portions (C) International Organization for Standardization 1986: - Permission to copy in any form is granted for use with - conforming SGML systems and applications as defined in - ISO 8879, provided this notice is included in all copies. - -License notice for Intel ------------------------- - -"Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -License notice for Xamarin and Novell -------------------------------------- - -Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -Copyright (c) 2011 Novell, Inc (http://www.novell.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -Third party notice for W3C --------------------------- - -"W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE -Status: This license takes effect 13 May, 2015. -This work is being provided by the copyright holders under the following license. -License -By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions. -Permission to copy, modify, and distribute this work, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the work or portions thereof, including modifications: -The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. -Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software and Document Short Notice should be included. -Notice of any changes or modifications, through a copyright statement on the new code or document such as "This software or document includes material copied from or derived from [title and URI of the W3C document]. Copyright © [YEAR] W3C® (MIT, ERCIM, Keio, Beihang)." -Disclaimers -THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. -COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT. -The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. Title to copyright in this work will at all times remain with copyright holders." - -License notice for Bit Twiddling Hacks --------------------------------------- - -Bit Twiddling Hacks - -By Sean Eron Anderson -seander@cs.stanford.edu - -Individually, the code snippets here are in the public domain (unless otherwise -noted) — feel free to use them however you please. The aggregate collection and -descriptions are © 1997-2005 Sean Eron Anderson. The code and descriptions are -distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY and -without even the implied warranty of merchantability or fitness for a particular -purpose. - -License notice for Brotli --------------------------------------- - -Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -compress_fragment.c: -Copyright (c) 2011, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -decode_fuzzer.c: -Copyright (c) 2015 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." - diff --git a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT.meta b/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT.meta deleted file mode 100644 index 23ab37827..000000000 --- a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: ad2aa0f35903c91a3a6f4e68038686d5 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib.meta b/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib.meta deleted file mode 100644 index 5ce549000..000000000 --- a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b36206566e8c87fb0a48d58bcbeeac35 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0.meta b/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0.meta deleted file mode 100644 index 03338124f..000000000 --- a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 00b4ff731ea89be429d779a12bfcc2e1 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll b/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll deleted file mode 100644 index 315623926..000000000 Binary files a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll and /dev/null differ diff --git a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll.meta b/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll.meta deleted file mode 100644 index b1136d6d6..000000000 --- a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: c302643d7365a215dacc6f0fe5cdfd88 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml b/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml deleted file mode 100644 index 84c02132f..000000000 --- a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml +++ /dev/null @@ -1,200 +0,0 @@ - - - System.Runtime.CompilerServices.Unsafe - - - - Contains generic, low-level functionality for manipulating pointers. - - - Adds an element offset to the given reference. - The reference to add the offset to. - The offset to add. - The type of reference. - A new reference that reflects the addition of offset to pointer. - - - Adds an element offset to the given reference. - The reference to add the offset to. - The offset to add. - The type of reference. - A new reference that reflects the addition of offset to pointer. - - - Adds a byte offset to the given reference. - The reference to add the offset to. - The offset to add. - The type of reference. - A new reference that reflects the addition of byte offset to pointer. - - - Determines whether the specified references point to the same location. - The first reference to compare. - The second reference to compare. - The type of reference. - true if left and right point to the same location; otherwise, false. - - - Casts the given object to the specified type. - The object to cast. - The type which the object will be cast to. - The original object, casted to the given type. - - - Reinterprets the given reference as a reference to a value of type TTo. - The reference to reinterpret. - The type of reference to reinterpret.. - The desired type of the reference. - A reference to a value of type TTo. - - - Returns a pointer to the given by-ref parameter. - The object whose pointer is obtained. - The type of object. - A pointer to the given value. - - - Reinterprets the given location as a reference to a value of type T. - The location of the value to reference. - The type of the interpreted location. - A reference to a value of type T. - - - Determines the byte offset from origin to target from the given references. - The reference to origin. - The reference to target. - The type of reference. - Byte offset from origin to target i.e. target - origin. - - - Copies a value of type T to the given location. - The location to copy to. - A reference to the value to copy. - The type of value to copy. - - - Copies a value of type T to the given location. - The location to copy to. - A pointer to the value to copy. - The type of value to copy. - - - Copies bytes from the source address to the destination address. - The destination address to copy to. - The source address to copy from. - The number of bytes to copy. - - - Copies bytes from the source address to the destination address. - The destination address to copy to. - The source address to copy from. - The number of bytes to copy. - - - Copies bytes from the source address to the destination address -without assuming architecture dependent alignment of the addresses. - The destination address to copy to. - The source address to copy from. - The number of bytes to copy. - - - Copies bytes from the source address to the destination address -without assuming architecture dependent alignment of the addresses. - The destination address to copy to. - The source address to copy from. - The number of bytes to copy. - - - Initializes a block of memory at the given location with a given initial value. - The address of the start of the memory block to initialize. - The value to initialize the block to. - The number of bytes to initialize. - - - Initializes a block of memory at the given location with a given initial value. - The address of the start of the memory block to initialize. - The value to initialize the block to. - The number of bytes to initialize. - - - Initializes a block of memory at the given location with a given initial value -without assuming architecture dependent alignment of the address. - The address of the start of the memory block to initialize. - The value to initialize the block to. - The number of bytes to initialize. - - - Initializes a block of memory at the given location with a given initial value -without assuming architecture dependent alignment of the address. - The address of the start of the memory block to initialize. - The value to initialize the block to. - The number of bytes to initialize. - - - Reads a value of type T from the given location. - The location to read from. - The type to read. - An object of type T read from the given location. - - - Reads a value of type T from the given location -without assuming architecture dependent alignment of the addresses. - The location to read from. - The type to read. - An object of type T read from the given location. - - - Reads a value of type T from the given location -without assuming architecture dependent alignment of the addresses. - The location to read from. - The type to read. - An object of type T read from the given location. - - - Returns the size of an object of the given type parameter. - The type of object whose size is retrieved. - The size of an object of type T. - - - Subtracts an element offset from the given reference. - The reference to subtract the offset from. - The offset to subtract. - The type of reference. - A new reference that reflects the subraction of offset from pointer. - - - Subtracts an element offset from the given reference. - The reference to subtract the offset from. - The offset to subtract. - The type of reference. - A new reference that reflects the subraction of offset from pointer. - - - Subtracts a byte offset from the given reference. - The reference to subtract the offset from. - - The type of reference. - A new reference that reflects the subraction of byte offset from pointer. - - - Writes a value of type T to the given location. - The location to write to. - The value to write. - The type of value to write. - - - Writes a value of type T to the given location -without assuming architecture dependent alignment of the addresses. - The location to write to. - The value to write. - The type of value to write. - - - Writes a value of type T to the given location -without assuming architecture dependent alignment of the addresses. - The location to write to. - The value to write. - The type of value to write. - - - \ No newline at end of file diff --git a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml.meta b/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml.meta deleted file mode 100644 index c4a83ad00..000000000 --- a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 9ba4a7a6f2232e96a98073f2e8c1c795 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/useSharedDesignerContext.txt b/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/useSharedDesignerContext.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/useSharedDesignerContext.txt.meta b/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/useSharedDesignerContext.txt.meta deleted file mode 100644 index 11818647b..000000000 --- a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/useSharedDesignerContext.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 53d0e173bdb86477ebe32b6d0f5e588c -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt b/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt deleted file mode 100644 index 7558087f9..000000000 --- a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt +++ /dev/null @@ -1 +0,0 @@ -02b11eeee1fbc5f3ef43a1452fe07efd25fa1715 diff --git a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt.meta b/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt.meta deleted file mode 100644 index 8b9257927..000000000 --- a/Assets/SpacetimeDB/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 07e253f0e146e6c43a6ec6b0b58212ce -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Scripts.meta b/Assets/SpacetimeDB/Scripts.meta deleted file mode 100644 index 8b5f71efd..000000000 --- a/Assets/SpacetimeDB/Scripts.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 10dd1ca43de00b578b7a58913a7330cf -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/SpacetimeDB/Scripts/ClientApi.cs b/Assets/SpacetimeDB/Scripts/ClientApi.cs deleted file mode 100644 index e6604e910..000000000 --- a/Assets/SpacetimeDB/Scripts/ClientApi.cs +++ /dev/null @@ -1,1709 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: client_api.proto -// -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace ClientApi { - - /// Holder for reflection information generated from client_api.proto - public static partial class ClientApiReflection { - - #region Descriptor - /// File descriptor for client_api.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static ClientApiReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "ChBjbGllbnRfYXBpLnByb3RvEgpjbGllbnRfYXBpIpUCCgdNZXNzYWdlEjAK", - "DGZ1bmN0aW9uQ2FsbBgBIAEoCzIYLmNsaWVudF9hcGkuRnVuY3Rpb25DYWxs", - "SAASPAoSc3Vic2NyaXB0aW9uVXBkYXRlGAIgASgLMh4uY2xpZW50X2FwaS5T", - "dWJzY3JpcHRpb25VcGRhdGVIABIiCgVldmVudBgDIAEoCzIRLmNsaWVudF9h", - "cGkuRXZlbnRIABI6ChF0cmFuc2FjdGlvblVwZGF0ZRgEIAEoCzIdLmNsaWVu", - "dF9hcGkuVHJhbnNhY3Rpb25VcGRhdGVIABIyCg1pZGVudGl0eVRva2VuGAUg", - "ASgLMhkuY2xpZW50X2FwaS5JZGVudGl0eVRva2VuSABCBgoEdHlwZSIwCg1J", - "ZGVudGl0eVRva2VuEhAKCGlkZW50aXR5GAEgASgMEg0KBXRva2VuGAIgASgJ", - "IjEKDEZ1bmN0aW9uQ2FsbBIPCgdyZWR1Y2VyGAEgASgJEhAKCGFyZ0J5dGVz", - "GAIgASgMIpkCCgVFdmVudBIRCgl0aW1lc3RhbXAYASABKAQSFgoOY2FsbGVy", - "SWRlbnRpdHkYAiABKAwSLgoMZnVuY3Rpb25DYWxsGAMgASgLMhguY2xpZW50", - "X2FwaS5GdW5jdGlvbkNhbGwSKAoGc3RhdHVzGAQgASgOMhguY2xpZW50X2Fw", - "aS5FdmVudC5TdGF0dXMSDwoHbWVzc2FnZRgFIAEoCRIaChJlbmVyZ3lfcXVh", - "bnRhX3VzZWQYBiABKAMSJgoeaG9zdF9leGVjdXRpb25fZHVyYXRpb25fbWlj", - "cm9zGAcgASgEIjYKBlN0YXR1cxINCgljb21taXR0ZWQQABIKCgZmYWlsZWQQ", - "ARIRCg1vdXRfb2ZfZW5lcmd5EAIiQwoSU3Vic2NyaXB0aW9uVXBkYXRlEi0K", - "DHRhYmxlVXBkYXRlcxgBIAMoCzIXLmNsaWVudF9hcGkuVGFibGVVcGRhdGUi", - "bAoLVGFibGVVcGRhdGUSDwoHdGFibGVJZBgBIAEoDRIRCgl0YWJsZU5hbWUY", - "AiABKAkSOQoSdGFibGVSb3dPcGVyYXRpb25zGAMgAygLMh0uY2xpZW50X2Fw", - "aS5UYWJsZVJvd09wZXJhdGlvbiKSAQoRVGFibGVSb3dPcGVyYXRpb24SNwoC", - "b3AYASABKA4yKy5jbGllbnRfYXBpLlRhYmxlUm93T3BlcmF0aW9uLk9wZXJh", - "dGlvblR5cGUSDgoGcm93X3BrGAIgASgMEgsKA3JvdxgDIAEoDCInCg1PcGVy", - "YXRpb25UeXBlEgoKBkRFTEVURRAAEgoKBklOU0VSVBABInEKEVRyYW5zYWN0", - "aW9uVXBkYXRlEiAKBWV2ZW50GAEgASgLMhEuY2xpZW50X2FwaS5FdmVudBI6", - "ChJzdWJzY3JpcHRpb25VcGRhdGUYAiABKAsyHi5jbGllbnRfYXBpLlN1YnNj", - "cmlwdGlvblVwZGF0ZWIGcHJvdG8z")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::ClientApi.Message), global::ClientApi.Message.Parser, new[]{ "FunctionCall", "SubscriptionUpdate", "Event", "TransactionUpdate", "IdentityToken" }, new[]{ "Type" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ClientApi.IdentityToken), global::ClientApi.IdentityToken.Parser, new[]{ "Identity", "Token" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ClientApi.FunctionCall), global::ClientApi.FunctionCall.Parser, new[]{ "Reducer", "ArgBytes" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ClientApi.Event), global::ClientApi.Event.Parser, new[]{ "Timestamp", "CallerIdentity", "FunctionCall", "Status", "Message", "EnergyQuantaUsed", "HostExecutionDurationMicros" }, null, new[]{ typeof(global::ClientApi.Event.Types.Status) }, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ClientApi.SubscriptionUpdate), global::ClientApi.SubscriptionUpdate.Parser, new[]{ "TableUpdates" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ClientApi.TableUpdate), global::ClientApi.TableUpdate.Parser, new[]{ "TableId", "TableName", "TableRowOperations" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ClientApi.TableRowOperation), global::ClientApi.TableRowOperation.Parser, new[]{ "Op", "RowPk", "Row" }, null, new[]{ typeof(global::ClientApi.TableRowOperation.Types.OperationType) }, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ClientApi.TransactionUpdate), global::ClientApi.TransactionUpdate.Parser, new[]{ "Event", "SubscriptionUpdate" }, null, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /////// Generic Message ////// - /// TODO: Theoretically this format could be replaced by TypeValue/TypeDef - /// but I don't think we want to do that yet. - /// TODO: Split this up into ServerBound and ClientBound if there's no overlap - /// - public sealed partial class Message : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Message()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::ClientApi.ClientApiReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Message() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Message(Message other) : this() { - switch (other.TypeCase) { - case TypeOneofCase.FunctionCall: - FunctionCall = other.FunctionCall.Clone(); - break; - case TypeOneofCase.SubscriptionUpdate: - SubscriptionUpdate = other.SubscriptionUpdate.Clone(); - break; - case TypeOneofCase.Event: - Event = other.Event.Clone(); - break; - case TypeOneofCase.TransactionUpdate: - TransactionUpdate = other.TransactionUpdate.Clone(); - break; - case TypeOneofCase.IdentityToken: - IdentityToken = other.IdentityToken.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Message Clone() { - return new Message(this); - } - - /// Field number for the "functionCall" field. - public const int FunctionCallFieldNumber = 1; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::ClientApi.FunctionCall FunctionCall { - get { return typeCase_ == TypeOneofCase.FunctionCall ? (global::ClientApi.FunctionCall) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.FunctionCall; - } - } - - /// Field number for the "subscriptionUpdate" field. - public const int SubscriptionUpdateFieldNumber = 2; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::ClientApi.SubscriptionUpdate SubscriptionUpdate { - get { return typeCase_ == TypeOneofCase.SubscriptionUpdate ? (global::ClientApi.SubscriptionUpdate) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.SubscriptionUpdate; - } - } - - /// Field number for the "event" field. - public const int EventFieldNumber = 3; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::ClientApi.Event Event { - get { return typeCase_ == TypeOneofCase.Event ? (global::ClientApi.Event) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.Event; - } - } - - /// Field number for the "transactionUpdate" field. - public const int TransactionUpdateFieldNumber = 4; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::ClientApi.TransactionUpdate TransactionUpdate { - get { return typeCase_ == TypeOneofCase.TransactionUpdate ? (global::ClientApi.TransactionUpdate) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.TransactionUpdate; - } - } - - /// Field number for the "identityToken" field. - public const int IdentityTokenFieldNumber = 5; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::ClientApi.IdentityToken IdentityToken { - get { return typeCase_ == TypeOneofCase.IdentityToken ? (global::ClientApi.IdentityToken) type_ : null; } - set { - type_ = value; - typeCase_ = value == null ? TypeOneofCase.None : TypeOneofCase.IdentityToken; - } - } - - private object type_; - /// Enum of possible cases for the "type" oneof. - public enum TypeOneofCase { - None = 0, - FunctionCall = 1, - SubscriptionUpdate = 2, - Event = 3, - TransactionUpdate = 4, - IdentityToken = 5, - } - private TypeOneofCase typeCase_ = TypeOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TypeOneofCase TypeCase { - get { return typeCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearType() { - typeCase_ = TypeOneofCase.None; - type_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Message); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Message other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(FunctionCall, other.FunctionCall)) return false; - if (!object.Equals(SubscriptionUpdate, other.SubscriptionUpdate)) return false; - if (!object.Equals(Event, other.Event)) return false; - if (!object.Equals(TransactionUpdate, other.TransactionUpdate)) return false; - if (!object.Equals(IdentityToken, other.IdentityToken)) return false; - if (TypeCase != other.TypeCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (typeCase_ == TypeOneofCase.FunctionCall) hash ^= FunctionCall.GetHashCode(); - if (typeCase_ == TypeOneofCase.SubscriptionUpdate) hash ^= SubscriptionUpdate.GetHashCode(); - if (typeCase_ == TypeOneofCase.Event) hash ^= Event.GetHashCode(); - if (typeCase_ == TypeOneofCase.TransactionUpdate) hash ^= TransactionUpdate.GetHashCode(); - if (typeCase_ == TypeOneofCase.IdentityToken) hash ^= IdentityToken.GetHashCode(); - hash ^= (int) typeCase_; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - if (typeCase_ == TypeOneofCase.FunctionCall) { - output.WriteRawTag(10); - output.WriteMessage(FunctionCall); - } - if (typeCase_ == TypeOneofCase.SubscriptionUpdate) { - output.WriteRawTag(18); - output.WriteMessage(SubscriptionUpdate); - } - if (typeCase_ == TypeOneofCase.Event) { - output.WriteRawTag(26); - output.WriteMessage(Event); - } - if (typeCase_ == TypeOneofCase.TransactionUpdate) { - output.WriteRawTag(34); - output.WriteMessage(TransactionUpdate); - } - if (typeCase_ == TypeOneofCase.IdentityToken) { - output.WriteRawTag(42); - output.WriteMessage(IdentityToken); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (typeCase_ == TypeOneofCase.FunctionCall) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(FunctionCall); - } - if (typeCase_ == TypeOneofCase.SubscriptionUpdate) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(SubscriptionUpdate); - } - if (typeCase_ == TypeOneofCase.Event) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Event); - } - if (typeCase_ == TypeOneofCase.TransactionUpdate) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(TransactionUpdate); - } - if (typeCase_ == TypeOneofCase.IdentityToken) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(IdentityToken); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Message other) { - if (other == null) { - return; - } - switch (other.TypeCase) { - case TypeOneofCase.FunctionCall: - if (FunctionCall == null) { - FunctionCall = new global::ClientApi.FunctionCall(); - } - FunctionCall.MergeFrom(other.FunctionCall); - break; - case TypeOneofCase.SubscriptionUpdate: - if (SubscriptionUpdate == null) { - SubscriptionUpdate = new global::ClientApi.SubscriptionUpdate(); - } - SubscriptionUpdate.MergeFrom(other.SubscriptionUpdate); - break; - case TypeOneofCase.Event: - if (Event == null) { - Event = new global::ClientApi.Event(); - } - Event.MergeFrom(other.Event); - break; - case TypeOneofCase.TransactionUpdate: - if (TransactionUpdate == null) { - TransactionUpdate = new global::ClientApi.TransactionUpdate(); - } - TransactionUpdate.MergeFrom(other.TransactionUpdate); - break; - case TypeOneofCase.IdentityToken: - if (IdentityToken == null) { - IdentityToken = new global::ClientApi.IdentityToken(); - } - IdentityToken.MergeFrom(other.IdentityToken); - break; - } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - global::ClientApi.FunctionCall subBuilder = new global::ClientApi.FunctionCall(); - if (typeCase_ == TypeOneofCase.FunctionCall) { - subBuilder.MergeFrom(FunctionCall); - } - input.ReadMessage(subBuilder); - FunctionCall = subBuilder; - break; - } - case 18: { - global::ClientApi.SubscriptionUpdate subBuilder = new global::ClientApi.SubscriptionUpdate(); - if (typeCase_ == TypeOneofCase.SubscriptionUpdate) { - subBuilder.MergeFrom(SubscriptionUpdate); - } - input.ReadMessage(subBuilder); - SubscriptionUpdate = subBuilder; - break; - } - case 26: { - global::ClientApi.Event subBuilder = new global::ClientApi.Event(); - if (typeCase_ == TypeOneofCase.Event) { - subBuilder.MergeFrom(Event); - } - input.ReadMessage(subBuilder); - Event = subBuilder; - break; - } - case 34: { - global::ClientApi.TransactionUpdate subBuilder = new global::ClientApi.TransactionUpdate(); - if (typeCase_ == TypeOneofCase.TransactionUpdate) { - subBuilder.MergeFrom(TransactionUpdate); - } - input.ReadMessage(subBuilder); - TransactionUpdate = subBuilder; - break; - } - case 42: { - global::ClientApi.IdentityToken subBuilder = new global::ClientApi.IdentityToken(); - if (typeCase_ == TypeOneofCase.IdentityToken) { - subBuilder.MergeFrom(IdentityToken); - } - input.ReadMessage(subBuilder); - IdentityToken = subBuilder; - break; - } - } - } - } - - } - - public sealed partial class IdentityToken : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IdentityToken()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::ClientApi.ClientApiReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public IdentityToken() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public IdentityToken(IdentityToken other) : this() { - identity_ = other.identity_; - token_ = other.token_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public IdentityToken Clone() { - return new IdentityToken(this); - } - - /// Field number for the "identity" field. - public const int IdentityFieldNumber = 1; - private pb::ByteString identity_ = pb::ByteString.Empty; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pb::ByteString Identity { - get { return identity_; } - set { - identity_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "token" field. - public const int TokenFieldNumber = 2; - private string token_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Token { - get { return token_; } - set { - token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as IdentityToken); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(IdentityToken other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Identity != other.Identity) return false; - if (Token != other.Token) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Identity.Length != 0) hash ^= Identity.GetHashCode(); - if (Token.Length != 0) hash ^= Token.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - if (Identity.Length != 0) { - output.WriteRawTag(10); - output.WriteBytes(Identity); - } - if (Token.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Token); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Identity.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(Identity); - } - if (Token.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(IdentityToken other) { - if (other == null) { - return; - } - if (other.Identity.Length != 0) { - Identity = other.Identity; - } - if (other.Token.Length != 0) { - Token = other.Token; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Identity = input.ReadBytes(); - break; - } - case 18: { - Token = input.ReadString(); - break; - } - } - } - } - - } - - /// - /// TODO: Evaluate if it makes sense for this to also include the - /// identity and name of the module this is calling - /// - public sealed partial class FunctionCall : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FunctionCall()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::ClientApi.ClientApiReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FunctionCall() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FunctionCall(FunctionCall other) : this() { - reducer_ = other.reducer_; - argBytes_ = other.argBytes_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FunctionCall Clone() { - return new FunctionCall(this); - } - - /// Field number for the "reducer" field. - public const int ReducerFieldNumber = 1; - private string reducer_ = ""; - /// - /// TODO: Maybe this should be replaced with an int identifier for performance? - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Reducer { - get { return reducer_; } - set { - reducer_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "argBytes" field. - public const int ArgBytesFieldNumber = 2; - private pb::ByteString argBytes_ = pb::ByteString.Empty; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pb::ByteString ArgBytes { - get { return argBytes_; } - set { - argBytes_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as FunctionCall); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(FunctionCall other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Reducer != other.Reducer) return false; - if (ArgBytes != other.ArgBytes) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Reducer.Length != 0) hash ^= Reducer.GetHashCode(); - if (ArgBytes.Length != 0) hash ^= ArgBytes.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - if (Reducer.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Reducer); - } - if (ArgBytes.Length != 0) { - output.WriteRawTag(18); - output.WriteBytes(ArgBytes); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Reducer.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Reducer); - } - if (ArgBytes.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(ArgBytes); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(FunctionCall other) { - if (other == null) { - return; - } - if (other.Reducer.Length != 0) { - Reducer = other.Reducer; - } - if (other.ArgBytes.Length != 0) { - ArgBytes = other.ArgBytes; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Reducer = input.ReadString(); - break; - } - case 18: { - ArgBytes = input.ReadBytes(); - break; - } - } - } - } - - } - - public sealed partial class Event : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Event()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::ClientApi.ClientApiReflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Event() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Event(Event other) : this() { - timestamp_ = other.timestamp_; - callerIdentity_ = other.callerIdentity_; - functionCall_ = other.functionCall_ != null ? other.functionCall_.Clone() : null; - status_ = other.status_; - message_ = other.message_; - energyQuantaUsed_ = other.energyQuantaUsed_; - hostExecutionDurationMicros_ = other.hostExecutionDurationMicros_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Event Clone() { - return new Event(this); - } - - /// Field number for the "timestamp" field. - public const int TimestampFieldNumber = 1; - private ulong timestamp_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong Timestamp { - get { return timestamp_; } - set { - timestamp_ = value; - } - } - - /// Field number for the "callerIdentity" field. - public const int CallerIdentityFieldNumber = 2; - private pb::ByteString callerIdentity_ = pb::ByteString.Empty; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pb::ByteString CallerIdentity { - get { return callerIdentity_; } - set { - callerIdentity_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "functionCall" field. - public const int FunctionCallFieldNumber = 3; - private global::ClientApi.FunctionCall functionCall_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::ClientApi.FunctionCall FunctionCall { - get { return functionCall_; } - set { - functionCall_ = value; - } - } - - /// Field number for the "status" field. - public const int StatusFieldNumber = 4; - private global::ClientApi.Event.Types.Status status_ = global::ClientApi.Event.Types.Status.Committed; - /// - /// TODO: arguably these should go inside an EventStatus message - /// since success doesn't have a message - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::ClientApi.Event.Types.Status Status { - get { return status_; } - set { - status_ = value; - } - } - - /// Field number for the "message" field. - public const int MessageFieldNumber = 5; - private string message_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Message { - get { return message_; } - set { - message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "energy_quanta_used" field. - public const int EnergyQuantaUsedFieldNumber = 6; - private long energyQuantaUsed_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long EnergyQuantaUsed { - get { return energyQuantaUsed_; } - set { - energyQuantaUsed_ = value; - } - } - - /// Field number for the "host_execution_duration_micros" field. - public const int HostExecutionDurationMicrosFieldNumber = 7; - private ulong hostExecutionDurationMicros_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ulong HostExecutionDurationMicros { - get { return hostExecutionDurationMicros_; } - set { - hostExecutionDurationMicros_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Event); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Event other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Timestamp != other.Timestamp) return false; - if (CallerIdentity != other.CallerIdentity) return false; - if (!object.Equals(FunctionCall, other.FunctionCall)) return false; - if (Status != other.Status) return false; - if (Message != other.Message) return false; - if (EnergyQuantaUsed != other.EnergyQuantaUsed) return false; - if (HostExecutionDurationMicros != other.HostExecutionDurationMicros) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Timestamp != 0UL) hash ^= Timestamp.GetHashCode(); - if (CallerIdentity.Length != 0) hash ^= CallerIdentity.GetHashCode(); - if (functionCall_ != null) hash ^= FunctionCall.GetHashCode(); - if (Status != global::ClientApi.Event.Types.Status.Committed) hash ^= Status.GetHashCode(); - if (Message.Length != 0) hash ^= Message.GetHashCode(); - if (EnergyQuantaUsed != 0L) hash ^= EnergyQuantaUsed.GetHashCode(); - if (HostExecutionDurationMicros != 0UL) hash ^= HostExecutionDurationMicros.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - if (Timestamp != 0UL) { - output.WriteRawTag(8); - output.WriteUInt64(Timestamp); - } - if (CallerIdentity.Length != 0) { - output.WriteRawTag(18); - output.WriteBytes(CallerIdentity); - } - if (functionCall_ != null) { - output.WriteRawTag(26); - output.WriteMessage(FunctionCall); - } - if (Status != global::ClientApi.Event.Types.Status.Committed) { - output.WriteRawTag(32); - output.WriteEnum((int) Status); - } - if (Message.Length != 0) { - output.WriteRawTag(42); - output.WriteString(Message); - } - if (EnergyQuantaUsed != 0L) { - output.WriteRawTag(48); - output.WriteInt64(EnergyQuantaUsed); - } - if (HostExecutionDurationMicros != 0UL) { - output.WriteRawTag(56); - output.WriteUInt64(HostExecutionDurationMicros); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Timestamp != 0UL) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Timestamp); - } - if (CallerIdentity.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(CallerIdentity); - } - if (functionCall_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(FunctionCall); - } - if (Status != global::ClientApi.Event.Types.Status.Committed) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Status); - } - if (Message.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); - } - if (EnergyQuantaUsed != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(EnergyQuantaUsed); - } - if (HostExecutionDurationMicros != 0UL) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(HostExecutionDurationMicros); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Event other) { - if (other == null) { - return; - } - if (other.Timestamp != 0UL) { - Timestamp = other.Timestamp; - } - if (other.CallerIdentity.Length != 0) { - CallerIdentity = other.CallerIdentity; - } - if (other.functionCall_ != null) { - if (functionCall_ == null) { - FunctionCall = new global::ClientApi.FunctionCall(); - } - FunctionCall.MergeFrom(other.FunctionCall); - } - if (other.Status != global::ClientApi.Event.Types.Status.Committed) { - Status = other.Status; - } - if (other.Message.Length != 0) { - Message = other.Message; - } - if (other.EnergyQuantaUsed != 0L) { - EnergyQuantaUsed = other.EnergyQuantaUsed; - } - if (other.HostExecutionDurationMicros != 0UL) { - HostExecutionDurationMicros = other.HostExecutionDurationMicros; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Timestamp = input.ReadUInt64(); - break; - } - case 18: { - CallerIdentity = input.ReadBytes(); - break; - } - case 26: { - if (functionCall_ == null) { - FunctionCall = new global::ClientApi.FunctionCall(); - } - input.ReadMessage(FunctionCall); - break; - } - case 32: { - Status = (global::ClientApi.Event.Types.Status) input.ReadEnum(); - break; - } - case 42: { - Message = input.ReadString(); - break; - } - case 48: { - EnergyQuantaUsed = input.ReadInt64(); - break; - } - case 56: { - HostExecutionDurationMicros = input.ReadUInt64(); - break; - } - } - } - } - - #region Nested types - /// Container for nested types declared in the Event message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static partial class Types { - public enum Status { - [pbr::OriginalName("committed")] Committed = 0, - [pbr::OriginalName("failed")] Failed = 1, - [pbr::OriginalName("out_of_energy")] OutOfEnergy = 2, - } - - } - #endregion - - } - - /// - /// TODO: Maybe call this StateUpdate if it's implied to be a subscription update - /// - public sealed partial class SubscriptionUpdate : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubscriptionUpdate()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::ClientApi.ClientApiReflection.Descriptor.MessageTypes[4]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SubscriptionUpdate() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SubscriptionUpdate(SubscriptionUpdate other) : this() { - tableUpdates_ = other.tableUpdates_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SubscriptionUpdate Clone() { - return new SubscriptionUpdate(this); - } - - /// Field number for the "tableUpdates" field. - public const int TableUpdatesFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_tableUpdates_codec - = pb::FieldCodec.ForMessage(10, global::ClientApi.TableUpdate.Parser); - private readonly pbc::RepeatedField tableUpdates_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField TableUpdates { - get { return tableUpdates_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SubscriptionUpdate); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SubscriptionUpdate other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!tableUpdates_.Equals(other.tableUpdates_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= tableUpdates_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - tableUpdates_.WriteTo(output, _repeated_tableUpdates_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += tableUpdates_.CalculateSize(_repeated_tableUpdates_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SubscriptionUpdate other) { - if (other == null) { - return; - } - tableUpdates_.Add(other.tableUpdates_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - tableUpdates_.AddEntriesFrom(input, _repeated_tableUpdates_codec); - break; - } - } - } - } - - } - - public sealed partial class TableUpdate : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TableUpdate()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::ClientApi.ClientApiReflection.Descriptor.MessageTypes[5]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TableUpdate() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TableUpdate(TableUpdate other) : this() { - tableId_ = other.tableId_; - tableName_ = other.tableName_; - tableRowOperations_ = other.tableRowOperations_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TableUpdate Clone() { - return new TableUpdate(this); - } - - /// Field number for the "tableId" field. - public const int TableIdFieldNumber = 1; - private uint tableId_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint TableId { - get { return tableId_; } - set { - tableId_ = value; - } - } - - /// Field number for the "tableName" field. - public const int TableNameFieldNumber = 2; - private string tableName_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string TableName { - get { return tableName_; } - set { - tableName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "tableRowOperations" field. - public const int TableRowOperationsFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_tableRowOperations_codec - = pb::FieldCodec.ForMessage(26, global::ClientApi.TableRowOperation.Parser); - private readonly pbc::RepeatedField tableRowOperations_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField TableRowOperations { - get { return tableRowOperations_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as TableUpdate); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TableUpdate other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (TableId != other.TableId) return false; - if (TableName != other.TableName) return false; - if(!tableRowOperations_.Equals(other.tableRowOperations_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (TableId != 0) hash ^= TableId.GetHashCode(); - if (TableName.Length != 0) hash ^= TableName.GetHashCode(); - hash ^= tableRowOperations_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - if (TableId != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TableId); - } - if (TableName.Length != 0) { - output.WriteRawTag(18); - output.WriteString(TableName); - } - tableRowOperations_.WriteTo(output, _repeated_tableRowOperations_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (TableId != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(TableId); - } - if (TableName.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(TableName); - } - size += tableRowOperations_.CalculateSize(_repeated_tableRowOperations_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TableUpdate other) { - if (other == null) { - return; - } - if (other.TableId != 0) { - TableId = other.TableId; - } - if (other.TableName.Length != 0) { - TableName = other.TableName; - } - tableRowOperations_.Add(other.tableRowOperations_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - TableId = input.ReadUInt32(); - break; - } - case 18: { - TableName = input.ReadString(); - break; - } - case 26: { - tableRowOperations_.AddEntriesFrom(input, _repeated_tableRowOperations_codec); - break; - } - } - } - } - - } - - public sealed partial class TableRowOperation : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TableRowOperation()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::ClientApi.ClientApiReflection.Descriptor.MessageTypes[6]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TableRowOperation() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TableRowOperation(TableRowOperation other) : this() { - op_ = other.op_; - rowPk_ = other.rowPk_; - row_ = other.row_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TableRowOperation Clone() { - return new TableRowOperation(this); - } - - /// Field number for the "op" field. - public const int OpFieldNumber = 1; - private global::ClientApi.TableRowOperation.Types.OperationType op_ = global::ClientApi.TableRowOperation.Types.OperationType.Delete; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::ClientApi.TableRowOperation.Types.OperationType Op { - get { return op_; } - set { - op_ = value; - } - } - - /// Field number for the "row_pk" field. - public const int RowPkFieldNumber = 2; - private pb::ByteString rowPk_ = pb::ByteString.Empty; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pb::ByteString RowPk { - get { return rowPk_; } - set { - rowPk_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "row" field. - public const int RowFieldNumber = 3; - private pb::ByteString row_ = pb::ByteString.Empty; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pb::ByteString Row { - get { return row_; } - set { - row_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as TableRowOperation); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TableRowOperation other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Op != other.Op) return false; - if (RowPk != other.RowPk) return false; - if (Row != other.Row) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Op != global::ClientApi.TableRowOperation.Types.OperationType.Delete) hash ^= Op.GetHashCode(); - if (RowPk.Length != 0) hash ^= RowPk.GetHashCode(); - if (Row.Length != 0) hash ^= Row.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - if (Op != global::ClientApi.TableRowOperation.Types.OperationType.Delete) { - output.WriteRawTag(8); - output.WriteEnum((int) Op); - } - if (RowPk.Length != 0) { - output.WriteRawTag(18); - output.WriteBytes(RowPk); - } - if (Row.Length != 0) { - output.WriteRawTag(26); - output.WriteBytes(Row); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Op != global::ClientApi.TableRowOperation.Types.OperationType.Delete) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Op); - } - if (RowPk.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(RowPk); - } - if (Row.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(Row); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TableRowOperation other) { - if (other == null) { - return; - } - if (other.Op != global::ClientApi.TableRowOperation.Types.OperationType.Delete) { - Op = other.Op; - } - if (other.RowPk.Length != 0) { - RowPk = other.RowPk; - } - if (other.Row.Length != 0) { - Row = other.Row; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Op = (global::ClientApi.TableRowOperation.Types.OperationType) input.ReadEnum(); - break; - } - case 18: { - RowPk = input.ReadBytes(); - break; - } - case 26: { - Row = input.ReadBytes(); - break; - } - } - } - } - - #region Nested types - /// Container for nested types declared in the TableRowOperation message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static partial class Types { - public enum OperationType { - [pbr::OriginalName("DELETE")] Delete = 0, - [pbr::OriginalName("INSERT")] Insert = 1, - } - - } - #endregion - - } - - public sealed partial class TransactionUpdate : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TransactionUpdate()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::ClientApi.ClientApiReflection.Descriptor.MessageTypes[7]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TransactionUpdate() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TransactionUpdate(TransactionUpdate other) : this() { - event_ = other.event_ != null ? other.event_.Clone() : null; - subscriptionUpdate_ = other.subscriptionUpdate_ != null ? other.subscriptionUpdate_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TransactionUpdate Clone() { - return new TransactionUpdate(this); - } - - /// Field number for the "event" field. - public const int EventFieldNumber = 1; - private global::ClientApi.Event event_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::ClientApi.Event Event { - get { return event_; } - set { - event_ = value; - } - } - - /// Field number for the "subscriptionUpdate" field. - public const int SubscriptionUpdateFieldNumber = 2; - private global::ClientApi.SubscriptionUpdate subscriptionUpdate_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::ClientApi.SubscriptionUpdate SubscriptionUpdate { - get { return subscriptionUpdate_; } - set { - subscriptionUpdate_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as TransactionUpdate); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TransactionUpdate other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Event, other.Event)) return false; - if (!object.Equals(SubscriptionUpdate, other.SubscriptionUpdate)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (event_ != null) hash ^= Event.GetHashCode(); - if (subscriptionUpdate_ != null) hash ^= SubscriptionUpdate.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - if (event_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Event); - } - if (subscriptionUpdate_ != null) { - output.WriteRawTag(18); - output.WriteMessage(SubscriptionUpdate); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (event_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Event); - } - if (subscriptionUpdate_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(SubscriptionUpdate); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TransactionUpdate other) { - if (other == null) { - return; - } - if (other.event_ != null) { - if (event_ == null) { - Event = new global::ClientApi.Event(); - } - Event.MergeFrom(other.Event); - } - if (other.subscriptionUpdate_ != null) { - if (subscriptionUpdate_ == null) { - SubscriptionUpdate = new global::ClientApi.SubscriptionUpdate(); - } - SubscriptionUpdate.MergeFrom(other.SubscriptionUpdate); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (event_ == null) { - Event = new global::ClientApi.Event(); - } - input.ReadMessage(Event); - break; - } - case 18: { - if (subscriptionUpdate_ == null) { - SubscriptionUpdate = new global::ClientApi.SubscriptionUpdate(); - } - input.ReadMessage(SubscriptionUpdate); - break; - } - } - } - } - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/Assets/SpacetimeDB/Scripts/ClientCache.cs b/Assets/SpacetimeDB/Scripts/ClientCache.cs deleted file mode 100644 index bcb381b20..000000000 --- a/Assets/SpacetimeDB/Scripts/ClientCache.cs +++ /dev/null @@ -1,178 +0,0 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.ComponentModel.Design; -using System.Linq; -using System.Net.Http.Headers; -using Google.Protobuf; -using UnityEngine; -using ClientApi; - -namespace SpacetimeDB -{ - public class ClientCache - { - public class TableCache - { - private class ByteArrayComparer : IEqualityComparer - { - public bool Equals(byte[] left, byte[] right) - { - if (left == null || right == null) - { - return left == right; - } - - return left.SequenceEqual(right); - } - - public int GetHashCode(byte[] key) - { - if (key == null) - throw new ArgumentNullException(nameof(key)); - return key.Sum(b => b); - } - } - - private readonly string name; - private readonly TypeDef rowSchema; - - // The function to use for decoding a type value - private Func decoderFunc; - - // Maps from primary key to type value - public readonly Dictionary entries; - // Maps from primary key to decoded value - public readonly ConcurrentDictionary decodedValues; - - public TableCache(string name, TypeDef rowSchema, Func decoderFunc) - { - this.name = name; - this.rowSchema = rowSchema; - this.decoderFunc = decoderFunc; - entries = new Dictionary(new ByteArrayComparer()); - decodedValues = new ConcurrentDictionary(new ByteArrayComparer()); - } - - public (TypeValue?, object) Decode(byte[] pk, TypeValue? value) - { - if (decodedValues.TryGetValue(pk, out var decoded)) - { - return decoded; - } - - if (!value.HasValue) - { - return (null, null); - } - decoded = (value.Value, decoderFunc(value.Value)); - decodedValues[pk] = decoded; - return decoded; - } - - public TypeDef GetSchema() => rowSchema; - - /// - /// Inserts the value into the table. There can be no existing value with the provided pk. - /// - /// - public object Insert(byte[] rowPk) - { - if (entries.TryGetValue(rowPk, out _)) - { - return null; - } - - var decodedTuple = Decode(rowPk, null); - if (decodedTuple.Item1.HasValue && decodedTuple.Item2 != null) - { - entries[rowPk] = (decodedTuple.Item1.Value, decodedTuple.Item2); - return decodedTuple.Item2; - } - - // Read failure - Debug.LogError($"Read error when converting row value for table: {name} (version issue?)"); - return null; - } - - /// - /// Updates an entry. Returns whether or not the update was successful. Updates only succeed if - /// a previous value was overwritten. - /// - /// The primary key that uniquely identifies this row - /// The new for the table entry - /// True when the old value was removed and the new value was inserted. - public bool Update(ByteString pk, ByteString newValueByteString) - { - // We have to figure out if pk is going to change or not - throw new InvalidOperationException(); - } - - /// - /// Deletes a value from the table. - /// - /// The primary key that uniquely identifies this row - /// - public object Delete(byte[] rowPk) - { - if (entries.TryGetValue(rowPk, out var value)) - { - entries.Remove(rowPk); - return value.Item2; - } - - return null; - } - } - - private readonly ConcurrentDictionary tables = new ConcurrentDictionary(); - - public void AddTable(string name, TypeDef tableRowDef, Func decodeFunc) - { - if (tables.TryGetValue(name, out _)) - { - Debug.LogError($"Table with name already exists: {name}"); - return; - } - - // Initialize this table - tables[name] = new TableCache(name, tableRowDef, decodeFunc); - } - public IEnumerable GetObjects(string name) - { - if (!tables.TryGetValue(name, out var table)) - { - yield break; - } - - foreach (var entry in table.entries) - { - yield return entry.Value.Item2; - } - } - - public IEnumerable GetEntries(string name) - { - if (!tables.TryGetValue(name, out var table)) - { - yield break; - } - - foreach (var entry in table.entries) - { - yield return entry.Value.Item1; - } - } - - public TableCache GetTable(string name) - { - if (tables.TryGetValue(name, out var table)) - { - return table; - } - - Debug.LogError($"We don't know that this table is: {name}"); - return null; - } - } -} \ No newline at end of file diff --git a/Assets/SpacetimeDB/Scripts/ClientCache.cs.meta b/Assets/SpacetimeDB/Scripts/ClientCache.cs.meta deleted file mode 100644 index a95aebaee..000000000 --- a/Assets/SpacetimeDB/Scripts/ClientCache.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 2ec50a3dcb5beb66e8728d6649ac3065 -timeCreated: 1658252769 \ No newline at end of file diff --git a/Assets/SpacetimeDB/Scripts/IDatabaseTable.cs b/Assets/SpacetimeDB/Scripts/IDatabaseTable.cs deleted file mode 100644 index ec8c06f8f..000000000 --- a/Assets/SpacetimeDB/Scripts/IDatabaseTable.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -namespace SpacetimeDB -{ - public interface IDatabaseTable { } -} \ No newline at end of file diff --git a/Assets/SpacetimeDB/Scripts/NetworkManager.cs b/Assets/SpacetimeDB/Scripts/NetworkManager.cs deleted file mode 100644 index bdaba0000..000000000 --- a/Assets/SpacetimeDB/Scripts/NetworkManager.cs +++ /dev/null @@ -1,369 +0,0 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Net.WebSockets; -using System.Reflection; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using ClientApi; -using SpacetimeDB; -using UnityEngine; - -namespace SpacetimeDB -{ - public class NetworkManager : MonoBehaviour - { - public enum TableOp - { - Insert, - Delete, - Update - } - - [Serializable] - public class Message - { - public string fn; - public object[] args; - } - - private struct DbEvent - { - public string tableName; - public TableOp op; - public object oldValue; - public object newValue; - } - - public delegate void RowUpdate(string tableName, TableOp op, object oldValue, object newValue); - - /// - /// Called when a connection is established to a spacetimedb instance. - /// - public event Action onConnect; - - /// - /// Called when a connection attempt fails. - /// - public event Action onConnectError; - - /// - /// Called when a connection that was established has disconnected. - /// - public event Action onDisconnect; - - /// - /// Invoked on each row update to each table. - /// - public event RowUpdate tableUpdate; - - /// - /// Callback is invoked after a transaction or subscription update is received and all updates have been applied. - /// - public event Action onRowUpdateComplete; - - /// - /// Called when we receive an identity from the server - /// - public event Action onIdentityReceived; - - /// - /// Invoked when an event message is received or at the end of a transaction update. - /// - public event Action onEvent; - - private SpacetimeDB.WebSocket webSocket; - private bool connectionClosed; - public static ClientCache clientDB; - - private Thread messageProcessThread; - - public static NetworkManager instance; - - protected void Awake() - { - if (instance != null) - { - Debug.LogError($"There is more than one {GetType()}"); - return; - } - - instance = this; - - var options = new SpacetimeDB.ConnectOptions - { - //v1.bin.spacetimedb - //v1.text.spacetimedb - Protocol = "v1.bin.spacetimedb", - }; - webSocket = new SpacetimeDB.WebSocket(options); - webSocket.OnMessage += OnMessageReceived; - webSocket.OnClose += (code, error) => onDisconnect?.Invoke(code, error); - webSocket.OnConnect += () => onConnect?.Invoke(); - webSocket.OnConnectError += a => onConnectError?.Invoke(a); - - clientDB = new ClientCache(); - - var type = typeof(IDatabaseTable); - var types = AppDomain.CurrentDomain.GetAssemblies() - .SelectMany(s => s.GetTypes()) - .Where(p => type.IsAssignableFrom(p)); - foreach (var @class in types) - { - if (!@class.IsClass) - { - continue; - } - - var typeDefFunc = @class.GetMethod("GetTypeDef", BindingFlags.Static | BindingFlags.Public); - var typeDef = typeDefFunc!.Invoke(null, null) as TypeDef; - // var conversionFunc = @class.GetMethod("op_Explicit"); - var conversionFunc = @class.GetMethods().FirstOrDefault(a => - a.Name == "op_Explicit" && a.GetParameters().Length > 0 && - a.GetParameters()[0].ParameterType == typeof(TypeValue)); - clientDB.AddTable(@class.Name, typeDef, - a => { return conversionFunc!.Invoke(null, new object[] { a }); }); - } - - messageProcessThread = new Thread(ProcessMessages); - messageProcessThread.Start(); - } - - private readonly BlockingCollection _messageQueue = new BlockingCollection(); - private readonly ConcurrentQueue _completedMessages = new ConcurrentQueue(); - - void ProcessMessages() - { - while (true) - { - var bytes = _messageQueue.Take(); - - var message = ClientApi.Message.Parser.ParseFrom(bytes); - SubscriptionUpdate subscriptionUpdate = null; - switch (message.TypeCase) - { - case ClientApi.Message.TypeOneofCase.SubscriptionUpdate: - subscriptionUpdate = message.SubscriptionUpdate; - break; - case ClientApi.Message.TypeOneofCase.TransactionUpdate: - subscriptionUpdate = message.TransactionUpdate.SubscriptionUpdate; - break; - } - - switch (message.TypeCase) - { - case ClientApi.Message.TypeOneofCase.SubscriptionUpdate: - case ClientApi.Message.TypeOneofCase.TransactionUpdate: - // First apply all of the state - System.Diagnostics.Debug.Assert(subscriptionUpdate != null, - nameof(subscriptionUpdate) + " != null"); - foreach (var update in subscriptionUpdate.TableUpdates) - { - foreach (var row in update.TableRowOperations) - { - var table = clientDB.GetTable(update.TableName); - var typeDef = table.GetSchema(); - var (typeValue, _) = TypeValue.Decode(typeDef, row.Row); - if (typeValue.HasValue) - { - // Here we are decoding on our message thread so that by the time we get to the - // main thread the cache is already warm. - table.Decode(row.RowPk.ToByteArray(), typeValue.Value); - } - } - } - - break; - } - - _completedMessages.Enqueue(bytes); - } - } - - private void OnDestroy() - { - connectionClosed = true; - webSocket.Close(); - webSocket = null; - } - - /// - /// Connect to a remote spacetime instance. - /// - /// The host or IP address and the port to connect to. Example: spacetime.spacetimedb.net:3000 - /// The name or address of the database to connect to - public void Connect(string host, string addressOrName) - { - var token = PlayerPrefs.HasKey(GetTokenKey()) ? PlayerPrefs.GetString(GetTokenKey()) : null; - - Task.Run(async () => - { - try - { - await webSocket.Connect(token, host, addressOrName); - } - catch (Exception e) - { - if (connectionClosed) - { - Debug.Log("Connection closed gracefully."); - return; - } - - Debug.LogException(e); - } - }); - } - - readonly List _dbEvents = new List(); - - private void OnMessageProcessComplete(byte[] bytes) - { - _dbEvents.Clear(); - var message = ClientApi.Message.Parser.ParseFrom(bytes); - - SubscriptionUpdate subscriptionUpdate = null; - switch (message.TypeCase) - { - case ClientApi.Message.TypeOneofCase.SubscriptionUpdate: - subscriptionUpdate = message.SubscriptionUpdate; - break; - case ClientApi.Message.TypeOneofCase.TransactionUpdate: - subscriptionUpdate = message.TransactionUpdate.SubscriptionUpdate; - break; - } - - switch (message.TypeCase) - { - case ClientApi.Message.TypeOneofCase.SubscriptionUpdate: - case ClientApi.Message.TypeOneofCase.TransactionUpdate: - // First apply all of the state - foreach (var update in subscriptionUpdate.TableUpdates) - { - var tableName = update.TableName; - var table = clientDB.GetTable(tableName); - if (table == null) - { - continue; - } - - foreach (var row in update.TableRowOperations) - { - var rowPk = row.RowPk.ToByteArray(); - - switch (row.Op) - { - case TableRowOperation.Types.OperationType.Delete: - var deletedValue = table.Delete(rowPk); - if (deletedValue != null) - { - _dbEvents.Add(new DbEvent - { - tableName = tableName, - op = TableOp.Delete, - newValue = null, - oldValue = deletedValue, - }); - } - - break; - case TableRowOperation.Types.OperationType.Insert: - var insertedValue = table.Insert(rowPk); - if (insertedValue != null) - { - _dbEvents.Add(new DbEvent - { - tableName = tableName, - op = TableOp.Insert, - newValue = insertedValue, - oldValue = null - }); - } - - break; - } - } - } - - // Send out events - var eventCount = _dbEvents.Count; - for (int i = 0; i < eventCount; i++) - { - bool isUpdate = false; - if (i < eventCount - 1) - { - if (_dbEvents[i].op == TableOp.Delete && _dbEvents[i + 1].op == TableOp.Insert) - { - // somewhat hacky: Delete followed by an insert on the same table is considered an update. - isUpdate = _dbEvents[i].tableName.Equals(_dbEvents[i + 1].tableName); - } - } - - if (isUpdate) - { - // Merge delete and insert in one update - tableUpdate?.Invoke(_dbEvents[i].tableName, TableOp.Update, _dbEvents[i].oldValue, - _dbEvents[i + 1].newValue); - i++; - } - else - { - tableUpdate?.Invoke(_dbEvents[i].tableName, _dbEvents[i].op, _dbEvents[i].oldValue, - _dbEvents[i].newValue); - } - } - - switch (message.TypeCase) - { - case ClientApi.Message.TypeOneofCase.SubscriptionUpdate: - onRowUpdateComplete?.Invoke(); - break; - case ClientApi.Message.TypeOneofCase.TransactionUpdate: - onRowUpdateComplete?.Invoke(); - onEvent?.Invoke(message.TransactionUpdate.Event); - break; - } - - break; - case ClientApi.Message.TypeOneofCase.IdentityToken: - onIdentityReceived?.Invoke(Hash.From(message.IdentityToken.Identity.ToByteArray())); - PlayerPrefs.SetString(GetTokenKey(), message.IdentityToken.Token); - break; - case ClientApi.Message.TypeOneofCase.Event: - onEvent?.Invoke(message.Event); - break; - } - } - - - private void OnMessageReceived(byte[] bytes) => _messageQueue.Add(bytes); - - private string GetTokenKey() - { - var key = "spacetimedb.identity_token"; -#if UNITY_EDITOR - // Different editors need different keys - key += $" - {Application.dataPath}"; -#endif - return key; - } - - internal void InternalCallReducer(Message message) - { - var json = Newtonsoft.Json.JsonConvert.SerializeObject(message); - webSocket.Send(Encoding.ASCII.GetBytes(json)); - } - - private void Update() - { - webSocket.Update(); - - while (_completedMessages.TryDequeue(out var result)) - { - OnMessageProcessComplete(result); - } - } - } -} \ No newline at end of file diff --git a/Assets/SpacetimeDB/Scripts/TypeDef.cs b/Assets/SpacetimeDB/Scripts/TypeDef.cs deleted file mode 100644 index 1883e3ad2..000000000 --- a/Assets/SpacetimeDB/Scripts/TypeDef.cs +++ /dev/null @@ -1,496 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Google.Protobuf; -using UnityEngine; - -namespace SpacetimeDB -{ - public class TypeDef - { - public enum Def - { - Tuple = 0, - Enum, - - // base types - Vec, - U8, - U16, - U32, - U64, - U128, - I8, - I16, - I32, - I64, - I128, - Bool, - F32, - F64, - String, - Bytes, - Hash, - Unit, - } - - public Def Type => type; - public ElementDef[] TupleElements => tupleElements; - - public TypeDef VecMemberType => vecMemberType; - - public Def type; - private TypeDef vecMemberType; - public ElementDef[] tupleElements; - - public static TypeDef GetVec(TypeDef memberType) - { - return new TypeDef - { - type = Def.Vec, - vecMemberType = memberType, - }; - } - - public static TypeDef BuiltInType(Def def) - { - switch (def) - { - case Def.Tuple: - case Def.Enum: - case Def.Vec: - Debug.LogError("This is not a built-in type"); - break; - } - - return new TypeDef - { - type = def, - }; - } - - public static TypeDef Tuple(ElementDef[] elements) - { - return new TypeDef - { - type = Def.Tuple, - tupleElements = elements, - }; - } - } - - public struct ElementDef - { - public byte tag; - public TypeDef element; - - public ElementDef(byte tag, TypeDef element) - { - this.tag = tag; - this.element = element; - } - } - - public struct TypeValue - { - public class TypeValueComparer : IEqualityComparer - { - public bool Equals(TypeValue value1, TypeValue value2) - { - if (value1.typeDef.Type != value2.typeDef.Type) - { - return false; - } - - // Handle any strange cases - switch (value1.typeDef.Type) - { - case TypeDef.Def.Tuple: - if ((value1.tupleElements == null) != (value2.tupleElements == null)) - { - return false; - } - - if (value1.tupleElements == null) - { - break; - } - - if (value1.tupleElements.Length != value2.tupleElements.Length) - { - return false; - } - - break; - } - - return true; - } - - public int GetHashCode(TypeValue obj) - { - switch (obj.typeDef.Type) - { - case TypeDef.Def.Bool: - return (int)(obj.b ? 0xab745abf : 0xf60d5833); - case TypeDef.Def.Bytes: - if (obj.bytes == null) - { - throw new InvalidOperationException("Cannot hash on null bytes."); - } - - return (int)(obj.bytes.GetHashCode() ^ 0x8595a70b); - case TypeDef.Def.Enum: - throw new NotImplementedException(); - case TypeDef.Def.F32: - case TypeDef.Def.F64: - throw new InvalidOperationException("Cannot hash on floats"); - case TypeDef.Def.Hash: - return (int)(obj.hash.GetHashCode() ^ 0x8595a70b); - case TypeDef.Def.I8: - return (int)(obj.signed ^ 0x6bac6c4e); - case TypeDef.Def.I16: - return (int)(obj.signed ^ 0x2b4e01bf); - case TypeDef.Def.I32: - return (int)(obj.signed ^ 0xe32a7812); - case TypeDef.Def.I64: - return (int)(obj.signed ^ 0xab745abf ^ (obj.signed >> 32)); - case TypeDef.Def.U8: - return (int)(obj.unsigned ^ 0xc2964a29); - case TypeDef.Def.U16: - return (int)(obj.unsigned ^ 0xfb504320); - case TypeDef.Def.U32: - return (int)(obj.unsigned ^ 0x74208545); - case TypeDef.Def.U64: - return (int)(obj.unsigned ^ 0x3ef90ce5 ^ (obj.unsigned >> 32)); - case TypeDef.Def.I128: - case TypeDef.Def.U128: - throw new InvalidOperationException("Hashing on 128 bit integers unsupported"); - case TypeDef.Def.String: - if (obj.str == null) - { - throw new InvalidOperationException("Cannot hash on null string."); - } - - return obj.str.GetHashCode() ^ 0x33e1b1f4; - case TypeDef.Def.Tuple: - { - var hash = (int)(obj.tupleElements.Length ^ 0xbbce67bf); - foreach (var element in obj.tupleElements) - { - hash ^= element.GetHashCode(); - } - - return hash; - } - case TypeDef.Def.Unit: - return 0x64b22bc4; - case TypeDef.Def.Vec: - var vecHash = 0x0fec85d5; - foreach (var value in obj.vec) - { - vecHash ^= value.GetHashCode(); - } - - return vecHash; - } - - throw new NotImplementedException($"Hashing on: {obj.typeDef.Type}"); - } - } - - public TypeDef TypeDef => typeDef; - - private TypeDef typeDef; - private ulong unsigned; - private long signed; - private string str; - private byte[] bytes; - private Hash hash; - private bool b; - - private float f32; - private double f64; - private TypeValue[] tupleElements; - private List vec; - - public override string ToString() - { - if (tupleElements != null) { - var s = "(\n"; - foreach (var e in tupleElements) { - s += "\t"; - s += e.ToString(); - s += "\n"; - } - s += ")"; - return s; - } else { - return String.Format($"typeDef={typeDef.Type}, unsigned={unsigned}, signed={signed}, str={str}, bytes={bytes}, bool={b}, float={f32}, double={f64}"); - } - } - - internal static (TypeValue?, int) Decode(TypeDef def, ByteString bytes) - { - var b = bytes[1]; - var byteArr = bytes.ToByteArray(); - return Decode(def, byteArr, 0, byteArr.Length); - } - - internal static (TypeValue?, int) Decode(TypeDef def, byte[] arr, int offset, int length) - { - var value = new TypeValue - { - typeDef = def - }; - var read = 0; - - try - { - switch (def.Type) - { - case TypeDef.Def.Bool: - value.b = arr[offset] != 0; - read = 1; - break; - case TypeDef.Def.U8: - value.unsigned = arr[offset]; - read = 1; - break; - case TypeDef.Def.U16: - value.unsigned = BitConverter.ToUInt16(arr, offset); - read = 2; - break; - case TypeDef.Def.U32: - value.unsigned = BitConverter.ToUInt32(arr, offset); - read = 4; - break; - case TypeDef.Def.U64: - value.unsigned = BitConverter.ToUInt64(arr, offset); - read = 8; - break; - case TypeDef.Def.I8: - value.signed = arr[offset]; - read = 1; - break; - case TypeDef.Def.I16: - value.signed = BitConverter.ToInt16(arr, offset); - read = 2; - break; - case TypeDef.Def.I32: - value.signed = BitConverter.ToInt32(arr, offset); - read = 4; - break; - case TypeDef.Def.I64: - value.signed = BitConverter.ToInt64(arr, offset); - read = 8; - break; - case TypeDef.Def.F32: - value.f32 = BitConverter.ToSingle(arr, offset); - read = 4; - break; - case TypeDef.Def.F64: - value.f64 = BitConverter.ToDouble(arr, offset); - read = 8; - break; - case TypeDef.Def.String: - var strLength = BitConverter.ToUInt16(arr, offset); - value.str = Encoding.UTF8.GetString(arr, offset + 2, strLength); - read += strLength + 2; - break; - case TypeDef.Def.Bytes: - var byteLength = BitConverter.ToUInt16(arr, offset); - if (byteLength >= arr.Length - (offset + 2)) - { - throw new InvalidOperationException( - $"Read error: byte array goes past the end of the array: {byteLength}"); - } - - value.bytes = new byte[byteLength]; - Array.Copy(arr, offset + 2, value.bytes, 0, byteLength); - read += byteLength + 2; - break; - case TypeDef.Def.Hash: - byte[] hashVal = new byte[Hash.SIZE]; - Array.Copy(arr, offset, hashVal, 0, Hash.SIZE); - read += Hash.SIZE; - value.hash = Hash.From(hashVal); - break; - case TypeDef.Def.Tuple: - return ReadTuple(def, arr, offset, length); - case TypeDef.Def.Vec: - if (def.VecMemberType == null) - { - throw new InvalidOperationException("Read error: vec has no member type!"); - } - - var vecLength = BitConverter.ToUInt16(arr, offset); - read += 2; - value.vec = new List(); - for (var idx = 0; idx < vecLength; idx++) - { - var (entry, subDecodeRead) = Decode(def.VecMemberType, arr, offset + read, length); - read += subDecodeRead; - if (entry.HasValue) - { - value.vec.Add(entry.Value); - } - } - - break; - default: - Debug.LogError($"This type is unsupported for now: {def.Type}"); - return (null, 0); - } - } - catch (Exception e) - { - Debug.LogException(e); - Debug.LogError("Please report this error in the SpacetimeDB discord."); - return (null, 0); - } - - return (value, read); - } - - private static (TypeValue?, int) ReadTuple(TypeDef def, byte[] arr, int offset, int length) - { - var read = 0; - var resultElements = new TypeValue[def.TupleElements.Length]; - var elementIdx = 0; - foreach (var elementDef in def.TupleElements) - { - var (value, bytesRead) = Decode(elementDef.element, arr, offset + read, length); - - if (!value.HasValue) - { - return (null, 0); - } - - read += bytesRead; - resultElements[elementIdx++] = value.Value; - } - - return (GetTuple(def, resultElements), read); - } - - public object GetValue(TypeDef.Def def) - { - switch (def) - { - case TypeDef.Def.Bool: - return b; - case TypeDef.Def.U8: - return (byte)unsigned; - case TypeDef.Def.U16: - return (ushort)unsigned; - case TypeDef.Def.U32: - return (uint)unsigned; - case TypeDef.Def.U64: - return unsigned; - case TypeDef.Def.U128: - throw new InvalidOperationException("U128 not supported in C#"); - - case TypeDef.Def.I8: - return (byte)signed; - case TypeDef.Def.I16: - return (ushort)signed; - case TypeDef.Def.I32: - return (int)signed; - case TypeDef.Def.I64: - return signed; - case TypeDef.Def.I128: - throw new InvalidOperationException("I128 not supported in C#"); - - case TypeDef.Def.String: - return str; - case TypeDef.Def.Bytes: - if (bytes == null) - throw new InvalidOperationException("byte array is null!"); - return bytes; - case TypeDef.Def.Hash: - return hash; - case TypeDef.Def.F32: - return f32; - case TypeDef.Def.F64: - return f64; - case TypeDef.Def.Tuple: - return tupleElements; - case TypeDef.Def.Vec: - return vec; - } - - throw new InvalidOperationException($"Type not supported yet! {def}"); - } - - public object GetValue(TypeDef def) - { - return GetValue(def.Type); - } - - public static TypeValue GetTuple(TypeDef def, TypeValue[] tupleValues) - { - return new TypeValue - { - typeDef = def, - tupleElements = tupleValues, - }; - } - - public static TypeValue GetVec(TypeDef memberType, IEnumerable values) - { - return new TypeValue - { - typeDef = TypeDef.GetVec(memberType), - vec = new List(values), - }; - } - } - - public struct Hash : IEquatable - { - private byte[] bytes; - - public static int SIZE = 32; - - public byte[] Bytes => bytes; - - public static TypeDef GetTypeDef() - { - return TypeDef.BuiltInType(TypeDef.Def.Hash); - } - - public static explicit operator Hash(TypeValue v) => (Hash)v.GetValue(GetTypeDef()); - - public static Hash From(byte[] bytes) - { - // TODO: should we validate length here? - return new Hash - { - bytes = bytes, - }; - } - - public bool Equals(Hash other) - { - return bytes.SequenceEqual(other.bytes); - } - - public override bool Equals(object o) { - return o is Hash other && Equals(other); - } - - public static bool operator ==(Hash a, Hash b) => a.Equals(b); - public static bool operator !=(Hash a, Hash b) => !a.Equals(b); - - public override int GetHashCode() { - if (bytes == null) - { - throw new InvalidOperationException("Cannot hash on null bytes."); - } - - return bytes.GetHashCode(); - } - } -} diff --git a/Assets/SpacetimeDB/Scripts/TypeDef.cs.meta b/Assets/SpacetimeDB/Scripts/TypeDef.cs.meta deleted file mode 100644 index 7306cba35..000000000 --- a/Assets/SpacetimeDB/Scripts/TypeDef.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 6ebc8a2d7cebaea6e9e6bd87e94781bd -timeCreated: 1657552127 \ No newline at end of file diff --git a/Assets/SpacetimeDB/Scripts/WebSocket.cs b/Assets/SpacetimeDB/Scripts/WebSocket.cs deleted file mode 100644 index 6cbac8d9e..000000000 --- a/Assets/SpacetimeDB/Scripts/WebSocket.cs +++ /dev/null @@ -1,267 +0,0 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Net.WebSockets; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using UnityEngine; - -namespace SpacetimeDB -{ - internal abstract class MainThreadDispatch - { - public abstract void Execute(); - } - - class OnConnectMessage : MainThreadDispatch - { - private WebSocketOpenEventHandler receiver; - - public OnConnectMessage(WebSocketOpenEventHandler receiver) - { - this.receiver = receiver; - } - - public override void Execute() - { - receiver.Invoke(); - } - } - - class OnDisconnectMessage : MainThreadDispatch - { - private WebSocketCloseEventHandler receiver; - private WebSocketError? error; - private WebSocketCloseStatus? status; - - public OnDisconnectMessage(WebSocketCloseEventHandler receiver, WebSocketCloseStatus? status, - WebSocketError? error) - { - this.receiver = receiver; - this.error = error; - this.status = status; - } - - public override void Execute() - { - receiver.Invoke(status, error); - } - } - - class OnConnectErrorMessage : MainThreadDispatch - { - private WebSocketConnectErrorEventHandler receiver; - private WebSocketError? error; - - public OnConnectErrorMessage(WebSocketConnectErrorEventHandler receiver, WebSocketError? error) - { - this.receiver = receiver; - this.error = error; - } - - public override void Execute() - { - receiver.Invoke(error); - } - } - - class OnMessage : MainThreadDispatch - { - private WebSocketMessageEventHandler receiver; - private byte[] message; - - public OnMessage(WebSocketMessageEventHandler receiver, byte[] message) - { - this.receiver = receiver; - this.message = message; - } - - public override void Execute() - { - receiver.Invoke(message); - } - } - - public delegate void WebSocketOpenEventHandler(); - - public delegate void WebSocketMessageEventHandler(byte[] message); - - public delegate void WebSocketCloseEventHandler(WebSocketCloseStatus? code, WebSocketError? error); - - public delegate void WebSocketConnectErrorEventHandler(WebSocketError? error); - - public struct ConnectOptions - { - public string Protocol; - } - - - public class WebSocket - { - // WebSocket buffer for incoming messages - private static readonly int MAXMessageSize = 0x4000000; // 64MB - - // Connection parameters - private readonly ConnectOptions _options; - private readonly byte[] _receiveBuffer = new byte[MAXMessageSize]; - private readonly ConcurrentQueue dispatchQueue = new ConcurrentQueue(); - - protected ClientWebSocket Ws; - - public WebSocket(ConnectOptions options) - { - Ws = new ClientWebSocket(); - _options = options; - } - - public event WebSocketOpenEventHandler OnConnect; - public event WebSocketConnectErrorEventHandler OnConnectError; - public event WebSocketMessageEventHandler OnMessage; - public event WebSocketCloseEventHandler OnClose; - - public async Task Connect(string auth, string host, string nameOrAddress) - { - var url = new Uri($"ws://{host}/database/subscribe?name_or_address={nameOrAddress}"); - Ws.Options.AddSubProtocol(_options.Protocol); - - var source = new CancellationTokenSource(10000); - if (!string.IsNullOrEmpty(auth)) - { - var tokenBytes = Encoding.UTF8.GetBytes($"token:{auth}"); - var base64 = Convert.ToBase64String(tokenBytes); - Ws.Options.SetRequestHeader("Authorization", "Basic " + base64); - } - else - { - Ws.Options.UseDefaultCredentials = true; - } - - try - { - await Ws.ConnectAsync(url, source.Token); - dispatchQueue.Enqueue(new OnConnectMessage(OnConnect)); - } - catch (WebSocketException ex) - { - dispatchQueue.Enqueue(new OnConnectErrorMessage(OnConnectError, ex.WebSocketErrorCode)); - return; - } - catch (Exception e) - { - Debug.LogException(e); - dispatchQueue.Enqueue(new OnConnectErrorMessage(OnConnectError, null)); - return; - } - - while (Ws.State == WebSocketState.Open) - { - try - { - var receiveResult = await Ws.ReceiveAsync(new ArraySegment(_receiveBuffer), - CancellationToken.None); - if (receiveResult.MessageType == WebSocketMessageType.Close) - { - await Ws.CloseAsync(WebSocketCloseStatus.NormalClosure, string.Empty, - CancellationToken.None); - dispatchQueue.Enqueue(new OnDisconnectMessage(OnClose, receiveResult.CloseStatus, null)); - return; - } - - var count = receiveResult.Count; - while (receiveResult.EndOfMessage == false) - { - if (count >= MAXMessageSize) - { - // TODO: Improve this, we should allow clients to receive messages of whatever size - var closeMessage = $"Maximum message size: {MAXMessageSize} bytes."; - await Ws.CloseAsync(WebSocketCloseStatus.MessageTooBig, closeMessage, - CancellationToken.None); - dispatchQueue.Enqueue(new OnDisconnectMessage(OnClose, WebSocketCloseStatus.MessageTooBig, null)); - return; - } - - receiveResult = await Ws.ReceiveAsync( - new ArraySegment(_receiveBuffer, count, MAXMessageSize - count), - CancellationToken.None); - count += receiveResult.Count; - } - - var buffCopy = new byte[count]; - for (var x = 0; x < count; x++) - buffCopy[x] = _receiveBuffer[x]; - dispatchQueue.Enqueue(new OnMessage(OnMessage, buffCopy)); - } - catch (WebSocketException ex) - { - dispatchQueue.Enqueue(new OnDisconnectMessage(OnClose, null, ex.WebSocketErrorCode)); - return; - } - } - } - - public Task Close(WebSocketCloseStatus code = WebSocketCloseStatus.NormalClosure, string reason = null) - { - Ws?.CloseAsync(code, "Disconnecting normally.", CancellationToken.None); - Ws = null; - - return Task.CompletedTask; - } - - private readonly object sendingLock = new object(); - private Task senderTask = null; - private readonly ConcurrentQueue messageSendQueue = new ConcurrentQueue(); - - /// - /// This sender guarantees that that messages are sent out in the order they are received. Our websocket - /// library only allows us to await one send call, so we have to wait until the current send call is complete - /// before we start another one. This function is also thread safe, just in case. - /// - /// The message to send - public void Send(byte[] message) - { - lock (messageSendQueue) - { - messageSendQueue.Enqueue(message); - if (senderTask == null) - { - senderTask = Task.Run(async () => { await ProcessSendQueue(); }); - } - } - } - - - private async Task ProcessSendQueue() - { - while (true) - { - byte[] message; - lock (messageSendQueue) - { - if (!messageSendQueue.TryDequeue(out message)) - { - // We are out of messages to send - senderTask = null; - return; - } - } - - await Ws!.SendAsync(new ArraySegment(message), WebSocketMessageType.Text, true, - CancellationToken.None); - } - } - - public WebSocketState GetState() - { - return Ws!.State; - } - - public void Update() - { - while (dispatchQueue.TryDequeue(out var result)) - { - result.Execute(); - } - } - } -} \ No newline at end of file diff --git a/Assets/SpacetimeDB/Scripts/WebSocket.cs.meta b/Assets/SpacetimeDB/Scripts/WebSocket.cs.meta deleted file mode 100644 index afff70f5a..000000000 --- a/Assets/SpacetimeDB/Scripts/WebSocket.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 0e36b7f4e40f850758fc453d53de0fbc -timeCreated: 1656515225 \ No newline at end of file diff --git a/DEVELOP.md b/DEVELOP.md new file mode 100644 index 000000000..2b9ac7d98 --- /dev/null +++ b/DEVELOP.md @@ -0,0 +1,6 @@ +# Notes for maintainers + +## `SpacetimeDB.ClientApi` + +To regenerate this namespace, run the `tools~/gen-client-api.sh` or the +`tools~/gen-client-api.bat` script. diff --git a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/THIRD-PARTY-NOTICES.TXT.meta b/DEVELOP.md.meta similarity index 75% rename from Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/THIRD-PARTY-NOTICES.TXT.meta rename to DEVELOP.md.meta index f957b12d6..eeac4b35e 100644 --- a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/THIRD-PARTY-NOTICES.TXT.meta +++ b/DEVELOP.md.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 433c6abe5431a5218ba6f021d03cf86f +guid: a3279c10dee07d74daa647909f7882bf TextScriptImporter: externalObjects: {} userData: diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 000000000..2bf91e970 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,6 @@ + + + bin~ + obj~ + + diff --git a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/Google.Protobuf.3.21.9.nupkg.meta b/Directory.Build.props.meta similarity index 74% rename from Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/Google.Protobuf.3.21.9.nupkg.meta rename to Directory.Build.props.meta index b846aa175..c7afb4971 100644 --- a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/Google.Protobuf.3.21.9.nupkg.meta +++ b/Directory.Build.props.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ae6c2b051853d83cb9e85a527f516a08 +guid: e8c57a282e7de1f4788630d42ea90a3d DefaultImporter: externalObjects: {} userData: diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 000000000..4a459866a --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib/net45/Google.Protobuf.xml.meta b/LICENSE.txt.meta similarity index 75% rename from Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib/net45/Google.Protobuf.xml.meta rename to LICENSE.txt.meta index b16412ad8..cc52583fa 100644 --- a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib/net45/Google.Protobuf.xml.meta +++ b/LICENSE.txt.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 05459738c7bc33eec99c6d6b8f458b13 +guid: a9576a820941d4473b81734019e6bae4 TextScriptImporter: externalObjects: {} userData: diff --git a/Packages/manifest.json b/Packages/manifest.json deleted file mode 100644 index 137e47ead..000000000 --- a/Packages/manifest.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "dependencies": { - "com.unity.collab-proxy": "1.15.4", - "com.unity.ide.rider": "2.0.7", - "com.unity.ide.visualstudio": "2.0.12", - "com.unity.ide.vscode": "1.2.4", - "com.unity.render-pipelines.universal": "10.7.0", - "com.unity.test-framework": "1.1.29", - "com.unity.textmeshpro": "3.0.6", - "com.unity.timeline": "1.4.8", - "com.unity.ugui": "1.0.0", - "com.unity.modules.ai": "1.0.0", - "com.unity.modules.androidjni": "1.0.0", - "com.unity.modules.animation": "1.0.0", - "com.unity.modules.assetbundle": "1.0.0", - "com.unity.modules.audio": "1.0.0", - "com.unity.modules.cloth": "1.0.0", - "com.unity.modules.director": "1.0.0", - "com.unity.modules.imageconversion": "1.0.0", - "com.unity.modules.imgui": "1.0.0", - "com.unity.modules.jsonserialize": "1.0.0", - "com.unity.modules.particlesystem": "1.0.0", - "com.unity.modules.physics": "1.0.0", - "com.unity.modules.physics2d": "1.0.0", - "com.unity.modules.screencapture": "1.0.0", - "com.unity.modules.terrain": "1.0.0", - "com.unity.modules.terrainphysics": "1.0.0", - "com.unity.modules.tilemap": "1.0.0", - "com.unity.modules.ui": "1.0.0", - "com.unity.modules.uielements": "1.0.0", - "com.unity.modules.umbra": "1.0.0", - "com.unity.modules.unityanalytics": "1.0.0", - "com.unity.modules.unitywebrequest": "1.0.0", - "com.unity.modules.unitywebrequestassetbundle": "1.0.0", - "com.unity.modules.unitywebrequestaudio": "1.0.0", - "com.unity.modules.unitywebrequesttexture": "1.0.0", - "com.unity.modules.unitywebrequestwww": "1.0.0", - "com.unity.modules.vehicles": "1.0.0", - "com.unity.modules.video": "1.0.0", - "com.unity.modules.vr": "1.0.0", - "com.unity.modules.wind": "1.0.0", - "com.unity.modules.xr": "1.0.0" - } -} diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json deleted file mode 100644 index 984ab05e0..000000000 --- a/Packages/packages-lock.json +++ /dev/null @@ -1,403 +0,0 @@ -{ - "dependencies": { - "com.unity.collab-proxy": { - "version": "1.15.4", - "depth": 0, - "source": "registry", - "dependencies": { - "com.unity.nuget.newtonsoft-json": "2.0.0", - "com.unity.services.core": "1.0.1" - }, - "url": "https://packages.unity.com" - }, - "com.unity.ext.nunit": { - "version": "1.0.6", - "depth": 1, - "source": "registry", - "dependencies": {}, - "url": "https://packages.unity.com" - }, - "com.unity.ide.rider": { - "version": "2.0.7", - "depth": 0, - "source": "registry", - "dependencies": { - "com.unity.test-framework": "1.1.1" - }, - "url": "https://packages.unity.com" - }, - "com.unity.ide.visualstudio": { - "version": "2.0.12", - "depth": 0, - "source": "registry", - "dependencies": { - "com.unity.test-framework": "1.1.9" - }, - "url": "https://packages.unity.com" - }, - "com.unity.ide.vscode": { - "version": "1.2.4", - "depth": 0, - "source": "registry", - "dependencies": {}, - "url": "https://packages.unity.com" - }, - "com.unity.mathematics": { - "version": "1.1.0", - "depth": 1, - "source": "registry", - "dependencies": {}, - "url": "https://packages.unity.com" - }, - "com.unity.nuget.newtonsoft-json": { - "version": "2.0.0", - "depth": 1, - "source": "registry", - "dependencies": {}, - "url": "https://packages.unity.com" - }, - "com.unity.render-pipelines.core": { - "version": "10.7.0", - "depth": 1, - "source": "registry", - "dependencies": { - "com.unity.ugui": "1.0.0", - "com.unity.modules.physics": "1.0.0", - "com.unity.modules.jsonserialize": "1.0.0" - }, - "url": "https://packages.unity.com" - }, - "com.unity.render-pipelines.universal": { - "version": "10.7.0", - "depth": 0, - "source": "registry", - "dependencies": { - "com.unity.mathematics": "1.1.0", - "com.unity.render-pipelines.core": "10.7.0", - "com.unity.shadergraph": "10.7.0" - }, - "url": "https://packages.unity.com" - }, - "com.unity.searcher": { - "version": "4.3.2", - "depth": 2, - "source": "registry", - "dependencies": {}, - "url": "https://packages.unity.com" - }, - "com.unity.services.core": { - "version": "1.0.1", - "depth": 1, - "source": "registry", - "dependencies": { - "com.unity.modules.unitywebrequest": "1.0.0" - }, - "url": "https://packages.unity.com" - }, - "com.unity.shadergraph": { - "version": "10.7.0", - "depth": 1, - "source": "registry", - "dependencies": { - "com.unity.render-pipelines.core": "10.7.0", - "com.unity.searcher": "4.3.2" - }, - "url": "https://packages.unity.com" - }, - "com.unity.test-framework": { - "version": "1.1.29", - "depth": 0, - "source": "registry", - "dependencies": { - "com.unity.ext.nunit": "1.0.6", - "com.unity.modules.imgui": "1.0.0", - "com.unity.modules.jsonserialize": "1.0.0" - }, - "url": "https://packages.unity.com" - }, - "com.unity.textmeshpro": { - "version": "3.0.6", - "depth": 0, - "source": "registry", - "dependencies": { - "com.unity.ugui": "1.0.0" - }, - "url": "https://packages.unity.com" - }, - "com.unity.timeline": { - "version": "1.4.8", - "depth": 0, - "source": "registry", - "dependencies": { - "com.unity.modules.director": "1.0.0", - "com.unity.modules.animation": "1.0.0", - "com.unity.modules.audio": "1.0.0", - "com.unity.modules.particlesystem": "1.0.0" - }, - "url": "https://packages.unity.com" - }, - "com.unity.ugui": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": { - "com.unity.modules.ui": "1.0.0", - "com.unity.modules.imgui": "1.0.0" - } - }, - "com.unity.modules.ai": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": {} - }, - "com.unity.modules.androidjni": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": {} - }, - "com.unity.modules.animation": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": {} - }, - "com.unity.modules.assetbundle": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": {} - }, - "com.unity.modules.audio": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": {} - }, - "com.unity.modules.cloth": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": { - "com.unity.modules.physics": "1.0.0" - } - }, - "com.unity.modules.director": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": { - "com.unity.modules.audio": "1.0.0", - "com.unity.modules.animation": "1.0.0" - } - }, - "com.unity.modules.imageconversion": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": {} - }, - "com.unity.modules.imgui": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": {} - }, - "com.unity.modules.jsonserialize": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": {} - }, - "com.unity.modules.particlesystem": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": {} - }, - "com.unity.modules.physics": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": {} - }, - "com.unity.modules.physics2d": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": {} - }, - "com.unity.modules.screencapture": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": { - "com.unity.modules.imageconversion": "1.0.0" - } - }, - "com.unity.modules.subsystems": { - "version": "1.0.0", - "depth": 1, - "source": "builtin", - "dependencies": { - "com.unity.modules.jsonserialize": "1.0.0" - } - }, - "com.unity.modules.terrain": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": {} - }, - "com.unity.modules.terrainphysics": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": { - "com.unity.modules.physics": "1.0.0", - "com.unity.modules.terrain": "1.0.0" - } - }, - "com.unity.modules.tilemap": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": { - "com.unity.modules.physics2d": "1.0.0" - } - }, - "com.unity.modules.ui": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": {} - }, - "com.unity.modules.uielements": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": { - "com.unity.modules.ui": "1.0.0", - "com.unity.modules.imgui": "1.0.0", - "com.unity.modules.jsonserialize": "1.0.0", - "com.unity.modules.uielementsnative": "1.0.0" - } - }, - "com.unity.modules.uielementsnative": { - "version": "1.0.0", - "depth": 1, - "source": "builtin", - "dependencies": { - "com.unity.modules.ui": "1.0.0", - "com.unity.modules.imgui": "1.0.0", - "com.unity.modules.jsonserialize": "1.0.0" - } - }, - "com.unity.modules.umbra": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": {} - }, - "com.unity.modules.unityanalytics": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": { - "com.unity.modules.unitywebrequest": "1.0.0", - "com.unity.modules.jsonserialize": "1.0.0" - } - }, - "com.unity.modules.unitywebrequest": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": {} - }, - "com.unity.modules.unitywebrequestassetbundle": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": { - "com.unity.modules.assetbundle": "1.0.0", - "com.unity.modules.unitywebrequest": "1.0.0" - } - }, - "com.unity.modules.unitywebrequestaudio": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": { - "com.unity.modules.unitywebrequest": "1.0.0", - "com.unity.modules.audio": "1.0.0" - } - }, - "com.unity.modules.unitywebrequesttexture": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": { - "com.unity.modules.unitywebrequest": "1.0.0", - "com.unity.modules.imageconversion": "1.0.0" - } - }, - "com.unity.modules.unitywebrequestwww": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": { - "com.unity.modules.unitywebrequest": "1.0.0", - "com.unity.modules.unitywebrequestassetbundle": "1.0.0", - "com.unity.modules.unitywebrequestaudio": "1.0.0", - "com.unity.modules.audio": "1.0.0", - "com.unity.modules.assetbundle": "1.0.0", - "com.unity.modules.imageconversion": "1.0.0" - } - }, - "com.unity.modules.vehicles": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": { - "com.unity.modules.physics": "1.0.0" - } - }, - "com.unity.modules.video": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": { - "com.unity.modules.audio": "1.0.0", - "com.unity.modules.ui": "1.0.0", - "com.unity.modules.unitywebrequest": "1.0.0" - } - }, - "com.unity.modules.vr": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": { - "com.unity.modules.jsonserialize": "1.0.0", - "com.unity.modules.physics": "1.0.0", - "com.unity.modules.xr": "1.0.0" - } - }, - "com.unity.modules.wind": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": {} - }, - "com.unity.modules.xr": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": { - "com.unity.modules.physics": "1.0.0", - "com.unity.modules.jsonserialize": "1.0.0", - "com.unity.modules.subsystems": "1.0.0" - } - } - } -} diff --git a/ProjectSettings/AudioManager.asset b/ProjectSettings/AudioManager.asset deleted file mode 100644 index 27287fec5..000000000 --- a/ProjectSettings/AudioManager.asset +++ /dev/null @@ -1,19 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!11 &1 -AudioManager: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Volume: 1 - Rolloff Scale: 1 - Doppler Factor: 1 - Default Speaker Mode: 2 - m_SampleRate: 0 - m_DSPBufferSize: 1024 - m_VirtualVoiceCount: 512 - m_RealVoiceCount: 32 - m_SpatializerPlugin: - m_AmbisonicDecoderPlugin: - m_DisableAudio: 0 - m_VirtualizeEffects: 1 - m_RequestedDSPBufferSize: 0 diff --git a/ProjectSettings/ClusterInputManager.asset b/ProjectSettings/ClusterInputManager.asset deleted file mode 100644 index e7886b266..000000000 --- a/ProjectSettings/ClusterInputManager.asset +++ /dev/null @@ -1,6 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!236 &1 -ClusterInputManager: - m_ObjectHideFlags: 0 - m_Inputs: [] diff --git a/ProjectSettings/DynamicsManager.asset b/ProjectSettings/DynamicsManager.asset deleted file mode 100644 index 5d5bacb2a..000000000 --- a/ProjectSettings/DynamicsManager.asset +++ /dev/null @@ -1,36 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!55 &1 -PhysicsManager: - m_ObjectHideFlags: 0 - serializedVersion: 13 - m_Gravity: {x: 0, y: -9.81, z: 0} - m_DefaultMaterial: {fileID: 0} - m_BounceThreshold: 2 - m_SleepThreshold: 0.005 - m_DefaultContactOffset: 0.01 - m_DefaultSolverIterations: 6 - m_DefaultSolverVelocityIterations: 1 - m_QueriesHitBackfaces: 0 - m_QueriesHitTriggers: 1 - m_EnableAdaptiveForce: 0 - m_ClothInterCollisionDistance: 0.1 - m_ClothInterCollisionStiffness: 0.2 - m_ContactsGeneration: 1 - m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - m_AutoSimulation: 1 - m_AutoSyncTransforms: 0 - m_ReuseCollisionCallbacks: 1 - m_ClothInterCollisionSettingsToggle: 0 - m_ClothGravity: {x: 0, y: -9.81, z: 0} - m_ContactPairsMode: 0 - m_BroadphaseType: 0 - m_WorldBounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 250, y: 250, z: 250} - m_WorldSubdivisions: 8 - m_FrictionType: 0 - m_EnableEnhancedDeterminism: 0 - m_EnableUnifiedHeightmaps: 1 - m_SolverType: 0 - m_DefaultMaxAngularSpeed: 7 diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset deleted file mode 100644 index 2a4cbc567..000000000 --- a/ProjectSettings/EditorBuildSettings.asset +++ /dev/null @@ -1,11 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1045 &1 -EditorBuildSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Scenes: - - enabled: 1 - path: Assets/Scenes/SampleScene.unity - guid: d1c3109bdb54ad54c8a2b2838528e640 - m_configObjects: {} diff --git a/ProjectSettings/EditorSettings.asset b/ProjectSettings/EditorSettings.asset deleted file mode 100644 index 05db6c812..000000000 --- a/ProjectSettings/EditorSettings.asset +++ /dev/null @@ -1,31 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!159 &1 -EditorSettings: - m_AssetPipelineMode: 1 - m_ObjectHideFlags: 0 - serializedVersion: 10 - m_ExternalVersionControlSupport: Visible Meta Files - m_SerializationMode: 2 - m_LineEndingsForNewScripts: 0 - m_DefaultBehaviorMode: 0 - m_PrefabRegularEnvironment: {fileID: 0} - m_PrefabUIEnvironment: {fileID: 0} - m_SpritePackerMode: 0 - m_SpritePackerPaddingPower: 1 - m_EtcTextureCompressorBehavior: 1 - m_EtcTextureFastCompressor: 1 - m_EtcTextureNormalCompressor: 2 - m_EtcTextureBestCompressor: 4 - m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp - m_ProjectGenerationRootNamespace: - m_CollabEditorSettings: - inProgressEnabled: 1 - m_EnableTextureStreamingInEditMode: 1 - m_EnableTextureStreamingInPlayMode: 1 - m_AsyncShaderCompilation: 1 - m_EnterPlayModeOptionsEnabled: 0 - m_EnterPlayModeOptions: 3 - m_ShowLightmapResolutionOverlay: 1 - m_UseLegacyProbeSampleCount: 0 - m_SerializeInlineMappingsOnOneLine: 1 diff --git a/ProjectSettings/GraphicsSettings.asset b/ProjectSettings/GraphicsSettings.asset deleted file mode 100644 index db10dd6de..000000000 --- a/ProjectSettings/GraphicsSettings.asset +++ /dev/null @@ -1,68 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!30 &1 -GraphicsSettings: - m_ObjectHideFlags: 0 - serializedVersion: 13 - m_Deferred: - m_Mode: 1 - m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} - m_DeferredReflections: - m_Mode: 1 - m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} - m_ScreenSpaceShadows: - m_Mode: 1 - m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} - m_LegacyDeferred: - m_Mode: 1 - m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} - m_DepthNormals: - m_Mode: 1 - m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} - m_MotionVectors: - m_Mode: 1 - m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} - m_LightHalo: - m_Mode: 1 - m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} - m_LensFlare: - m_Mode: 1 - m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} - m_AlwaysIncludedShaders: - - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} - m_PreloadedShaders: [] - m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, - type: 0} - m_CustomRenderPipeline: {fileID: 11400000, guid: 19ba41d7c0026c3459d37c2fe90c55a0, - type: 2} - m_TransparencySortMode: 0 - m_TransparencySortAxis: {x: 0, y: 0, z: 1} - m_DefaultRenderingPath: 1 - m_DefaultMobileRenderingPath: 1 - m_TierSettings: [] - m_LightmapStripping: 0 - m_FogStripping: 0 - m_InstancingStripping: 0 - m_LightmapKeepPlain: 1 - m_LightmapKeepDirCombined: 1 - m_LightmapKeepDynamicPlain: 1 - m_LightmapKeepDynamicDirCombined: 1 - m_LightmapKeepShadowMask: 1 - m_LightmapKeepSubtractive: 1 - m_FogKeepLinear: 1 - m_FogKeepExp: 1 - m_FogKeepExp2: 1 - m_AlbedoSwatchInfos: [] - m_LightsUseLinearIntensity: 1 - m_LightsUseColorTemperature: 0 - m_LogWhenShaderIsCompiled: 0 - m_AllowEnlightenSupportForUpgradedProject: 1 diff --git a/ProjectSettings/InputManager.asset b/ProjectSettings/InputManager.asset deleted file mode 100644 index b16147e95..000000000 --- a/ProjectSettings/InputManager.asset +++ /dev/null @@ -1,487 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!13 &1 -InputManager: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Axes: - - serializedVersion: 3 - m_Name: Horizontal - descriptiveName: - descriptiveNegativeName: - negativeButton: left - positiveButton: right - altNegativeButton: a - altPositiveButton: d - gravity: 3 - dead: 0.001 - sensitivity: 3 - snap: 1 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Vertical - descriptiveName: - descriptiveNegativeName: - negativeButton: down - positiveButton: up - altNegativeButton: s - altPositiveButton: w - gravity: 3 - dead: 0.001 - sensitivity: 3 - snap: 1 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire1 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: left ctrl - altNegativeButton: - altPositiveButton: mouse 0 - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire2 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: left alt - altNegativeButton: - altPositiveButton: mouse 1 - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire3 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: left shift - altNegativeButton: - altPositiveButton: mouse 2 - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Jump - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: space - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Mouse X - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0 - sensitivity: 0.1 - snap: 0 - invert: 0 - type: 1 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Mouse Y - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0 - sensitivity: 0.1 - snap: 0 - invert: 0 - type: 1 - axis: 1 - joyNum: 0 - - serializedVersion: 3 - m_Name: Mouse ScrollWheel - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0 - sensitivity: 0.1 - snap: 0 - invert: 0 - type: 1 - axis: 2 - joyNum: 0 - - serializedVersion: 3 - m_Name: Horizontal - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0.19 - sensitivity: 1 - snap: 0 - invert: 0 - type: 2 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Vertical - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0.19 - sensitivity: 1 - snap: 0 - invert: 1 - type: 2 - axis: 1 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire1 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: joystick button 0 - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire2 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: joystick button 1 - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire3 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: joystick button 2 - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Jump - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: joystick button 3 - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Submit - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: return - altNegativeButton: - altPositiveButton: joystick button 0 - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Submit - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: enter - altNegativeButton: - altPositiveButton: space - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Cancel - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: escape - altNegativeButton: - altPositiveButton: joystick button 1 - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Enable Debug Button 1 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: left ctrl - altNegativeButton: - altPositiveButton: joystick button 8 - gravity: 0 - dead: 0 - sensitivity: 0 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Enable Debug Button 2 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: backspace - altNegativeButton: - altPositiveButton: joystick button 9 - gravity: 0 - dead: 0 - sensitivity: 0 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Debug Reset - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: left alt - altNegativeButton: - altPositiveButton: joystick button 1 - gravity: 0 - dead: 0 - sensitivity: 0 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Debug Next - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: page down - altNegativeButton: - altPositiveButton: joystick button 5 - gravity: 0 - dead: 0 - sensitivity: 0 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Debug Previous - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: page up - altNegativeButton: - altPositiveButton: joystick button 4 - gravity: 0 - dead: 0 - sensitivity: 0 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Debug Validate - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: return - altNegativeButton: - altPositiveButton: joystick button 0 - gravity: 0 - dead: 0 - sensitivity: 0 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Debug Persistent - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: right shift - altNegativeButton: - altPositiveButton: joystick button 2 - gravity: 0 - dead: 0 - sensitivity: 0 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Debug Multiplier - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: left shift - altNegativeButton: - altPositiveButton: joystick button 3 - gravity: 0 - dead: 0 - sensitivity: 0 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Debug Horizontal - descriptiveName: - descriptiveNegativeName: - negativeButton: left - positiveButton: right - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Debug Vertical - descriptiveName: - descriptiveNegativeName: - negativeButton: down - positiveButton: up - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Debug Vertical - descriptiveName: - descriptiveNegativeName: - negativeButton: down - positiveButton: up - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 2 - axis: 6 - joyNum: 0 - - serializedVersion: 3 - m_Name: Debug Horizontal - descriptiveName: - descriptiveNegativeName: - negativeButton: left - positiveButton: right - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 2 - axis: 5 - joyNum: 0 diff --git a/ProjectSettings/NavMeshAreas.asset b/ProjectSettings/NavMeshAreas.asset deleted file mode 100644 index 3b0b7c3d1..000000000 --- a/ProjectSettings/NavMeshAreas.asset +++ /dev/null @@ -1,91 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!126 &1 -NavMeshProjectSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - areas: - - name: Walkable - cost: 1 - - name: Not Walkable - cost: 1 - - name: Jump - cost: 2 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - m_LastAgentTypeID: -887442657 - m_Settings: - - serializedVersion: 2 - agentTypeID: 0 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.75 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - minRegionArea: 2 - manualCellSize: 0 - cellSize: 0.16666667 - manualTileSize: 0 - tileSize: 256 - accuratePlacement: 0 - debug: - m_Flags: 0 - m_SettingNames: - - Humanoid diff --git a/ProjectSettings/PackageManagerSettings.asset b/ProjectSettings/PackageManagerSettings.asset deleted file mode 100644 index be4a7974e..000000000 --- a/ProjectSettings/PackageManagerSettings.asset +++ /dev/null @@ -1,43 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &1 -MonoBehaviour: - m_ObjectHideFlags: 61 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} - m_Name: - m_EditorClassIdentifier: - m_EnablePreviewPackages: 0 - m_EnablePackageDependencies: 0 - m_AdvancedSettingsExpanded: 1 - m_ScopedRegistriesSettingsExpanded: 1 - oneTimeWarningShown: 0 - m_Registries: - - m_Id: main - m_Name: - m_Url: https://packages.unity.com - m_Scopes: [] - m_IsDefault: 1 - m_Capabilities: 7 - m_UserSelectedRegistryName: - m_UserAddingNewScopedRegistry: 0 - m_RegistryInfoDraft: - m_ErrorMessage: - m_Original: - m_Id: - m_Name: - m_Url: - m_Scopes: [] - m_IsDefault: 0 - m_Capabilities: 0 - m_Modified: 0 - m_Name: - m_Url: - m_Scopes: - - - m_SelectedScopeIndex: 0 diff --git a/ProjectSettings/Physics2DSettings.asset b/ProjectSettings/Physics2DSettings.asset deleted file mode 100644 index 47880b1c8..000000000 --- a/ProjectSettings/Physics2DSettings.asset +++ /dev/null @@ -1,56 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!19 &1 -Physics2DSettings: - m_ObjectHideFlags: 0 - serializedVersion: 4 - m_Gravity: {x: 0, y: -9.81} - m_DefaultMaterial: {fileID: 0} - m_VelocityIterations: 8 - m_PositionIterations: 3 - m_VelocityThreshold: 1 - m_MaxLinearCorrection: 0.2 - m_MaxAngularCorrection: 8 - m_MaxTranslationSpeed: 100 - m_MaxRotationSpeed: 360 - m_BaumgarteScale: 0.2 - m_BaumgarteTimeOfImpactScale: 0.75 - m_TimeToSleep: 0.5 - m_LinearSleepTolerance: 0.01 - m_AngularSleepTolerance: 2 - m_DefaultContactOffset: 0.01 - m_JobOptions: - serializedVersion: 2 - useMultithreading: 0 - useConsistencySorting: 0 - m_InterpolationPosesPerJob: 100 - m_NewContactsPerJob: 30 - m_CollideContactsPerJob: 100 - m_ClearFlagsPerJob: 200 - m_ClearBodyForcesPerJob: 200 - m_SyncDiscreteFixturesPerJob: 50 - m_SyncContinuousFixturesPerJob: 50 - m_FindNearestContactsPerJob: 100 - m_UpdateTriggerContactsPerJob: 100 - m_IslandSolverCostThreshold: 100 - m_IslandSolverBodyCostScale: 1 - m_IslandSolverContactCostScale: 10 - m_IslandSolverJointCostScale: 10 - m_IslandSolverBodiesPerJob: 50 - m_IslandSolverContactsPerJob: 50 - m_AutoSimulation: 1 - m_QueriesHitTriggers: 1 - m_QueriesStartInColliders: 1 - m_CallbacksOnDisable: 1 - m_ReuseCollisionCallbacks: 1 - m_AutoSyncTransforms: 0 - m_AlwaysShowColliders: 0 - m_ShowColliderSleep: 1 - m_ShowColliderContacts: 0 - m_ShowColliderAABB: 0 - m_ContactArrowScale: 0.2 - m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} - m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} - m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} - m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} - m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/ProjectSettings/PresetManager.asset b/ProjectSettings/PresetManager.asset deleted file mode 100644 index 10a1b0738..000000000 --- a/ProjectSettings/PresetManager.asset +++ /dev/null @@ -1,27 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1386491679 &1 -PresetManager: - m_ObjectHideFlags: 0 - m_DefaultList: - - type: - m_NativeTypeID: 108 - m_ManagedTypePPtr: {fileID: 0} - m_ManagedTypeFallback: - defaultPresets: - - m_Preset: {fileID: 2655988077585873504, guid: 463065d4f17d1d94d848aa127b94dd43, - type: 2} - - type: - m_NativeTypeID: 1020 - m_ManagedTypePPtr: {fileID: 0} - m_ManagedTypeFallback: - defaultPresets: - - m_Preset: {fileID: 2655988077585873504, guid: e7689051185d12f4298e1ebb2693a29f, - type: 2} - - type: - m_NativeTypeID: 1006 - m_ManagedTypePPtr: {fileID: 0} - m_ManagedTypeFallback: - defaultPresets: - - m_Preset: {fileID: 2655988077585873504, guid: e8537455c6c08bd4e8bf0be3707da685, - type: 2} diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset deleted file mode 100644 index 4a28a37ec..000000000 --- a/ProjectSettings/ProjectSettings.asset +++ /dev/null @@ -1,698 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!129 &1 -PlayerSettings: - m_ObjectHideFlags: 0 - serializedVersion: 22 - productGUID: ab1ec9304db0f00cba3d0fdd5dffedf9 - AndroidProfiler: 0 - AndroidFilterTouchesWhenObscured: 0 - AndroidEnableSustainedPerformanceMode: 0 - defaultScreenOrientation: 4 - targetDevice: 2 - useOnDemandResources: 0 - accelerometerFrequency: 60 - companyName: DefaultCompany - productName: SpacetimeUnitySDK - defaultCursor: {fileID: 0} - cursorHotspot: {x: 0, y: 0} - m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} - m_ShowUnitySplashScreen: 1 - m_ShowUnitySplashLogo: 1 - m_SplashScreenOverlayOpacity: 1 - m_SplashScreenAnimation: 1 - m_SplashScreenLogoStyle: 1 - m_SplashScreenDrawMode: 0 - m_SplashScreenBackgroundAnimationZoom: 1 - m_SplashScreenLogoAnimationZoom: 1 - m_SplashScreenBackgroundLandscapeAspect: 1 - m_SplashScreenBackgroundPortraitAspect: 1 - m_SplashScreenBackgroundLandscapeUvs: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - m_SplashScreenBackgroundPortraitUvs: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - m_SplashScreenLogos: [] - m_VirtualRealitySplashScreen: {fileID: 0} - m_HolographicTrackingLossScreen: {fileID: 0} - defaultScreenWidth: 1920 - defaultScreenHeight: 1080 - defaultScreenWidthWeb: 960 - defaultScreenHeightWeb: 600 - m_StereoRenderingPath: 0 - m_ActiveColorSpace: 1 - m_MTRendering: 1 - mipStripping: 0 - numberOfMipsStripped: 0 - m_StackTraceTypes: 010000000100000001000000010000000100000001000000 - iosShowActivityIndicatorOnLoading: -1 - androidShowActivityIndicatorOnLoading: -1 - iosUseCustomAppBackgroundBehavior: 0 - iosAllowHTTPDownload: 1 - allowedAutorotateToPortrait: 1 - allowedAutorotateToPortraitUpsideDown: 1 - allowedAutorotateToLandscapeRight: 1 - allowedAutorotateToLandscapeLeft: 1 - useOSAutorotation: 1 - use32BitDisplayBuffer: 1 - preserveFramebufferAlpha: 0 - disableDepthAndStencilBuffers: 0 - androidStartInFullscreen: 1 - androidRenderOutsideSafeArea: 0 - androidUseSwappy: 1 - androidBlitType: 1 - androidResizableWindow: 0 - androidDefaultWindowWidth: 1920 - androidDefaultWindowHeight: 1080 - androidMinimumWindowWidth: 400 - androidMinimumWindowHeight: 300 - androidFullscreenMode: 1 - defaultIsNativeResolution: 1 - macRetinaSupport: 1 - runInBackground: 1 - captureSingleScreen: 0 - muteOtherAudioSources: 0 - Prepare IOS For Recording: 0 - Force IOS Speakers When Recording: 0 - deferSystemGesturesMode: 0 - hideHomeButton: 0 - submitAnalytics: 1 - usePlayerLog: 1 - bakeCollisionMeshes: 0 - forceSingleInstance: 0 - useFlipModelSwapchain: 1 - resizableWindow: 0 - useMacAppStoreValidation: 0 - macAppStoreCategory: public.app-category.games - gpuSkinning: 1 - xboxPIXTextureCapture: 0 - xboxEnableAvatar: 0 - xboxEnableKinect: 0 - xboxEnableKinectAutoTracking: 0 - xboxEnableFitness: 0 - visibleInBackground: 1 - allowFullscreenSwitch: 1 - fullscreenMode: 1 - xboxSpeechDB: 0 - xboxEnableHeadOrientation: 0 - xboxEnableGuest: 0 - xboxEnablePIXSampling: 0 - metalFramebufferOnly: 0 - xboxOneResolution: 0 - xboxOneSResolution: 0 - xboxOneXResolution: 3 - xboxOneMonoLoggingLevel: 0 - xboxOneLoggingLevel: 1 - xboxOneDisableEsram: 0 - xboxOneEnableTypeOptimization: 0 - xboxOnePresentImmediateThreshold: 0 - switchQueueCommandMemory: 0 - switchQueueControlMemory: 0 - switchQueueComputeMemory: 262144 - switchNVNShaderPoolsGranularity: 33554432 - switchNVNDefaultPoolsGranularity: 16777216 - switchNVNOtherPoolsGranularity: 16777216 - switchNVNMaxPublicTextureIDCount: 0 - switchNVNMaxPublicSamplerIDCount: 0 - stadiaPresentMode: 0 - stadiaTargetFramerate: 0 - vulkanNumSwapchainBuffers: 3 - vulkanEnableSetSRGBWrite: 0 - vulkanEnablePreTransform: 0 - vulkanEnableLateAcquireNextImage: 0 - vulkanEnableCommandBufferRecycling: 1 - m_SupportedAspectRatios: - 4:3: 1 - 5:4: 1 - 16:10: 1 - 16:9: 1 - Others: 1 - bundleVersion: 0.1 - preloadedAssets: [] - metroInputSource: 0 - wsaTransparentSwapchain: 0 - m_HolographicPauseOnTrackingLoss: 1 - xboxOneDisableKinectGpuReservation: 1 - xboxOneEnable7thCore: 1 - vrSettings: - enable360StereoCapture: 0 - isWsaHolographicRemotingEnabled: 0 - enableFrameTimingStats: 0 - useHDRDisplay: 0 - D3DHDRBitDepth: 0 - m_ColorGamuts: 0000000003000000 - targetPixelDensity: 30 - resolutionScalingMode: 0 - androidSupportedAspectRatio: 1 - androidMaxAspectRatio: 2.1 - applicationIdentifier: {} - buildNumber: - Standalone: 0 - iPhone: 0 - tvOS: 0 - overrideDefaultApplicationIdentifier: 0 - AndroidBundleVersionCode: 1 - AndroidMinSdkVersion: 19 - AndroidTargetSdkVersion: 0 - AndroidPreferredInstallLocation: 1 - aotOptions: - stripEngineCode: 1 - iPhoneStrippingLevel: 0 - iPhoneScriptCallOptimization: 0 - ForceInternetPermission: 0 - ForceSDCardPermission: 0 - CreateWallpaper: 0 - APKExpansionFiles: 0 - keepLoadedShadersAlive: 0 - StripUnusedMeshComponents: 0 - VertexChannelCompressionMask: 4054 - iPhoneSdkVersion: 988 - iOSTargetOSVersionString: 11.0 - tvOSSdkVersion: 0 - tvOSRequireExtendedGameController: 0 - tvOSTargetOSVersionString: 11.0 - uIPrerenderedIcon: 0 - uIRequiresPersistentWiFi: 0 - uIRequiresFullScreen: 1 - uIStatusBarHidden: 1 - uIExitOnSuspend: 0 - uIStatusBarStyle: 0 - appleTVSplashScreen: {fileID: 0} - appleTVSplashScreen2x: {fileID: 0} - tvOSSmallIconLayers: [] - tvOSSmallIconLayers2x: [] - tvOSLargeIconLayers: [] - tvOSLargeIconLayers2x: [] - tvOSTopShelfImageLayers: [] - tvOSTopShelfImageLayers2x: [] - tvOSTopShelfImageWideLayers: [] - tvOSTopShelfImageWideLayers2x: [] - iOSLaunchScreenType: 0 - iOSLaunchScreenPortrait: {fileID: 0} - iOSLaunchScreenLandscape: {fileID: 0} - iOSLaunchScreenBackgroundColor: - serializedVersion: 2 - rgba: 0 - iOSLaunchScreenFillPct: 100 - iOSLaunchScreenSize: 100 - iOSLaunchScreenCustomXibPath: - iOSLaunchScreeniPadType: 0 - iOSLaunchScreeniPadImage: {fileID: 0} - iOSLaunchScreeniPadBackgroundColor: - serializedVersion: 2 - rgba: 0 - iOSLaunchScreeniPadFillPct: 100 - iOSLaunchScreeniPadSize: 100 - iOSLaunchScreeniPadCustomXibPath: - iOSLaunchScreenCustomStoryboardPath: - iOSLaunchScreeniPadCustomStoryboardPath: - iOSDeviceRequirements: [] - iOSURLSchemes: [] - iOSBackgroundModes: 0 - iOSMetalForceHardShadows: 0 - metalEditorSupport: 1 - metalAPIValidation: 1 - iOSRenderExtraFrameOnPause: 0 - iosCopyPluginsCodeInsteadOfSymlink: 0 - appleDeveloperTeamID: - iOSManualSigningProvisioningProfileID: - tvOSManualSigningProvisioningProfileID: - iOSManualSigningProvisioningProfileType: 0 - tvOSManualSigningProvisioningProfileType: 0 - appleEnableAutomaticSigning: 0 - iOSRequireARKit: 0 - iOSAutomaticallyDetectAndAddCapabilities: 1 - appleEnableProMotion: 0 - shaderPrecisionModel: 0 - clonedFromGUID: 9870af204204ab84596f8a656f2f2ce6 - templatePackageId: com.unity.template.universal@10.7.0 - templateDefaultScene: Assets/Scenes/SampleScene.unity - useCustomMainManifest: 0 - useCustomLauncherManifest: 0 - useCustomMainGradleTemplate: 0 - useCustomLauncherGradleManifest: 0 - useCustomBaseGradleTemplate: 0 - useCustomGradlePropertiesTemplate: 0 - useCustomProguardFile: 0 - AndroidTargetArchitectures: 1 - AndroidTargetDevices: 0 - AndroidSplashScreenScale: 0 - androidSplashScreen: {fileID: 0} - AndroidKeystoreName: - AndroidKeyaliasName: - AndroidBuildApkPerCpuArchitecture: 0 - AndroidTVCompatibility: 0 - AndroidIsGame: 1 - AndroidEnableTango: 0 - androidEnableBanner: 1 - androidUseLowAccuracyLocation: 0 - androidUseCustomKeystore: 0 - m_AndroidBanners: - - width: 320 - height: 180 - banner: {fileID: 0} - androidGamepadSupportLevel: 0 - chromeosInputEmulation: 1 - AndroidMinifyWithR8: 0 - AndroidMinifyRelease: 0 - AndroidMinifyDebug: 0 - AndroidValidateAppBundleSize: 1 - AndroidAppBundleSizeToValidate: 100 - m_BuildTargetIcons: [] - m_BuildTargetPlatformIcons: [] - m_BuildTargetBatching: - - m_BuildTarget: Standalone - m_StaticBatching: 1 - m_DynamicBatching: 0 - - m_BuildTarget: tvOS - m_StaticBatching: 1 - m_DynamicBatching: 0 - - m_BuildTarget: iPhone - m_StaticBatching: 1 - m_DynamicBatching: 0 - - m_BuildTarget: Android - m_StaticBatching: 1 - m_DynamicBatching: 0 - - m_BuildTarget: WebGL - m_StaticBatching: 0 - m_DynamicBatching: 0 - m_BuildTargetGraphicsJobs: - - m_BuildTarget: MacStandaloneSupport - m_GraphicsJobs: 0 - - m_BuildTarget: Switch - m_GraphicsJobs: 1 - - m_BuildTarget: MetroSupport - m_GraphicsJobs: 1 - - m_BuildTarget: AppleTVSupport - m_GraphicsJobs: 0 - - m_BuildTarget: BJMSupport - m_GraphicsJobs: 1 - - m_BuildTarget: LinuxStandaloneSupport - m_GraphicsJobs: 1 - - m_BuildTarget: PS4Player - m_GraphicsJobs: 1 - - m_BuildTarget: iOSSupport - m_GraphicsJobs: 0 - - m_BuildTarget: WindowsStandaloneSupport - m_GraphicsJobs: 1 - - m_BuildTarget: XboxOnePlayer - m_GraphicsJobs: 1 - - m_BuildTarget: LuminSupport - m_GraphicsJobs: 0 - - m_BuildTarget: AndroidPlayer - m_GraphicsJobs: 0 - - m_BuildTarget: WebGLSupport - m_GraphicsJobs: 0 - m_BuildTargetGraphicsJobMode: - - m_BuildTarget: PS4Player - m_GraphicsJobMode: 0 - - m_BuildTarget: XboxOnePlayer - m_GraphicsJobMode: 0 - m_BuildTargetGraphicsAPIs: - - m_BuildTarget: iOSSupport - m_APIs: 10000000 - m_Automatic: 1 - - m_BuildTarget: AppleTVSupport - m_APIs: 10000000 - m_Automatic: 1 - - m_BuildTarget: AndroidPlayer - m_APIs: 150000000b000000 - m_Automatic: 0 - - m_BuildTarget: WebGLSupport - m_APIs: 0b000000 - m_Automatic: 0 - m_BuildTargetVRSettings: [] - openGLRequireES31: 0 - openGLRequireES31AEP: 0 - openGLRequireES32: 0 - m_TemplateCustomTags: {} - mobileMTRendering: - Android: 1 - iPhone: 1 - tvOS: 1 - m_BuildTargetGroupLightmapEncodingQuality: - - m_BuildTarget: Standalone - m_EncodingQuality: 1 - m_BuildTargetGroupLightmapSettings: [] - m_BuildTargetNormalMapEncoding: [] - playModeTestRunnerEnabled: 0 - runPlayModeTestAsEditModeTest: 0 - actionOnDotNetUnhandledException: 1 - enableInternalProfiler: 0 - logObjCUncaughtExceptions: 1 - enableCrashReportAPI: 0 - cameraUsageDescription: - locationUsageDescription: - microphoneUsageDescription: - bluetoothUsageDescription: - switchNMETAOverride: - switchNetLibKey: - switchSocketMemoryPoolSize: 6144 - switchSocketAllocatorPoolSize: 128 - switchSocketConcurrencyLimit: 14 - switchScreenResolutionBehavior: 2 - switchUseCPUProfiler: 0 - switchUseGOLDLinker: 0 - switchApplicationID: 0x01004b9000490000 - switchNSODependencies: - switchTitleNames_0: - switchTitleNames_1: - switchTitleNames_2: - switchTitleNames_3: - switchTitleNames_4: - switchTitleNames_5: - switchTitleNames_6: - switchTitleNames_7: - switchTitleNames_8: - switchTitleNames_9: - switchTitleNames_10: - switchTitleNames_11: - switchTitleNames_12: - switchTitleNames_13: - switchTitleNames_14: - switchTitleNames_15: - switchPublisherNames_0: - switchPublisherNames_1: - switchPublisherNames_2: - switchPublisherNames_3: - switchPublisherNames_4: - switchPublisherNames_5: - switchPublisherNames_6: - switchPublisherNames_7: - switchPublisherNames_8: - switchPublisherNames_9: - switchPublisherNames_10: - switchPublisherNames_11: - switchPublisherNames_12: - switchPublisherNames_13: - switchPublisherNames_14: - switchPublisherNames_15: - switchIcons_0: {fileID: 0} - switchIcons_1: {fileID: 0} - switchIcons_2: {fileID: 0} - switchIcons_3: {fileID: 0} - switchIcons_4: {fileID: 0} - switchIcons_5: {fileID: 0} - switchIcons_6: {fileID: 0} - switchIcons_7: {fileID: 0} - switchIcons_8: {fileID: 0} - switchIcons_9: {fileID: 0} - switchIcons_10: {fileID: 0} - switchIcons_11: {fileID: 0} - switchIcons_12: {fileID: 0} - switchIcons_13: {fileID: 0} - switchIcons_14: {fileID: 0} - switchIcons_15: {fileID: 0} - switchSmallIcons_0: {fileID: 0} - switchSmallIcons_1: {fileID: 0} - switchSmallIcons_2: {fileID: 0} - switchSmallIcons_3: {fileID: 0} - switchSmallIcons_4: {fileID: 0} - switchSmallIcons_5: {fileID: 0} - switchSmallIcons_6: {fileID: 0} - switchSmallIcons_7: {fileID: 0} - switchSmallIcons_8: {fileID: 0} - switchSmallIcons_9: {fileID: 0} - switchSmallIcons_10: {fileID: 0} - switchSmallIcons_11: {fileID: 0} - switchSmallIcons_12: {fileID: 0} - switchSmallIcons_13: {fileID: 0} - switchSmallIcons_14: {fileID: 0} - switchSmallIcons_15: {fileID: 0} - switchManualHTML: - switchAccessibleURLs: - switchLegalInformation: - switchMainThreadStackSize: 1048576 - switchPresenceGroupId: - switchLogoHandling: 0 - switchReleaseVersion: 0 - switchDisplayVersion: 1.0.0 - switchStartupUserAccount: 0 - switchTouchScreenUsage: 0 - switchSupportedLanguagesMask: 0 - switchLogoType: 0 - switchApplicationErrorCodeCategory: - switchUserAccountSaveDataSize: 0 - switchUserAccountSaveDataJournalSize: 0 - switchApplicationAttribute: 0 - switchCardSpecSize: -1 - switchCardSpecClock: -1 - switchRatingsMask: 0 - switchRatingsInt_0: 0 - switchRatingsInt_1: 0 - switchRatingsInt_2: 0 - switchRatingsInt_3: 0 - switchRatingsInt_4: 0 - switchRatingsInt_5: 0 - switchRatingsInt_6: 0 - switchRatingsInt_7: 0 - switchRatingsInt_8: 0 - switchRatingsInt_9: 0 - switchRatingsInt_10: 0 - switchRatingsInt_11: 0 - switchRatingsInt_12: 0 - switchLocalCommunicationIds_0: - switchLocalCommunicationIds_1: - switchLocalCommunicationIds_2: - switchLocalCommunicationIds_3: - switchLocalCommunicationIds_4: - switchLocalCommunicationIds_5: - switchLocalCommunicationIds_6: - switchLocalCommunicationIds_7: - switchParentalControl: 0 - switchAllowsScreenshot: 1 - switchAllowsVideoCapturing: 1 - switchAllowsRuntimeAddOnContentInstall: 0 - switchDataLossConfirmation: 0 - switchUserAccountLockEnabled: 0 - switchSystemResourceMemory: 16777216 - switchSupportedNpadStyles: 22 - switchNativeFsCacheSize: 32 - switchIsHoldTypeHorizontal: 0 - switchSupportedNpadCount: 8 - switchSocketConfigEnabled: 0 - switchTcpInitialSendBufferSize: 32 - switchTcpInitialReceiveBufferSize: 64 - switchTcpAutoSendBufferSizeMax: 256 - switchTcpAutoReceiveBufferSizeMax: 256 - switchUdpSendBufferSize: 9 - switchUdpReceiveBufferSize: 42 - switchSocketBufferEfficiency: 4 - switchSocketInitializeEnabled: 1 - switchNetworkInterfaceManagerInitializeEnabled: 1 - switchPlayerConnectionEnabled: 1 - switchUseNewStyleFilepaths: 0 - switchUseMicroSleepForYield: 1 - switchMicroSleepForYieldTime: 25 - ps4NPAgeRating: 12 - ps4NPTitleSecret: - ps4NPTrophyPackPath: - ps4ParentalLevel: 11 - ps4ContentID: ED1633-NPXX51362_00-0000000000000000 - ps4Category: 0 - ps4MasterVersion: 01.00 - ps4AppVersion: 01.00 - ps4AppType: 0 - ps4ParamSfxPath: - ps4VideoOutPixelFormat: 0 - ps4VideoOutInitialWidth: 1920 - ps4VideoOutBaseModeInitialWidth: 1920 - ps4VideoOutReprojectionRate: 60 - ps4PronunciationXMLPath: - ps4PronunciationSIGPath: - ps4BackgroundImagePath: - ps4StartupImagePath: - ps4StartupImagesFolder: - ps4IconImagesFolder: - ps4SaveDataImagePath: - ps4SdkOverride: - ps4BGMPath: - ps4ShareFilePath: - ps4ShareOverlayImagePath: - ps4PrivacyGuardImagePath: - ps4ExtraSceSysFile: - ps4NPtitleDatPath: - ps4RemotePlayKeyAssignment: -1 - ps4RemotePlayKeyMappingDir: - ps4PlayTogetherPlayerCount: 0 - ps4EnterButtonAssignment: 1 - ps4ApplicationParam1: 0 - ps4ApplicationParam2: 0 - ps4ApplicationParam3: 0 - ps4ApplicationParam4: 0 - ps4DownloadDataSize: 0 - ps4GarlicHeapSize: 2048 - ps4ProGarlicHeapSize: 2560 - playerPrefsMaxSize: 32768 - ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ - ps4pnSessions: 1 - ps4pnPresence: 1 - ps4pnFriends: 1 - ps4pnGameCustomData: 1 - playerPrefsSupport: 0 - enableApplicationExit: 0 - resetTempFolder: 1 - restrictedAudioUsageRights: 0 - ps4UseResolutionFallback: 0 - ps4ReprojectionSupport: 0 - ps4UseAudio3dBackend: 0 - ps4UseLowGarlicFragmentationMode: 1 - ps4SocialScreenEnabled: 0 - ps4ScriptOptimizationLevel: 0 - ps4Audio3dVirtualSpeakerCount: 14 - ps4attribCpuUsage: 0 - ps4PatchPkgPath: - ps4PatchLatestPkgPath: - ps4PatchChangeinfoPath: - ps4PatchDayOne: 0 - ps4attribUserManagement: 0 - ps4attribMoveSupport: 0 - ps4attrib3DSupport: 0 - ps4attribShareSupport: 0 - ps4attribExclusiveVR: 0 - ps4disableAutoHideSplash: 0 - ps4videoRecordingFeaturesUsed: 0 - ps4contentSearchFeaturesUsed: 0 - ps4CompatibilityPS5: 0 - ps4AllowPS5Detection: 0 - ps4GPU800MHz: 1 - ps4attribEyeToEyeDistanceSettingVR: 0 - ps4IncludedModules: - - libc.prx - - libSceAudioLatencyEstimation.prx - - libSceFace.prx - - libSceFaceTracker.prx - - libSceFios2.prx - - libSceHand.prx - - libSceHandTracker.prx - - libSceHeadTracker.prx - - libSceJobManager.prx - - libSceNpToolkit2.prx - - libSceS3DConversion.prx - ps4attribVROutputEnabled: 0 - monoEnv: - splashScreenBackgroundSourceLandscape: {fileID: 0} - splashScreenBackgroundSourcePortrait: {fileID: 0} - blurSplashScreenBackground: 1 - spritePackerPolicy: - webGLMemorySize: 16 - webGLExceptionSupport: 1 - webGLNameFilesAsHashes: 0 - webGLDataCaching: 1 - webGLDebugSymbols: 0 - webGLEmscriptenArgs: - webGLModulesDirectory: - webGLTemplate: APPLICATION:Default - webGLAnalyzeBuildSize: 0 - webGLUseEmbeddedResources: 0 - webGLCompressionFormat: 1 - webGLWasmArithmeticExceptions: 0 - webGLLinkerTarget: 1 - webGLThreadsSupport: 0 - webGLDecompressionFallback: 0 - scriptingDefineSymbols: {} - additionalCompilerArguments: {} - platformArchitecture: {} - scriptingBackend: - Standalone: 0 - il2cppCompilerConfiguration: {} - managedStrippingLevel: {} - incrementalIl2cppBuild: {} - suppressCommonWarnings: 1 - allowUnsafeCode: 0 - useDeterministicCompilation: 1 - useReferenceAssemblies: 1 - enableRoslynAnalyzers: 1 - additionalIl2CppArgs: - scriptingRuntimeVersion: 1 - gcIncremental: 1 - assemblyVersionValidation: 1 - gcWBarrierValidation: 0 - apiCompatibilityLevelPerPlatform: - Standalone: 3 - m_RenderingPath: 1 - m_MobileRenderingPath: 1 - metroPackageName: Template_Lightweight - metroPackageVersion: - metroCertificatePath: - metroCertificatePassword: - metroCertificateSubject: - metroCertificateIssuer: - metroCertificateNotAfter: 0000000000000000 - metroApplicationDescription: Template_Lightweight - wsaImages: {} - metroTileShortName: - metroTileShowName: 0 - metroMediumTileShowName: 0 - metroLargeTileShowName: 0 - metroWideTileShowName: 0 - metroSupportStreamingInstall: 0 - metroLastRequiredScene: 0 - metroDefaultTileSize: 1 - metroTileForegroundText: 2 - metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} - metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1} - metroSplashScreenUseBackgroundColor: 0 - platformCapabilities: {} - metroTargetDeviceFamilies: {} - metroFTAName: - metroFTAFileTypes: [] - metroProtocolName: - XboxOneProductId: - XboxOneUpdateKey: - XboxOneSandboxId: - XboxOneContentId: - XboxOneTitleId: - XboxOneSCId: - XboxOneGameOsOverridePath: - XboxOnePackagingOverridePath: - XboxOneAppManifestOverridePath: - XboxOneVersion: 1.0.0.0 - XboxOnePackageEncryption: 0 - XboxOnePackageUpdateGranularity: 2 - XboxOneDescription: - XboxOneLanguage: - - enus - XboxOneCapability: [] - XboxOneGameRating: {} - XboxOneIsContentPackage: 0 - XboxOneEnhancedXboxCompatibilityMode: 0 - XboxOneEnableGPUVariability: 1 - XboxOneSockets: {} - XboxOneSplashScreen: {fileID: 0} - XboxOneAllowedProductIds: [] - XboxOnePersistentLocalStorageSize: 0 - XboxOneXTitleMemory: 8 - XboxOneOverrideIdentityName: - XboxOneOverrideIdentityPublisher: - vrEditorSettings: {} - cloudServicesEnabled: - UNet: 1 - luminIcon: - m_Name: - m_ModelFolderPath: - m_PortalFolderPath: - luminCert: - m_CertPath: - m_SignPackage: 1 - luminIsChannelApp: 0 - luminVersion: - m_VersionCode: 1 - m_VersionName: - apiCompatibilityLevel: 6 - activeInputHandler: 0 - cloudProjectId: - framebufferDepthMemorylessMode: 0 - qualitySettingsNames: [] - projectName: - organizationId: - cloudEnabled: 0 - legacyClampBlendShapeWeights: 0 - virtualTexturingSupportEnabled: 0 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt deleted file mode 100644 index 4c9401b91..000000000 --- a/ProjectSettings/ProjectVersion.txt +++ /dev/null @@ -1,2 +0,0 @@ -m_EditorVersion: 2020.3.25f1 -m_EditorVersionWithRevision: 2020.3.25f1 (9b9180224418) diff --git a/ProjectSettings/QualitySettings.asset b/ProjectSettings/QualitySettings.asset deleted file mode 100644 index dad5d50cf..000000000 --- a/ProjectSettings/QualitySettings.asset +++ /dev/null @@ -1,128 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!47 &1 -QualitySettings: - m_ObjectHideFlags: 0 - serializedVersion: 5 - m_CurrentQuality: 2 - m_QualitySettings: - - serializedVersion: 2 - name: Low - pixelLightCount: 0 - shadows: 0 - shadowResolution: 0 - shadowProjection: 1 - shadowCascades: 1 - shadowDistance: 20 - shadowNearPlaneOffset: 3 - shadowCascade2Split: 0.33333334 - shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} - shadowmaskMode: 0 - skinWeights: 2 - textureQuality: 0 - anisotropicTextures: 0 - antiAliasing: 0 - softParticles: 0 - softVegetation: 0 - realtimeReflectionProbes: 0 - billboardsFaceCameraPosition: 0 - vSyncCount: 0 - lodBias: 0.4 - maximumLODLevel: 0 - streamingMipmapsActive: 0 - streamingMipmapsAddAllCameras: 1 - streamingMipmapsMemoryBudget: 512 - streamingMipmapsRenderersPerFrame: 512 - streamingMipmapsMaxLevelReduction: 2 - streamingMipmapsMaxFileIORequests: 1024 - particleRaycastBudget: 16 - asyncUploadTimeSlice: 2 - asyncUploadBufferSize: 16 - asyncUploadPersistentBuffer: 1 - resolutionScalingFixedDPIFactor: 1 - customRenderPipeline: {fileID: 11400000, guid: a31e9f9f9c9d4b9429ed0d1234e22103, type: 2} - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Medium - pixelLightCount: 1 - shadows: 1 - shadowResolution: 0 - shadowProjection: 1 - shadowCascades: 1 - shadowDistance: 20 - shadowNearPlaneOffset: 3 - shadowCascade2Split: 0.33333334 - shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} - shadowmaskMode: 0 - skinWeights: 2 - textureQuality: 0 - anisotropicTextures: 1 - antiAliasing: 0 - softParticles: 0 - softVegetation: 0 - realtimeReflectionProbes: 0 - billboardsFaceCameraPosition: 0 - vSyncCount: 1 - lodBias: 0.7 - maximumLODLevel: 0 - streamingMipmapsActive: 0 - streamingMipmapsAddAllCameras: 1 - streamingMipmapsMemoryBudget: 512 - streamingMipmapsRenderersPerFrame: 512 - streamingMipmapsMaxLevelReduction: 2 - streamingMipmapsMaxFileIORequests: 1024 - particleRaycastBudget: 64 - asyncUploadTimeSlice: 2 - asyncUploadBufferSize: 16 - asyncUploadPersistentBuffer: 1 - resolutionScalingFixedDPIFactor: 1 - customRenderPipeline: {fileID: 11400000, guid: d847b876476d3d6468f5dfcd34266f96, type: 2} - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: High - pixelLightCount: 2 - shadows: 2 - shadowResolution: 1 - shadowProjection: 1 - shadowCascades: 2 - shadowDistance: 40 - shadowNearPlaneOffset: 3 - shadowCascade2Split: 0.33333334 - shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} - shadowmaskMode: 1 - skinWeights: 2 - textureQuality: 0 - anisotropicTextures: 1 - antiAliasing: 2 - softParticles: 0 - softVegetation: 1 - realtimeReflectionProbes: 1 - billboardsFaceCameraPosition: 1 - vSyncCount: 1 - lodBias: 1 - maximumLODLevel: 0 - streamingMipmapsActive: 0 - streamingMipmapsAddAllCameras: 1 - streamingMipmapsMemoryBudget: 512 - streamingMipmapsRenderersPerFrame: 512 - streamingMipmapsMaxLevelReduction: 2 - streamingMipmapsMaxFileIORequests: 1024 - particleRaycastBudget: 256 - asyncUploadTimeSlice: 2 - asyncUploadBufferSize: 16 - asyncUploadPersistentBuffer: 1 - resolutionScalingFixedDPIFactor: 1 - customRenderPipeline: {fileID: 11400000, guid: 19ba41d7c0026c3459d37c2fe90c55a0, type: 2} - excludedTargetPlatforms: [] - m_PerPlatformDefaultQuality: - Android: 1 - Lumin: 2 - Nintendo Switch: 2 - PS4: 2 - Stadia: 2 - Standalone: 2 - WebGL: 1 - Windows Store Apps: 2 - XboxOne: 2 - iPhone: 1 - tvOS: 1 diff --git a/ProjectSettings/SceneTemplateSettings.json b/ProjectSettings/SceneTemplateSettings.json deleted file mode 100644 index 6f3e60fd8..000000000 --- a/ProjectSettings/SceneTemplateSettings.json +++ /dev/null @@ -1,167 +0,0 @@ -{ - "templatePinStates": [], - "dependencyTypeInfos": [ - { - "userAdded": false, - "type": "UnityEngine.AnimationClip", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEditor.Animations.AnimatorController", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEngine.AnimatorOverrideController", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEditor.Audio.AudioMixerController", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEngine.ComputeShader", - "ignore": true, - "defaultInstantiationMode": 1, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEngine.Cubemap", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEngine.GameObject", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEditor.LightingDataAsset", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": false - }, - { - "userAdded": false, - "type": "UnityEngine.LightingSettings", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEngine.Material", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEditor.MonoScript", - "ignore": true, - "defaultInstantiationMode": 1, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEngine.PhysicMaterial", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEngine.PhysicsMaterial2D", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEngine.Rendering.VolumeProfile", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEditor.SceneAsset", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": false - }, - { - "userAdded": false, - "type": "UnityEngine.Shader", - "ignore": true, - "defaultInstantiationMode": 1, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEngine.ShaderVariantCollection", - "ignore": true, - "defaultInstantiationMode": 1, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEngine.Texture", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEngine.Texture2D", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": true - }, - { - "userAdded": false, - "type": "UnityEngine.Timeline.TimelineAsset", - "ignore": false, - "defaultInstantiationMode": 0, - "supportsModification": true - } - ], - "defaultDependencyTypeInfo": { - "userAdded": false, - "type": "", - "ignore": false, - "defaultInstantiationMode": 1, - "supportsModification": true - }, - "newSceneOverride": 0 -} \ No newline at end of file diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset deleted file mode 100644 index 1c92a7840..000000000 --- a/ProjectSettings/TagManager.asset +++ /dev/null @@ -1,43 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!78 &1 -TagManager: - serializedVersion: 2 - tags: [] - layers: - - Default - - TransparentFX - - Ignore Raycast - - - - Water - - UI - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - m_SortingLayers: - - name: Default - uniqueID: 0 - locked: 0 diff --git a/ProjectSettings/TimeManager.asset b/ProjectSettings/TimeManager.asset deleted file mode 100644 index 06bcc6d29..000000000 --- a/ProjectSettings/TimeManager.asset +++ /dev/null @@ -1,9 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!5 &1 -TimeManager: - m_ObjectHideFlags: 0 - Fixed Timestep: 0.02 - Maximum Allowed Timestep: 0.1 - m_TimeScale: 1 - Maximum Particle Timestep: 0.03 diff --git a/ProjectSettings/URPProjectSettings.asset b/ProjectSettings/URPProjectSettings.asset deleted file mode 100644 index 3077404f3..000000000 --- a/ProjectSettings/URPProjectSettings.asset +++ /dev/null @@ -1,15 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &1 -MonoBehaviour: - m_ObjectHideFlags: 61 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 247994e1f5a72c2419c26a37e9334c01, type: 3} - m_Name: - m_EditorClassIdentifier: - m_LastMaterialVersion: 4 diff --git a/ProjectSettings/UnityConnectSettings.asset b/ProjectSettings/UnityConnectSettings.asset deleted file mode 100644 index 6125b308a..000000000 --- a/ProjectSettings/UnityConnectSettings.asset +++ /dev/null @@ -1,35 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!310 &1 -UnityConnectSettings: - m_ObjectHideFlags: 0 - serializedVersion: 1 - m_Enabled: 0 - m_TestMode: 0 - m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events - m_EventUrl: https://cdp.cloud.unity3d.com/v1/events - m_ConfigUrl: https://config.uca.cloud.unity3d.com - m_DashboardUrl: https://dashboard.unity3d.com - m_TestInitMode: 0 - CrashReportingSettings: - m_EventUrl: https://perf-events.cloud.unity3d.com - m_Enabled: 0 - m_LogBufferSize: 10 - m_CaptureEditorExceptions: 1 - UnityPurchasingSettings: - m_Enabled: 0 - m_TestMode: 0 - UnityAnalyticsSettings: - m_Enabled: 0 - m_TestMode: 0 - m_InitializeOnStartup: 1 - UnityAdsSettings: - m_Enabled: 0 - m_InitializeOnStartup: 1 - m_TestMode: 0 - m_IosGameId: - m_AndroidGameId: - m_GameIds: {} - m_GameId: - PerformanceReportingSettings: - m_Enabled: 0 diff --git a/ProjectSettings/VFXManager.asset b/ProjectSettings/VFXManager.asset deleted file mode 100644 index 6e0eaca40..000000000 --- a/ProjectSettings/VFXManager.asset +++ /dev/null @@ -1,11 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!937362698 &1 -VFXManager: - m_ObjectHideFlags: 0 - m_IndirectShader: {fileID: 0} - m_CopyBufferShader: {fileID: 0} - m_SortShader: {fileID: 0} - m_RenderPipeSettingsPath: - m_FixedTimeStep: 0.016666668 - m_MaxDeltaTime: 0.05 diff --git a/ProjectSettings/VersionControlSettings.asset b/ProjectSettings/VersionControlSettings.asset deleted file mode 100644 index dca288142..000000000 --- a/ProjectSettings/VersionControlSettings.asset +++ /dev/null @@ -1,8 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!890905787 &1 -VersionControlSettings: - m_ObjectHideFlags: 0 - m_Mode: Visible Meta Files - m_CollabEditorSettings: - inProgressEnabled: 1 diff --git a/ProjectSettings/XRSettings.asset b/ProjectSettings/XRSettings.asset deleted file mode 100644 index 482590c19..000000000 --- a/ProjectSettings/XRSettings.asset +++ /dev/null @@ -1,10 +0,0 @@ -{ - "m_SettingKeys": [ - "VR Device Disabled", - "VR Device User Alert" - ], - "m_SettingValues": [ - "False", - "False" - ] -} \ No newline at end of file diff --git a/README.dotnet.md b/README.dotnet.md new file mode 100644 index 000000000..82c2fc47a --- /dev/null +++ b/README.dotnet.md @@ -0,0 +1,133 @@ +# SpacetimeDB SDK for C# + +## Overview + +This repository contains the [C#](https://learn.microsoft.com/en-us/dotnet/csharp/) SDK for SpacetimeDB. The SDK allows to interact with the database server and is prepared to work with code generated from a SpacetimeDB backend code. + +## Documentation + +The C# SDK has a [Quick Start](https://spacetimedb.com/docs/client-languages/csharp/csharp-sdk-quickstart-guide) guide and a [Reference](https://spacetimedb.com/docs/client-languages/csharp/csharp-sdk-reference). + +## Installation + +The SDK is available as a [NuGet Package](https://www.nuget.org/packages/SpacetimeDB.ClientSDK). To install it, follow these steps: + +1. Open the NuGet package manager in Visual Studio. +2. Search for `SpacetimeDB.ClientSDK`. +3. Click the install button. + +Alternatively, it can be installed on the command line using the `dotnet` command: + +```bash +dotnet add package SpacetimeDB.ClientSDK +``` + +## Usage + +### Access the SpacetimeDB Client + +The SpacetimeDB client is created automatically as a singleton and accessible via the `SpacetimeDBClient.instance` property. + +### Connecting to SpacetimeDB + +To connect to SpacetimeDB, you need to call the `Connect` method on the `SpacetimeDBClient` class. The `Connect` method takes the following parameters: + +- `token`: The authentication token to use to connect to SpacetimeDB. This token is generated by the backend code and is used to authenticate the client. +- `hostName`: The hostname of the SpacetimeDB server. This is the same hostname that you use to connect to the SpacetimeDB web interface. +- `moduleAddress`: The address of the module to connect to. This is the same address that you use to connect to the SpacetimeDB web interface. +- `sslEnabled`: Whether to use SSL to connect to SpacetimeDB. This is the same value that you use to connect to the SpacetimeDB web interface. + +Example: + +```csharp +using SpacetimeDB; + +SpacetimeDBClient.instance.Connect(TOKEN, HOST, DBNAME, SSL_ENABLED); +``` + +### AuthToken optional helper class + +The `AuthToken` class is a helper class that can be used to store the local client's authentication token locally to your user's home directory. + +```csharp +using SpacetimeDB; + +AuthToken.Init(".spacetime_csharp_quickstart"); + +SpacetimeDBClient.instance.Connect(AuthToken.Token, HOST, DBNAME, SSL_ENABLED); + +void OnIdentityReceived(string authToken, Identity identity) +{ + local_identity = identity; + AuthToken.SaveToken(authToken); +} +SpacetimeDBClient.instance.onIdentityReceived += OnIdentityReceived; +``` + +### Subscribing to tables + +To subscribe to a table, you need to call the `Subscribe` method on the `SpacetimeDBClient` class. The `Subscribe` method takes a list of queries as a parameter. The queries are the same queries that you use to subscribe to tables in the SpacetimeDB web interface. + +### Listening to events + +To listen to events, you need to register callbacks on the `SpacetimeDBClient` class. The following callbacks are available: + +- `onConnect`: Called when the client connects to SpacetimeDB. +- `onConnectError`: Called when the client fails to connect to SpacetimeDB. +- `onDisconnect`: Called when the client disconnects from SpacetimeDB. +- `onIdentityReceived`: Called when the client receives its identity from SpacetimeDB. +- `onSubscriptionApplied`: Called when the client receives the initial data from SpacetimeDB after subscribing to tables. + +You can register for row update events on a table. To do this, you need to register callbacks on the table class. The following callbacks are available: + +- `OnInsert`: Called when a row is inserted into the table. +- `OnUpdate`: Called when a row is updated in the table. +- `OnBeforeDelete`: Called before a row is deleted from the table. +- `OnDelete`: Called when a row is deleted from the table. + +Example: + +```csharp +using SpacetimeDB.Types; + +PlayerComponent.OnInsert += PlayerComponent_OnInsert; +PlayerComponent.OnUpdate += PlayerComponent_OnUpdate; +PlayerComponent.OnDelete += PlayerComponent_OnDelete; +PlayerComponent.OnBeforeDelete += PlayerComponent_OnBeforeDelete; +``` + +You can register for reducer call updates as well. + +- `OnREDUCEREvent`: Called when a reducer call is received from SpacetimeDB. (If a) you are subscribed to the table that the reducer modifies or b) You called the reducer and it failed) + +Example: + +```csharp +using SpacetimeDB.Types; + +Reducer.OnMovePlayerEvent += Reducer_OnMovePlayerEvent; +``` + +### Accessing the client cache + +The client cache is a local cache of the data that the client has received from SpacetimeDB. The client cache is automatically updated when the client receives updates from SpacetimeDB. + +When you run the CLI generate command, SpacetimeDB will automatically generate a class for each table in your database. These classes are generated in the `SpacetimeDB.Types` namespace. Each class contains a set of static methods that allow you to query the client cache. The following methods are available: + +- `int Count()`: Returns the number of rows in the table. +- `IEnumerable Iter()`: Returns an iterator over the table. +- `IEnumerable FilterByCOLUMN(ColumnValue)`: Filters the table by the specified column value. +- `TableRow? FindByCOLUMN(ColumnValue)`: Finds a single item by the specifed column value. +- `IEnumerable Query(Func)`: Filters the table with the specified predicate. + +### Calling Reducers + +To call a reducer, you need to call the autogenerated method on the `Reducer` class. The autogenerated method takes the reducer arguments as parameters. The reducer arguments are the same arguments that are expected in your server module. + +Example: + +```csharp +using SpacetimeDB.Types; + +Reducer.MovePlayer(new StdbVector2(0.0f, 0.0f), new StdbVector2(1.0f, 1.0f)); +``` diff --git a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/LICENSE.TXT.meta b/README.dotnet.md.meta similarity index 75% rename from Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/LICENSE.TXT.meta rename to README.dotnet.md.meta index 6cd0abc3d..b6ec09858 100644 --- a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/LICENSE.TXT.meta +++ b/README.dotnet.md.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 32e12c577ab96df98bd62984641357aa +guid: 729cacf01d1965648a5acf0dfa38b2a9 TextScriptImporter: externalObjects: {} userData: diff --git a/README.md b/README.md new file mode 100644 index 000000000..75c5fba0f --- /dev/null +++ b/README.md @@ -0,0 +1,136 @@ +# SpacetimeDB SDK for Unity Engine + +## Overview + +This repository contains the [Unity](https://unity.com/) SDK for SpacetimeDB. The SDK allows to interact with the database server and is prepared to work with code generated from a SpacetimeDB backend code. + +## Documentation + +The Unity SDK uses the same code as the C# SDK. You can find the documentation for the C# SDK in the [C# SDK Reference](https://spacetimedb.com/docs/sdks/c-sharp) + +There is also a comprehensive Unity tutorial/demo available: +- [Unity Tutorial](https://spacetimedb.com/docs/unity/part-1) Doc +- [Unity Demo](https://github.com/clockworklabs/SpacetimeDBUnityTutorial) Repo + +## Installation + +### Unity Demo + +Download the [.unitypackage release](https://github.com/clockworklabs/SpacetimeDBUnityTutorial/releases) of our [Unity Part 1 tutorial](https://spacetimedb.com/docs/unity/part-1) demo that includes this SDK as a package manfiest requirement. + +### Standalone + +1. Open the package manager window in Unity. +2. Click the "(+)" button in the top-left corner and select "Add package from git URL". +3. Paste the following URL: `https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk.git` + +## Usage + +### SpacetimeDBNetworkManager + +The Unity SDK for SpacetimeDB requires that there is a `SpacetimeDBNetworkManager` component attached to a GameObject in the scene. The `UnityNetworkManager` component is responsible for connecting to SpacetimeDB and managing the connection. The `UnityNetworkManager` component is a singleton and there can only be one instance of it in the scene. + +### Connecting to SpacetimeDB + +To connect to SpacetimeDB, you need to call the `Connect` method on the `SpacetimeDBClient` class. The `Connect` method takes the following parameters: + +- `token`: The authentication token to use to connect to SpacetimeDB. This token is generated by the backend code and is used to authenticate the client. +- `hostName`: The hostname of the SpacetimeDB server. This is the same hostname that you use to connect to the SpacetimeDB web interface. +- `moduleAddress`: The address of the module to connect to. This is the same address that you use to connect to the SpacetimeDB web interface. +- `sslEnabled`: Whether to use SSL to connect to SpacetimeDB. This is the same value that you use to connect to the SpacetimeDB web interface. + +Example: + +```csharp +using SpacetimeDB; + +SpacetimeDBClient.instance.Connect(TOKEN, HOST, DBNAME, SSL_ENABLED); +``` + +### AuthToken + +The `AuthToken` class is an optional helper class that can be used to store the local client's authentication token locally in the Unity PlayerPrefs. + +Example: + +```csharp +using SpacetimeDB; + +// called when we receive the client identity from SpacetimeDB +SpacetimeDBClient.instance.onIdentityReceived += (token, identity, address) => { + AuthToken.SaveToken(token); + local_identity = identity; +}; + +SpacetimeDBClient.instance.Connect(AuthToken.Token, hostName, moduleAddress, sslEnabled); +``` + +### Subscribing to tables + +To subscribe to a table, you need to call the `Subscribe` method on the `SpacetimeDBClient` class. The `Subscribe` method takes a list of queries as a parameter. The queries are the same queries that you use to subscribe to tables in the SpacetimeDB web interface. + +### Listening to events + +To listen to events, you need to register callbacks on the `SpacetimeDBClient` class. The following callbacks are available: + +- `onConnect`: Called when the client connects to SpacetimeDB. +- `onConnectError`: Called when the client fails to connect to SpacetimeDB. +- `onDisconnect`: Called when the client disconnects from SpacetimeDB. +- `onIdentityReceived`: Called when the client receives its identity from SpacetimeDB. +- `onSubscriptionApplied`: Called when the client receives the initial data from SpacetimeDB after subscribing to tables. + +You can register for row update events on a table. To do this, you need to register callbacks on the table class. The following callbacks are available: + +- `OnInsert`: Called when a row is inserted into the table. +- `OnUpdate`: Called when a row is updated in the table. +- `OnBeforeDelete`: Called before a row is deleted from the table. +- `OnDelete`: Called when a row is deleted from the table. +- `OnRowUpdate`: Called when a row is inserted, updated, or deleted from the table. + +Example: + +```csharp +using SpacetimeDB.Types; + +PlayerComponent.OnInsert += PlayerComponent_OnInsert; +PlayerComponent.OnUpdate += PlayerComponent_OnUpdate; +PlayerComponent.OnDelete += PlayerComponent_OnDelete; +PlayerComponent.OnBeforeDelete += PlayerComponent_OnBeforeDelete; +PlayerComponent.OnRowUpdate += PlayerComponent_OnRowUpdate; +``` + +You can register for reducer call updates as well. + +- `OnREDUCEREvent`: Called when a reducer call is received from SpacetimeDB. (If a) you are subscribed to the table that the reducer modifies or b) You called the reducer and it failed) + +Example: + +```csharp +using SpacetimeDB.Types; + +Reducer.OnMovePlayerEvent += Reducer_OnMovePlayerEvent; +``` + +### Accessing the client cache + +The client cache is a local cache of the data that the client has received from SpacetimeDB. The client cache is automatically updated when the client receives updates from SpacetimeDB. + +When you run the CLI generate command, SpacetimeDB will automatically generate a class for each table in your database. These classes are generated in the `SpacetimeDB.Types` namespace. Each class contains a set of static methods that allow you to query the client cache. The following methods are available: + +- `int Count()`: Returns the number of rows in the table. +- `IEnumerable Iter()`: Returns an iterator over the table. +- `IEnumerable FilterByCOLUMN(ColumnValue)`: Filters the table by the specified column value. +- `TableRow? FindByCOLUMN(ColumnValue)`: Finds a single item by the specifed column value. +- `IEnumerable Query(Func)`: Filters the table with the specified predicate. + +### Calling Reducers + +To call a reducer, you need to call the autogenerated method on the `Reducer` class. The autogenerated method takes the reducer arguments as parameters. The reducer arguments are the same arguments that are expected in your server module. + +Example: + +```csharp +using SpacetimeDB.Types; + +Reducer.MovePlayer(new StdbVector2(0.0f, 0.0f), new StdbVector2(1.0f, 1.0f)); +``` diff --git a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.xml.meta b/README.md.meta similarity index 75% rename from Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.xml.meta rename to README.md.meta index c7be4ebe8..b69b66ca5 100644 --- a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.xml.meta +++ b/README.md.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d0a0082994d341b439ee7e8ecb0b087e +guid: dfa7ed0c3892b254eaa47dd935085847 TextScriptImporter: externalObjects: {} userData: diff --git a/SpacetimeDB.ClientSDK.csproj b/SpacetimeDB.ClientSDK.csproj new file mode 100644 index 000000000..081cb2dee --- /dev/null +++ b/SpacetimeDB.ClientSDK.csproj @@ -0,0 +1,37 @@ + + + + netstandard2.1 + 9 + disable + enable + SpacetimeDB.ClientSDK + SpacetimeDB SDK + jdetter + Clockwork Labs + SpacetimeDB + The SpacetimeDB SDK is a software development kit (SDK) designed to simplify the interaction with SpacetimeDB server modules. + 2024 + https://spacetimedb.com + logo.png + README.md + https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk + 1.0.0 + 1.0.0-rc3 + $(DefaultItemExcludes);*~/** + + packages + + + + + + + + + + + + + + diff --git a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/System.Buffers.4.4.0.nupkg.meta b/SpacetimeDB.ClientSDK.csproj.meta similarity index 74% rename from Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/System.Buffers.4.4.0.nupkg.meta rename to SpacetimeDB.ClientSDK.csproj.meta index 2480d559f..31ff15d8f 100644 --- a/Assets/SpacetimeDB/Packages/System.Buffers.4.4.0/System.Buffers.4.4.0.nupkg.meta +++ b/SpacetimeDB.ClientSDK.csproj.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d21132fcdc0a304e89ee72f3bf71bdc3 +guid: 5a5d983b907565e4bb3f65ae28133d07 DefaultImporter: externalObjects: {} userData: diff --git a/SpacetimeDB.ClientSDK.sln b/SpacetimeDB.ClientSDK.sln new file mode 100644 index 000000000..c1f69b1bc --- /dev/null +++ b/SpacetimeDB.ClientSDK.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33717.318 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "client", "examples~\quickstart-chat\client.csproj", "{8F33709C-DEE9-41CC-A477-D6128E3700B1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpacetimeDB.ClientSDK", "SpacetimeDB.ClientSDK.csproj", "{242A8146-A58D-43E9-A2BD-31FFC6851AA6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tests", "tests~\tests.csproj", "{5CD31104-4719-4CE3-8D39-8BAE0B75C085}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8F33709C-DEE9-41CC-A477-D6128E3700B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8F33709C-DEE9-41CC-A477-D6128E3700B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8F33709C-DEE9-41CC-A477-D6128E3700B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8F33709C-DEE9-41CC-A477-D6128E3700B1}.Release|Any CPU.Build.0 = Release|Any CPU + {242A8146-A58D-43E9-A2BD-31FFC6851AA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {242A8146-A58D-43E9-A2BD-31FFC6851AA6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {242A8146-A58D-43E9-A2BD-31FFC6851AA6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {242A8146-A58D-43E9-A2BD-31FFC6851AA6}.Release|Any CPU.Build.0 = Release|Any CPU + {5CD31104-4719-4CE3-8D39-8BAE0B75C085}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5CD31104-4719-4CE3-8D39-8BAE0B75C085}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5CD31104-4719-4CE3-8D39-8BAE0B75C085}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5CD31104-4719-4CE3-8D39-8BAE0B75C085}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {35C59D87-64E5-4A6C-B1D5-2241B946E847} + EndGlobalSection +EndGlobal diff --git a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/System.Memory.4.5.3.nupkg.meta b/SpacetimeDB.ClientSDK.sln.meta similarity index 74% rename from Assets/SpacetimeDB/Packages/System.Memory.4.5.3/System.Memory.4.5.3.nupkg.meta rename to SpacetimeDB.ClientSDK.sln.meta index f17c9863b..ed9b04626 100644 --- a/Assets/SpacetimeDB/Packages/System.Memory.4.5.3/System.Memory.4.5.3.nupkg.meta +++ b/SpacetimeDB.ClientSDK.sln.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3b6419b3ddd8e3c59a084fbccd38354b +guid: 8dc5bd53630735140b683bfc099bd337 DefaultImporter: externalObjects: {} userData: diff --git a/after.SpacetimeDB.ClientSDK.sln.targets b/after.SpacetimeDB.ClientSDK.sln.targets new file mode 100644 index 000000000..a9197c509 --- /dev/null +++ b/after.SpacetimeDB.ClientSDK.sln.targets @@ -0,0 +1,11 @@ + + + + + + + <_UnsupportedDLLs Include="packages/**/net8.0/**" /> + + + + diff --git a/Assets/Main.unity.meta b/after.SpacetimeDB.ClientSDK.sln.targets.meta similarity index 74% rename from Assets/Main.unity.meta rename to after.SpacetimeDB.ClientSDK.sln.targets.meta index 56f79e866..d84b90eb8 100644 --- a/Assets/Main.unity.meta +++ b/after.SpacetimeDB.ClientSDK.sln.targets.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b7991f809bde6e4419a94e030a8bcb16 +guid: 7081aa46c77e49c4a86d9b626acc712c DefaultImporter: externalObjects: {} userData: diff --git a/examples~/quickstart-chat/Program.cs b/examples~/quickstart-chat/Program.cs new file mode 100644 index 000000000..f82d8f87e --- /dev/null +++ b/examples~/quickstart-chat/Program.cs @@ -0,0 +1,249 @@ +using System; +using System.Collections.Concurrent; +using System.Linq; +using System.Threading; +using SpacetimeDB; +using SpacetimeDB.Types; + +const string HOST = "http://localhost:3000"; +const string DBNAME = "chatqs"; + +// our local client SpacetimeDB identity +Identity? local_identity = null; +// declare a thread safe queue to store commands +var input_queue = new ConcurrentQueue<(string Command, string Args)>(); + +void Main() +{ + AuthToken.Init(".spacetime_csharp_quickstart"); + + // TODO: just do `var conn = DbConnection...` when OnConnect signature is fixed. + DbConnection? conn = null; + + conn = DbConnection.Builder() + .WithUri(HOST) + .WithModuleName(DBNAME) + //.WithToken(AuthToken.Token) + .OnConnect(OnConnect) + .OnConnectError(OnConnectError) + .OnDisconnect(OnDisconnect) + .Build(); + + conn.Db.User.OnInsert += User_OnInsert; + conn.Db.User.OnUpdate += User_OnUpdate; + + conn.Db.Message.OnInsert += Message_OnInsert; + + conn.Reducers.OnSetName += Reducer_OnSetNameEvent; + conn.Reducers.OnSendMessage += Reducer_OnSendMessageEvent; + +#pragma warning disable CS0612 // Using obsolete API + conn.onUnhandledReducerError += onUnhandledReducerError; +#pragma warning restore CS0612 // Using obsolete API + + // declare a threadsafe cancel token to cancel the process loop + var cancellationTokenSource = new CancellationTokenSource(); + + // spawn a thread to call process updates and process commands + var thread = new Thread(() => ProcessThread(conn, cancellationTokenSource.Token)); + thread.Start(); + + InputLoop(); + + // this signals the ProcessThread to stop + cancellationTokenSource.Cancel(); + thread.Join(); +} + +string UserNameOrIdentity(User user) => user.Name ?? user.Identity.ToString()[..8]; + +void User_OnInsert(EventContext ctx, User insertedValue) +{ + if (insertedValue.Online) + { + Console.WriteLine($"{UserNameOrIdentity(insertedValue)} is online"); + } +} + +void User_OnUpdate(EventContext ctx, User oldValue, User newValue) +{ + if (oldValue.Name != newValue.Name) + { + Console.WriteLine($"{UserNameOrIdentity(oldValue)} renamed to {newValue.Name}"); + } + if (oldValue.Online != newValue.Online) + { + if (newValue.Online) + { + Console.WriteLine($"{UserNameOrIdentity(newValue)} connected."); + } + else + { + Console.WriteLine($"{UserNameOrIdentity(newValue)} disconnected."); + } + } +} + +void PrintMessage(RemoteTables tables, Message message) +{ + var sender = tables.User.Identity.Find(message.Sender); + var senderName = "unknown"; + if (sender != null) + { + senderName = UserNameOrIdentity(sender); + } + + Console.WriteLine($"{senderName}: {message.Text}"); +} + +void Message_OnInsert(EventContext ctx, Message insertedValue) +{ + if (ctx.Event is not Event.SubscribeApplied) + { + PrintMessage(ctx.Db, insertedValue); + } +} + +void Reducer_OnSetNameEvent(EventContext ctx, string name) +{ + if (ctx.Event is Event.Reducer reducer) + { + var e = reducer.ReducerEvent; + if (e.CallerIdentity == local_identity && e.Status is Status.Failed(var error)) + { + Console.Write($"Failed to change name to {name}: {error}"); + } + } +} + +void Reducer_OnSendMessageEvent(EventContext ctx, string text) +{ + if (ctx.Event is Event.Reducer reducer) + { + var e = reducer.ReducerEvent; + if (e.CallerIdentity == local_identity && e.Status is Status.Failed(var error)) + { + Console.Write($"Failed to send message {text}: {error}"); + } + } +} + +void OnConnect(DbConnection conn, Identity identity, string authToken) +{ + local_identity = identity; + AuthToken.SaveToken(authToken); + + var subscriptions = 0; + SubscriptionBuilder.Callback waitForSubscriptions = (EventContext ctx) => + { + // Note: callbacks are always invoked on the main thread, so you don't need to + // worry about thread synchronization or anything like that. + subscriptions += 1; + + if (subscriptions == 2) + { + OnSubscriptionApplied(ctx); + } + }; + + var userSubscription = conn.SubscriptionBuilder() + .OnApplied(waitForSubscriptions) + .Subscribe("SELECT * FROM user"); + var messageSubscription = conn.SubscriptionBuilder() + .OnApplied(waitForSubscriptions) + .Subscribe("SELECT * FROM message"); + + // You can also use SubscribeToAllTables, but it should be avoided if you have any large tables: + // conn.SubscriptionBuilder().OnApplied(OnSubscriptionApplied).SubscribeToAllTables(); + +} + +void OnConnectError(Exception e) +{ + +} + +void OnDisconnect(DbConnection conn, Exception? e) +{ + +} + +void PrintMessagesInOrder(RemoteTables tables) +{ + foreach (Message message in tables.Message.Iter().OrderBy(item => item.Sent)) + { + PrintMessage(tables, message); + } +} + +void OnSubscriptionApplied(EventContext ctx) +{ + Console.WriteLine("Connected"); + PrintMessagesInOrder(ctx.Db); +} + +void onUnhandledReducerError(ReducerEvent reducerEvent) +{ + Console.WriteLine($"Unhandled reducer error in {reducerEvent.Reducer}: {reducerEvent.Status}"); +} + +void ProcessThread(DbConnection conn, CancellationToken ct) +{ + try + { + // loop until cancellation token + while (!ct.IsCancellationRequested) + { + conn.FrameTick(); + + ProcessCommands(conn.Reducers); + + Thread.Sleep(100); + } + } + finally + { + conn.Disconnect(); + } +} + +void InputLoop() +{ + while (true) + { + var input = Console.ReadLine(); + if (input == null) + { + break; + } + + if (input.StartsWith("/name ")) + { + input_queue.Enqueue(("name", input[6..])); + continue; + } + else + { + input_queue.Enqueue(("message", input)); + } + } +} + +void ProcessCommands(RemoteReducers reducers) +{ + // process input queue commands + while (input_queue.TryDequeue(out var command)) + { + switch (command.Command) + { + case "message": + reducers.SendMessage(command.Args); + break; + case "name": + reducers.SetName(command.Args); + break; + } + } +} + +Main(); diff --git a/examples~/quickstart-chat/client.csproj b/examples~/quickstart-chat/client.csproj new file mode 100644 index 000000000..48917cce7 --- /dev/null +++ b/examples~/quickstart-chat/client.csproj @@ -0,0 +1,17 @@ + + + + Exe + net7.0 + false + disable + enable + + false + + + + + + + diff --git a/examples~/quickstart-chat/module_bindings/Message.cs b/examples~/quickstart-chat/module_bindings/Message.cs new file mode 100644 index 000000000..c63d4bfad --- /dev/null +++ b/examples~/quickstart-chat/module_bindings/Message.cs @@ -0,0 +1,43 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Types +{ + [SpacetimeDB.Type] + [DataContract] + public partial class Message : IDatabaseRow + { + [DataMember(Name = "sender")] + public SpacetimeDB.Identity Sender; + [DataMember(Name = "sent")] + public ulong Sent; + [DataMember(Name = "text")] + public string Text; + + public Message( + SpacetimeDB.Identity Sender, + ulong Sent, + string Text + ) + { + this.Sender = Sender; + this.Sent = Sent; + this.Text = Text; + } + + public Message() + { + this.Sender = new(); + this.Text = ""; + } + + } +} diff --git a/examples~/quickstart-chat/module_bindings/User.cs b/examples~/quickstart-chat/module_bindings/User.cs new file mode 100644 index 000000000..2d4c79b07 --- /dev/null +++ b/examples~/quickstart-chat/module_bindings/User.cs @@ -0,0 +1,42 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Types +{ + [SpacetimeDB.Type] + [DataContract] + public partial class User : IDatabaseRow + { + [DataMember(Name = "identity")] + public SpacetimeDB.Identity Identity; + [DataMember(Name = "name")] + public string? Name; + [DataMember(Name = "online")] + public bool Online; + + public User( + SpacetimeDB.Identity Identity, + string? Name, + bool Online + ) + { + this.Identity = Identity; + this.Name = Name; + this.Online = Online; + } + + public User() + { + this.Identity = new(); + } + + } +} diff --git a/examples~/quickstart-chat/module_bindings/_Globals/SpacetimeDBClient.cs b/examples~/quickstart-chat/module_bindings/_Globals/SpacetimeDBClient.cs new file mode 100644 index 000000000..031c02f02 --- /dev/null +++ b/examples~/quickstart-chat/module_bindings/_Globals/SpacetimeDBClient.cs @@ -0,0 +1,224 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using SpacetimeDB.ClientApi; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Types +{ + public sealed class RemoteTables + { + public class MessageHandle : RemoteTableHandle + { + internal MessageHandle() + { + } + + } + + public readonly MessageHandle Message = new(); + + public class UserHandle : RemoteTableHandle + { + + public override void InternalInvokeValueInserted(IDatabaseRow row) + { + var value = (User)row; + Identity.Cache[value.Identity] = value; + } + + public override void InternalInvokeValueDeleted(IDatabaseRow row) + { + Identity.Cache.Remove(((User)row).Identity); + } + + public class IdentityUniqueIndex + { + internal readonly Dictionary Cache = new(16); + public User? Find(SpacetimeDB.Identity value) + { + Cache.TryGetValue(value, out var r); + return r; + } + + } + + public IdentityUniqueIndex Identity = new(); + + internal UserHandle() + { + } + public override object GetPrimaryKey(IDatabaseRow row) => ((User)row).Identity; + + } + + public readonly UserHandle User = new(); + + } + + public sealed class RemoteReducers : RemoteBase + { + internal RemoteReducers(DbConnection conn, SetReducerFlags SetReducerFlags) : base(conn) { this.SetCallReducerFlags = SetReducerFlags; } + internal readonly SetReducerFlags SetCallReducerFlags; + public delegate void SendMessageHandler(EventContext ctx, string text); + public event SendMessageHandler? OnSendMessage; + + public void SendMessage(string text) + { + conn.InternalCallReducer(new Reducer.SendMessage(text), this.SetCallReducerFlags.SendMessageFlags); + } + + public bool InvokeSendMessage(EventContext ctx, Reducer.SendMessage args) + { + if (OnSendMessage == null) return false; + OnSendMessage( + ctx, + args.Text + ); + return true; + } + public delegate void SetNameHandler(EventContext ctx, string name); + public event SetNameHandler? OnSetName; + + public void SetName(string name) + { + conn.InternalCallReducer(new Reducer.SetName(name), this.SetCallReducerFlags.SetNameFlags); + } + + public bool InvokeSetName(EventContext ctx, Reducer.SetName args) + { + if (OnSetName == null) return false; + OnSetName( + ctx, + args.Name + ); + return true; + } + } + + public sealed class SetReducerFlags + { + internal SetReducerFlags() { } + internal CallReducerFlags SendMessageFlags; + public void SendMessage(CallReducerFlags flags) { this.SendMessageFlags = flags; } + internal CallReducerFlags SetNameFlags; + public void SetName(CallReducerFlags flags) { this.SetNameFlags = flags; } + } + + public partial record EventContext : DbContext, IEventContext + { + public readonly RemoteReducers Reducers; + public readonly SetReducerFlags SetReducerFlags; + public readonly Event Event; + + internal EventContext(DbConnection conn, Event reducerEvent) : base(conn.Db) + { + Reducers = conn.Reducers; + SetReducerFlags = conn.SetReducerFlags; + Event = reducerEvent; + } + } + + public abstract partial class Reducer + { + private Reducer() { } + + [SpacetimeDB.Type] + [DataContract] + public partial class SendMessage : Reducer, IReducerArgs + { + [DataMember(Name = "text")] + public string Text; + + public SendMessage(string Text) + { + this.Text = Text; + } + + public SendMessage() + { + this.Text = ""; + } + + string IReducerArgs.ReducerName => "send_message"; + } + + [SpacetimeDB.Type] + [DataContract] + public partial class SetName : Reducer, IReducerArgs + { + [DataMember(Name = "name")] + public string Name; + + public SetName(string Name) + { + this.Name = Name; + } + + public SetName() + { + this.Name = ""; + } + + string IReducerArgs.ReducerName => "set_name"; + } + + public class StdbNone : Reducer {} + public class StdbIdentityConnected : Reducer {} + public class StdbIdentityDisconnected : Reducer {} + } + + public class DbConnection : DbConnectionBase + { + public readonly RemoteTables Db = new(); + public readonly RemoteReducers Reducers; + public readonly SetReducerFlags SetReducerFlags; + + public DbConnection() + { + SetReducerFlags = new(); + Reducers = new(this, this.SetReducerFlags); + + clientDB.AddTable("message", Db.Message); + clientDB.AddTable("user", Db.User); + } + + protected override Reducer ToReducer(TransactionUpdate update) + { + var encodedArgs = update.ReducerCall.Args; + return update.ReducerCall.ReducerName switch { + "send_message" => BSATNHelpers.Decode(encodedArgs), + "set_name" => BSATNHelpers.Decode(encodedArgs), + "" => new Reducer.StdbNone(), + "__identity_connected__" => new Reducer.StdbIdentityConnected(), + "__identity_disconnected__" => new Reducer.StdbIdentityDisconnected(), + "" => new Reducer.StdbNone(), + var reducer => throw new ArgumentOutOfRangeException("Reducer", $"Unknown reducer {reducer}") + }; + } + + protected override IEventContext ToEventContext(Event reducerEvent) => + new EventContext(this, reducerEvent); + + protected override bool Dispatch(IEventContext context, Reducer reducer) + { + var eventContext = (EventContext)context; + return reducer switch { + Reducer.SendMessage args => Reducers.InvokeSendMessage(eventContext, args), + Reducer.SetName args => Reducers.InvokeSetName(eventContext, args), + Reducer.StdbNone or + Reducer.StdbIdentityConnected or + Reducer.StdbIdentityDisconnected => true, + _ => throw new ArgumentOutOfRangeException("Reducer", $"Unknown reducer {reducer}") + }; + } + + public SubscriptionBuilder SubscriptionBuilder() => new(this); + } +} diff --git a/export.sh b/export.sh deleted file mode 100755 index de8962511..000000000 --- a/export.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -if [ -z "$UNITY_PATH" ]; then - export UNITY_PATH="$HOME/Unity/Hub/Editor/2020.3.25f1/Editor/Unity" -fi - -if [ ! -f $UNITY_PATH ]; then - echo "Unable to find a version of Unity. Please specify it using UNITY_PATH :)" - exit 1 -fi - -$UNITY_PATH -projectPath . -quit -batchmode -nographics -ignorecompilererrors -executeMethod "ExportPackage.Export" diff --git a/logo.png b/logo.png new file mode 100644 index 000000000..6d65c19db Binary files /dev/null and b/logo.png differ diff --git a/logo.png.meta b/logo.png.meta new file mode 100644 index 000000000..5556441e5 --- /dev/null +++ b/logo.png.meta @@ -0,0 +1,114 @@ +fileFormatVersion: 2 +guid: c163a0b63c6c06d48a38df66870453e1 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json b/package.json new file mode 100644 index 000000000..ce1b8f739 --- /dev/null +++ b/package.json @@ -0,0 +1,17 @@ +{ + "name": "com.clockworklabs.spacetimedbsdk", + "displayName": "SpacetimeDB SDK", + "version": "1.0.0-rc3", + "description": "The SpacetimeDB Client SDK is a software development kit (SDK) designed to interact with and manipulate SpacetimeDB modules..", + "keywords": [], + "author": { + "name": "Clockwork Labs", + "email": "john@clockworklabs.io", + "url": "https://spacetimedb.com" + }, + "repository": { + "type": "git", + "url": "https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk" + }, + "license": "" +} diff --git a/package.json.meta b/package.json.meta new file mode 100644 index 000000000..e630b62c6 --- /dev/null +++ b/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 22ac4b1e312dc4c438bc4c481f35f1ad +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Materials.meta b/packages.meta similarity index 77% rename from Assets/Materials.meta rename to packages.meta index ee17c23bb..6199f3565 100644 --- a/Assets/Materials.meta +++ b/packages.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d0234ba368eeec9418390da711bfdad0 +guid: 2d6701c9b31bc7843b5e8aee47d845c8 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/packages/.gitignore b/packages/.gitignore new file mode 100644 index 000000000..7d9dea737 --- /dev/null +++ b/packages/.gitignore @@ -0,0 +1,11 @@ +# Ignore most of NuGet package structure, except DLLs which are required by Unity. +/*/*/* + +!/*/*/analyzers +!/*/*/analyzers.meta + +!/*/*/lib +!/*/*/lib.meta + +# Ignore XML documentation metadata from packages too. +*.xml diff --git a/Assets/Presets.meta b/packages/spacetimedb.bsatn.runtime.meta similarity index 77% rename from Assets/Presets.meta rename to packages/spacetimedb.bsatn.runtime.meta index c3a6623f4..6dc8b6257 100644 --- a/Assets/Presets.meta +++ b/packages/spacetimedb.bsatn.runtime.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 558255460b74ec04fa70b5570e9327bd +guid: 8865417631feca343997ae22b3320e75 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Presets/Defaults.meta b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3.meta similarity index 77% rename from Assets/Presets/Defaults.meta rename to packages/spacetimedb.bsatn.runtime/1.0.0-rc3.meta index 959a49bd8..db902e53c 100644 --- a/Assets/Presets/Defaults.meta +++ b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 71ea82b02df99c2439e0dc8e4e1ebc24 +guid: c602172ef60d71f41a6a5e85cf41da1a folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Settings.meta b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/analyzers.meta similarity index 77% rename from Assets/Settings.meta rename to packages/spacetimedb.bsatn.runtime/1.0.0-rc3/analyzers.meta index 8e9f13c8f..aff342ea1 100644 --- a/Assets/Settings.meta +++ b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/analyzers.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0735c275001a2c84dafdb30deced5d8d +guid: f112b25d371a72548b6b4959e104c4c3 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/analyzers/dotnet.meta b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/analyzers/dotnet.meta new file mode 100644 index 000000000..f2031f11a --- /dev/null +++ b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/analyzers/dotnet.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8554a9e409be36a42bdb316f4677fabf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/analyzers/dotnet/cs.meta b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/analyzers/dotnet/cs.meta new file mode 100644 index 000000000..a387186fa --- /dev/null +++ b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/analyzers/dotnet/cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a24e03405bfe85e4996b2524189ac24a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/analyzers/dotnet/cs/SpacetimeDB.BSATN.Codegen.dll b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/analyzers/dotnet/cs/SpacetimeDB.BSATN.Codegen.dll new file mode 100755 index 000000000..c1ff8cd98 Binary files /dev/null and b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/analyzers/dotnet/cs/SpacetimeDB.BSATN.Codegen.dll differ diff --git a/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/analyzers/dotnet/cs/SpacetimeDB.BSATN.Codegen.dll.meta b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/analyzers/dotnet/cs/SpacetimeDB.BSATN.Codegen.dll.meta new file mode 100644 index 000000000..fcd3478e3 --- /dev/null +++ b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/analyzers/dotnet/cs/SpacetimeDB.BSATN.Codegen.dll.meta @@ -0,0 +1,71 @@ +fileFormatVersion: 2 +guid: 31ff25d2b5723480e873b2b8f46bba86 +labels: +- RoslynAnalyzer +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 1 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib.meta b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/lib.meta similarity index 77% rename from Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib.meta rename to packages/spacetimedb.bsatn.runtime/1.0.0-rc3/lib.meta index 0f82551b6..3050ce8ab 100644 --- a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib.meta +++ b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/lib.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f9615e64ff20e6cefb896b5e3502f055 +guid: dc6d364d8264f4d43847a2f962630f96 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/lib/netstandard2.1.meta b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/lib/netstandard2.1.meta new file mode 100644 index 000000000..56e591b69 --- /dev/null +++ b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/lib/netstandard2.1.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b964bd4b6540b3c4e90d73d46afd8fc2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/lib/netstandard2.1/SpacetimeDB.BSATN.Runtime.dll b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/lib/netstandard2.1/SpacetimeDB.BSATN.Runtime.dll new file mode 100755 index 000000000..7f155111f Binary files /dev/null and b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/lib/netstandard2.1/SpacetimeDB.BSATN.Runtime.dll differ diff --git a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib/net45/Google.Protobuf.dll.meta b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/lib/netstandard2.1/SpacetimeDB.BSATN.Runtime.dll.meta similarity index 91% rename from Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib/net45/Google.Protobuf.dll.meta rename to packages/spacetimedb.bsatn.runtime/1.0.0-rc3/lib/netstandard2.1/SpacetimeDB.BSATN.Runtime.dll.meta index 7dc44b927..de2769892 100644 --- a/Assets/SpacetimeDB/Packages/Google.Protobuf.3.21.9/lib/net45/Google.Protobuf.dll.meta +++ b/packages/spacetimedb.bsatn.runtime/1.0.0-rc3/lib/netstandard2.1/SpacetimeDB.BSATN.Runtime.dll.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4a7b5f56be0f0aa64828fa42c1289fb4 +guid: 8ab8f6f35b91340e6b1269b6448e3bf0 PluginImporter: externalObjects: {} serializedVersion: 2 @@ -7,7 +7,7 @@ PluginImporter: executionOrder: {} defineConstraints: [] isPreloaded: 0 - isOverridable: 0 + isOverridable: 1 isExplicitlyReferenced: 0 validateReferences: 1 platformData: diff --git a/src.meta b/src.meta new file mode 100644 index 000000000..6f9561625 --- /dev/null +++ b/src.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e7dd9a5d0c775974facb2bb541db63d6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/AuthToken.cs b/src/AuthToken.cs new file mode 100644 index 000000000..2fce2f73d --- /dev/null +++ b/src/AuthToken.cs @@ -0,0 +1,128 @@ +/* This is an optional helper class to store your auth token in local storage + * + Example: + + AuthToken.Init(".my_app_name"); + + SpacetimeDBClient.instance.onIdentityReceived += (token, identity) => + { + AuthToken.SaveToken(token); + + ... + }; + + SpacetimeDBClient.instance.Connect(AuthToken.Token, "localhost:3000", "basicchat", false); + */ +#if !UNITY_5_3_OR_NEWER +using System; +using System.IO; +using System.Linq; + +namespace SpacetimeDB +{ + public static class AuthToken + { + private static string? settingsPath; + private static string? token; + + private const string PREFIX = "auth_token="; + + /// + /// Initializes the AuthToken class. This must be called before any other methods. + /// + /// The folder to store the config file in. Default is ".spacetime_csharp_sdk". + /// The name of the config file. Default is "settings.ini". + /// The root folder to store the config file in. Default is the user's home directory. + /// + public static void Init(string configFolder = ".spacetime_csharp_sdk", string configFile = "settings.ini", string? configRoot = null) + { + configRoot ??= Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); + + if (Environment.GetCommandLineArgs().Any(arg => arg == "--client")) + { + int clientIndex = Array.FindIndex(Environment.GetCommandLineArgs(), arg => arg == "--client"); + var configFileParts = configFile.Split("."); + configFile = $"{configFileParts[0]}_{Environment.GetCommandLineArgs()[clientIndex + 1]}.{configFileParts[1]}"; + } + + settingsPath = Path.Combine(configRoot, configFolder, configFile); + + if (File.Exists(settingsPath)) + { + token = + File.ReadLines(settingsPath) + .FirstOrDefault(line => line.StartsWith(PREFIX)) + ?[PREFIX.Length..]; + } + } + + /// + /// This is the auth token that was saved to local storage. Null if not never saved. + /// When you specify null to the SpacetimeDBClient, SpacetimeDB will generate a new identity for you. + /// + public static string? Token + { + get + { + if (settingsPath == null) + { + throw new Exception("Token not initialized. Call AuthToken.Init() first."); + } + return token; + } + } + + /// + /// Save the auth token to local storage. + /// SpacetimeDBClient provides this token to you in the onIdentityReceived callback. + /// + public static void SaveToken(string token) + { + if (settingsPath == null) + { + throw new Exception("Token not initialized. Call AuthToken.Init() first."); + } + Directory.CreateDirectory(Path.GetDirectoryName(settingsPath)!); + var newAuthLine = PREFIX + token; + var lines = File.Exists(settingsPath) ? File.ReadAllLines(settingsPath).ToList() : new(); + var i = lines.FindIndex(line => line.StartsWith(PREFIX)); + if (i >= 0) + { + lines[i] = newAuthLine; + } + else + { + lines.Add(newAuthLine); + } + File.WriteAllLines(settingsPath, lines); + } + } +} +#else +using UnityEngine; + +namespace SpacetimeDB +{ + // This is an optional helper class to store your auth token in PlayerPrefs + // Override GetTokenKey() if you want to use a player pref key specific to your game + public static class AuthToken + { + public static string Token => PlayerPrefs.GetString(GetTokenKey()); + + public static void SaveToken(string token) + { + PlayerPrefs.SetString(GetTokenKey(), token); + } + + public static string GetTokenKey() + { + var key = "spacetimedb.identity_token"; +#if UNITY_EDITOR + // Different editors need different keys + key += $" - {Application.dataPath}"; +#endif + return key; + } + } +} +#endif diff --git a/Assets/SpacetimeDB/Scripts/ClientApi.cs.meta b/src/AuthToken.cs.meta similarity index 83% rename from Assets/SpacetimeDB/Scripts/ClientApi.cs.meta rename to src/AuthToken.cs.meta index 2023804f8..6b2cf78c0 100644 --- a/Assets/SpacetimeDB/Scripts/ClientApi.cs.meta +++ b/src/AuthToken.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7f4de68bfb39d5d4b8145d97dffde8c9 +guid: 44e5948afc80d3a44b2229710cf70531 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/BSATNHelpers.cs b/src/BSATNHelpers.cs new file mode 100644 index 000000000..59160657d --- /dev/null +++ b/src/BSATNHelpers.cs @@ -0,0 +1,18 @@ +using SpacetimeDB.BSATN; +using System.IO; + +namespace SpacetimeDB +{ + public static class BSATNHelpers + { + public static T Decode(System.Collections.Generic.List bsatn) where T : IStructuralReadWrite, new() => + Decode(bsatn.ToArray()); + + public static T Decode(byte[] bsatn) where T : IStructuralReadWrite, new() + { + using var stream = new MemoryStream(bsatn); + using var reader = new BinaryReader(stream); + return IStructuralReadWrite.Read(reader); + } + } +} diff --git a/Assets/ExportPackage.cs.meta b/src/BSATNHelpers.cs.meta similarity index 83% rename from Assets/ExportPackage.cs.meta rename to src/BSATNHelpers.cs.meta index d56b6fc11..aa87b84d9 100644 --- a/Assets/ExportPackage.cs.meta +++ b/src/BSATNHelpers.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 54770d36c73a74a6db05cfc84d75f761 +guid: 1937244b87cea4904a5c0e9ddfa3d6c4 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/CallReducerFlags.cs b/src/CallReducerFlags.cs new file mode 100644 index 000000000..0a3ea363e --- /dev/null +++ b/src/CallReducerFlags.cs @@ -0,0 +1,9 @@ +namespace SpacetimeDB +{ + public enum CallReducerFlags : byte + { + // This is the default. + FullUpdate = 0, + NoSuccessNotify = 1, + } +} diff --git a/Assets/SpacetimeDB/Scripts/IDatabaseTable.cs.meta b/src/CallReducerFlags.cs.meta similarity index 83% rename from Assets/SpacetimeDB/Scripts/IDatabaseTable.cs.meta rename to src/CallReducerFlags.cs.meta index ab8e8b812..dbfee1f86 100644 --- a/Assets/SpacetimeDB/Scripts/IDatabaseTable.cs.meta +++ b/src/CallReducerFlags.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7f969825278c8e3fd9014e02b825f7ac +guid: c0567f0d188b749659b7291c277a2b17 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/ClientCache.cs b/src/ClientCache.cs new file mode 100644 index 000000000..9e01e3274 --- /dev/null +++ b/src/ClientCache.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using SpacetimeDB.Internal; + +namespace SpacetimeDB +{ + // TODO: merge this into `RemoteTables`. + // It should just provide auto-generated `GetTable` and `GetTables` methods. + public class ClientCache + { + private readonly IDbConnection conn; + + private readonly Dictionary tables = new(); + + public ClientCache(IDbConnection conn) => this.conn = conn; + + public void AddTable(string name, IRemoteTableHandle table) + where Row : IDatabaseRow, new() + { + if (!tables.TryAdd(name, table)) + { + Log.Error($"Table with name already exists: {name}"); + } + + table.Initialize(name, conn); + } + + internal IRemoteTableHandle? GetTable(string name) + { + if (tables.TryGetValue(name, out var table)) + { + return table; + } + + Log.Error($"We don't know that this table is: {name}"); + return null; + } + + internal IEnumerable GetTables() => tables.Values; + } +} diff --git a/Assets/SpacetimeDB/Scripts/NetworkManager.cs.meta b/src/ClientCache.cs.meta similarity index 83% rename from Assets/SpacetimeDB/Scripts/NetworkManager.cs.meta rename to src/ClientCache.cs.meta index cc9f8c5c5..05945aad6 100644 --- a/Assets/SpacetimeDB/Scripts/NetworkManager.cs.meta +++ b/src/ClientCache.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: afbc59781ed95141abe2453be650b4bf +guid: 19daa942f11e07246a9cb65c81ce982a MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/Compression.cs b/src/Compression.cs new file mode 100644 index 000000000..8f630f994 --- /dev/null +++ b/src/Compression.cs @@ -0,0 +1,9 @@ +namespace SpacetimeDB +{ + public enum Compression + { + None, + Brotli, + Gzip, + } +} diff --git a/src/Compression.cs.meta b/src/Compression.cs.meta new file mode 100644 index 000000000..31f1b1906 --- /dev/null +++ b/src/Compression.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 78dd2c1276a6e4e859d2c4fad671c2c7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/ConsoleLogger.cs b/src/ConsoleLogger.cs new file mode 100644 index 000000000..2fda0ab5b --- /dev/null +++ b/src/ConsoleLogger.cs @@ -0,0 +1,82 @@ +using System; + +namespace SpacetimeDB +{ + internal class ConsoleLogger : ISpacetimeDBLogger + { + [Flags] + public enum LogLevel + { + None = 0, + Debug = 1, + Trace = 2, + Info = 4, + Warning = 8, + Error = 16, + Exception = 32, + All = ~0 + } + LogLevel _logLevel; + + public ConsoleLogger(LogLevel logLevel = LogLevel.All) + { + _logLevel = logLevel; + } + + public void Debug(string message) + { + if (_logLevel.HasFlag(LogLevel.Debug)) + { + Console.WriteLine($"[D] {message}"); + } + } + + public void Trace(string message) + { + if (_logLevel.HasFlag(LogLevel.Trace)) + { + Console.WriteLine($"[T] {message}"); + } + } + + public void Info(string message) + { + if (_logLevel.HasFlag(LogLevel.Info)) + { + Console.WriteLine($"[I] {message}"); + } + } + + public void Warn(string message) + { + if (_logLevel.HasFlag(LogLevel.Warning)) + { + Console.WriteLine($"[W] {message}"); + } + } + + public void Error(string message) + { + if (_logLevel.HasFlag(LogLevel.Error)) + { + Console.WriteLine($"[E] {message}"); + } + } + + public void Exception(string message) + { + if (_logLevel.HasFlag(LogLevel.Exception)) + { + Console.WriteLine($"[X] {message}"); + } + } + + public void Exception(Exception exception) + { + if (_logLevel.HasFlag(LogLevel.Exception)) + { + Console.WriteLine($"[X] {exception}"); + } + } + } +} diff --git a/src/ConsoleLogger.cs.meta b/src/ConsoleLogger.cs.meta new file mode 100644 index 000000000..530905674 --- /dev/null +++ b/src/ConsoleLogger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2273bbbdab0d0bf478b6cecee881dcc7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Event.cs b/src/Event.cs new file mode 100644 index 000000000..2f69d43af --- /dev/null +++ b/src/Event.cs @@ -0,0 +1,231 @@ +using System; +using SpacetimeDB.ClientApi; + +namespace SpacetimeDB +{ + public interface IEventContext { } + + public interface IReducerArgs : BSATN.IStructuralReadWrite + { + string ReducerName { get; } + } + + [Type] + public partial record Status : TaggedEnum<( + Unit Committed, + string Failed, + Unit OutOfEnergy + )>; + + public record ReducerEvent( + DateTimeOffset Timestamp, + Status Status, + Identity CallerIdentity, + Address? CallerAddress, + U128? EnergyConsumed, + R Reducer + ); + + public record Event + { + private Event() { } + + public record Reducer(ReducerEvent ReducerEvent) : Event; + public record SubscribeApplied : Event; + public record UnsubscribeApplied : Event; + public record SubscribeError(Exception Exception) : Event; + public record UnknownTransaction : Event; + } + + // TODO: Move those classes into EventContext, so that we wouldn't need repetitive generics. + public sealed class SubscriptionBuilder + where EventContext : IEventContext + { + private readonly IDbConnection conn; + public delegate void Callback(EventContext ctx); + private event Callback? Applied; + private event Callback? Error; + + public SubscriptionBuilder(IDbConnection conn) + { + this.conn = conn; + } + + public SubscriptionBuilder OnApplied(Callback callback) + { + Applied += callback; + return this; + } + + public SubscriptionBuilder OnError(Callback callback) + { + Error += callback; + return this; + } + + public SubscriptionHandle Subscribe(string querySql) => new(conn, Applied, Error, querySql); + + public void SubscribeToAllTables() + { + // Make sure we use the legacy handle constructor here, even though there's only 1 query. + // We drop the error handler, since it can't be called for legacy subscriptions. + new SubscriptionHandle(conn, Applied, new string[] { "SELECT * FROM *" }); + } + } + + public interface ISubscriptionHandle + { + void OnApplied(IEventContext ctx, SubscriptionAppliedType state); + void OnError(IEventContext ctx); + void OnEnded(IEventContext ctx); + } + + /// + /// An applied subscription can either be a new-style subscription (with a query ID), + /// or a legacy subscription (no query ID). + /// + [Type] + public partial record SubscriptionAppliedType : TaggedEnum<( + QueryId Active, + Unit LegacyActive)> + { } + + /// + /// State flow chart: + /// + /// | + /// v + /// Pending + /// | | + /// v v + /// Active LegacyActive + /// | + /// v + /// Ended + /// + /// + [Type] + public partial record SubscriptionState : TaggedEnum<( + Unit Pending, + QueryId Active, + Unit LegacyActive, + Unit Ended)> + { } + + public class SubscriptionHandle : ISubscriptionHandle + where EventContext : IEventContext + { + private readonly IDbConnection conn; + private readonly SubscriptionBuilder.Callback? onApplied; + private readonly SubscriptionBuilder.Callback? onError; + private SubscriptionBuilder.Callback? onEnded; + + private SubscriptionState state; + + /// + /// Whether the subscription has ended. + /// + public bool IsEnded + { + get + { + return state is SubscriptionState.Ended; + } + } + + /// + /// Whether the subscription is active. + /// + public bool IsActive + { + get + { + return state is SubscriptionState.Active || state is SubscriptionState.LegacyActive; + } + } + + void ISubscriptionHandle.OnApplied(IEventContext ctx, SubscriptionAppliedType type) + { + if (type is SubscriptionAppliedType.Active active) + { + state = new SubscriptionState.Active(active.Active_); + } + else if (type is SubscriptionAppliedType.LegacyActive) + { + state = new SubscriptionState.LegacyActive(new()); + } + onApplied?.Invoke((EventContext)ctx); + } + + void ISubscriptionHandle.OnEnded(IEventContext ctx) + { + state = new SubscriptionState.Ended(new()); + onEnded?.Invoke((EventContext)ctx); + } + + void ISubscriptionHandle.OnError(IEventContext ctx) + { + state = new SubscriptionState.Ended(new()); + onError?.Invoke((EventContext)ctx); + } + + /// + /// TODO: remove this constructor once legacy subscriptions are removed. + /// + /// + /// + /// + /// + internal SubscriptionHandle(IDbConnection conn, SubscriptionBuilder.Callback? onApplied, string[] querySqls) + { + state = new SubscriptionState.Pending(new()); + this.conn = conn; + this.onApplied = onApplied; + conn.LegacySubscribe(this, querySqls); + } + + /// + /// Construct a subscription handle. + /// + /// + /// + /// + /// + internal SubscriptionHandle(IDbConnection conn, SubscriptionBuilder.Callback? onApplied, SubscriptionBuilder.Callback? onError, string querySql) + { + state = new SubscriptionState.Pending(new()); + this.onApplied = onApplied; + this.onError = onError; + this.conn = conn; + conn.Subscribe(this, querySql); + } + + /// + /// Unsubscribe from the query controlled by this subscription handle. + /// + /// Calling this more than once will result in an exception. + /// + public void Unsubscribe() + { + UnsubscribeThen(null); + } + + /// + /// Unsubscribe from the query controlled by this subscription handle, + /// and call onEnded when its rows are removed from the client cache. + /// + public void UnsubscribeThen(SubscriptionBuilder.Callback? onEnded) + { + if (state is not SubscriptionState.Active) + { + throw new Exception("Cannot unsubscribe from inactive subscription."); + } + if (onEnded != null) + { + // TODO: should we just log here instead? Do we try not to throw exceptions on the main thread? + throw new Exception("Unsubscribe already called."); + } + this.onEnded = onEnded; + } + } +} diff --git a/src/Event.cs.meta b/src/Event.cs.meta new file mode 100644 index 000000000..c1de34211 --- /dev/null +++ b/src/Event.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3c8f2bbd66a24c0f8710b2825daeba1d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/src/ISpacetimeDBLogger.cs b/src/ISpacetimeDBLogger.cs new file mode 100644 index 000000000..e8f01cecf --- /dev/null +++ b/src/ISpacetimeDBLogger.cs @@ -0,0 +1,34 @@ +using System; + +namespace SpacetimeDB +{ + internal interface ISpacetimeDBLogger + { + void Debug(string message); + void Trace(string message); + void Info(string message); + void Warn(string message); + void Error(string message); + void Exception(string message); + void Exception(Exception e); + } + + public static class Log + { + internal static ISpacetimeDBLogger Current = + +#if UNITY_5_3_OR_NEWER + new UnityDebugLogger(); +#else + new ConsoleLogger(); +#endif + + public static void Debug(string message) => Current.Debug(message); + public static void Trace(string message) => Current.Trace(message); + public static void Info(string message) => Current.Info(message); + public static void Warn(string message) => Current.Warn(message); + public static void Error(string message) => Current.Error(message); + public static void Exception(string message) => Current.Exception(message); + public static void Exception(Exception exception) => Current.Exception(exception); + } +} diff --git a/src/ISpacetimeDBLogger.cs.meta b/src/ISpacetimeDBLogger.cs.meta new file mode 100644 index 000000000..bbf891617 --- /dev/null +++ b/src/ISpacetimeDBLogger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fd7303290d31f364da7f532d52cf4914 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/SpacetimeDB.meta b/src/SpacetimeDB.meta similarity index 77% rename from Assets/SpacetimeDB.meta rename to src/SpacetimeDB.meta index 5dc6b0124..e4ed673ed 100644 --- a/Assets/SpacetimeDB.meta +++ b/src/SpacetimeDB.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8c3f00f56e2ad68e986763d9f99b3e1d +guid: 928ddcef9e2fb2d579b8f3558f353913 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/src/SpacetimeDB/ClientApi.meta b/src/SpacetimeDB/ClientApi.meta new file mode 100644 index 000000000..5729181e6 --- /dev/null +++ b/src/SpacetimeDB/ClientApi.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 379cf01a10bd1b3a3999d7a07370ad1a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/BsatnRowList.cs b/src/SpacetimeDB/ClientApi/BsatnRowList.cs new file mode 100644 index 000000000..f284ff71a --- /dev/null +++ b/src/SpacetimeDB/ClientApi/BsatnRowList.cs @@ -0,0 +1,39 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class BsatnRowList + { + [DataMember(Name = "size_hint")] + public SpacetimeDB.ClientApi.RowSizeHint SizeHint; + [DataMember(Name = "rows_data")] + public System.Collections.Generic.List RowsData; + + public BsatnRowList( + SpacetimeDB.ClientApi.RowSizeHint SizeHint, + System.Collections.Generic.List RowsData + ) + { + this.SizeHint = SizeHint; + this.RowsData = RowsData; + } + + public BsatnRowList() + { + this.SizeHint = null!; + this.RowsData = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/BsatnRowList.cs.meta b/src/SpacetimeDB/ClientApi/BsatnRowList.cs.meta new file mode 100644 index 000000000..95ec13f6d --- /dev/null +++ b/src/SpacetimeDB/ClientApi/BsatnRowList.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3736538171ef3574f914e9e880b67a03 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/CallReducer.cs b/src/SpacetimeDB/ClientApi/CallReducer.cs new file mode 100644 index 000000000..e2ffc881b --- /dev/null +++ b/src/SpacetimeDB/ClientApi/CallReducer.cs @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class CallReducer + { + [DataMember(Name = "reducer")] + public string Reducer; + [DataMember(Name = "args")] + public System.Collections.Generic.List Args; + [DataMember(Name = "request_id")] + public uint RequestId; + [DataMember(Name = "flags")] + public byte Flags; + + public CallReducer( + string Reducer, + System.Collections.Generic.List Args, + uint RequestId, + byte Flags + ) + { + this.Reducer = Reducer; + this.Args = Args; + this.RequestId = RequestId; + this.Flags = Flags; + } + + public CallReducer() + { + this.Reducer = ""; + this.Args = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/CallReducer.cs.meta b/src/SpacetimeDB/ClientApi/CallReducer.cs.meta new file mode 100644 index 000000000..26b819171 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/CallReducer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e26014e7433b503568d0655b46744c4c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/ClientMessage.cs b/src/SpacetimeDB/ClientApi/ClientMessage.cs new file mode 100644 index 000000000..d35135f95 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/ClientMessage.cs @@ -0,0 +1,20 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + public partial record ClientMessage : SpacetimeDB.TaggedEnum<( + SpacetimeDB.ClientApi.CallReducer CallReducer, + SpacetimeDB.ClientApi.Subscribe Subscribe, + SpacetimeDB.ClientApi.OneOffQuery OneOffQuery, + SpacetimeDB.ClientApi.SubscribeSingle SubscribeSingle, + SpacetimeDB.ClientApi.Unsubscribe Unsubscribe + )>; +} diff --git a/src/SpacetimeDB/ClientApi/ClientMessage.cs.meta b/src/SpacetimeDB/ClientApi/ClientMessage.cs.meta new file mode 100644 index 000000000..093e2ff4c --- /dev/null +++ b/src/SpacetimeDB/ClientApi/ClientMessage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4a952c2bbd0c02cc4a8d919c409500f2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/CompressableQueryUpdate.cs b/src/SpacetimeDB/ClientApi/CompressableQueryUpdate.cs new file mode 100644 index 000000000..0fc85f50a --- /dev/null +++ b/src/SpacetimeDB/ClientApi/CompressableQueryUpdate.cs @@ -0,0 +1,18 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + public partial record CompressableQueryUpdate : SpacetimeDB.TaggedEnum<( + SpacetimeDB.ClientApi.QueryUpdate Uncompressed, + System.Collections.Generic.List Brotli, + System.Collections.Generic.List Gzip + )>; +} diff --git a/src/SpacetimeDB/ClientApi/CompressableQueryUpdate.cs.meta b/src/SpacetimeDB/ClientApi/CompressableQueryUpdate.cs.meta new file mode 100644 index 000000000..486b1dd8d --- /dev/null +++ b/src/SpacetimeDB/ClientApi/CompressableQueryUpdate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fa7fc0d9632450b47a0d88960f28e66a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/DatabaseUpdate.cs b/src/SpacetimeDB/ClientApi/DatabaseUpdate.cs new file mode 100644 index 000000000..7b28c94be --- /dev/null +++ b/src/SpacetimeDB/ClientApi/DatabaseUpdate.cs @@ -0,0 +1,32 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class DatabaseUpdate + { + [DataMember(Name = "tables")] + public System.Collections.Generic.List Tables; + + public DatabaseUpdate(System.Collections.Generic.List Tables) + { + this.Tables = Tables; + } + + public DatabaseUpdate() + { + this.Tables = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/DatabaseUpdate.cs.meta b/src/SpacetimeDB/ClientApi/DatabaseUpdate.cs.meta new file mode 100644 index 000000000..d05709fa7 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/DatabaseUpdate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93a2faf8f0503454bbd2c924554997f6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/EnergyQuanta.cs b/src/SpacetimeDB/ClientApi/EnergyQuanta.cs new file mode 100644 index 000000000..e38a46b5b --- /dev/null +++ b/src/SpacetimeDB/ClientApi/EnergyQuanta.cs @@ -0,0 +1,31 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class EnergyQuanta + { + [DataMember(Name = "quanta")] + public U128 Quanta; + + public EnergyQuanta(U128 Quanta) + { + this.Quanta = Quanta; + } + + public EnergyQuanta() + { + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/EnergyQuanta.cs.meta b/src/SpacetimeDB/ClientApi/EnergyQuanta.cs.meta new file mode 100644 index 000000000..ae82b6330 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/EnergyQuanta.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1deb421d0aa8a992aaf03a2dff20add4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/IdentityToken.cs b/src/SpacetimeDB/ClientApi/IdentityToken.cs new file mode 100644 index 000000000..751fcd751 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/IdentityToken.cs @@ -0,0 +1,44 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class IdentityToken + { + [DataMember(Name = "identity")] + public SpacetimeDB.Identity Identity; + [DataMember(Name = "token")] + public string Token; + [DataMember(Name = "address")] + public SpacetimeDB.Address Address; + + public IdentityToken( + SpacetimeDB.Identity Identity, + string Token, + SpacetimeDB.Address Address + ) + { + this.Identity = Identity; + this.Token = Token; + this.Address = Address; + } + + public IdentityToken() + { + this.Identity = new(); + this.Token = ""; + this.Address = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/IdentityToken.cs.meta b/src/SpacetimeDB/ClientApi/IdentityToken.cs.meta new file mode 100644 index 000000000..dd823c173 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/IdentityToken.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3afecf9b6bdbec44a9638de844018831 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/InitialSubscription.cs b/src/SpacetimeDB/ClientApi/InitialSubscription.cs new file mode 100644 index 000000000..c61441013 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/InitialSubscription.cs @@ -0,0 +1,42 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class InitialSubscription + { + [DataMember(Name = "database_update")] + public SpacetimeDB.ClientApi.DatabaseUpdate DatabaseUpdate; + [DataMember(Name = "request_id")] + public uint RequestId; + [DataMember(Name = "total_host_execution_duration_micros")] + public ulong TotalHostExecutionDurationMicros; + + public InitialSubscription( + SpacetimeDB.ClientApi.DatabaseUpdate DatabaseUpdate, + uint RequestId, + ulong TotalHostExecutionDurationMicros + ) + { + this.DatabaseUpdate = DatabaseUpdate; + this.RequestId = RequestId; + this.TotalHostExecutionDurationMicros = TotalHostExecutionDurationMicros; + } + + public InitialSubscription() + { + this.DatabaseUpdate = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/InitialSubscription.cs.meta b/src/SpacetimeDB/ClientApi/InitialSubscription.cs.meta new file mode 100644 index 000000000..3c199551d --- /dev/null +++ b/src/SpacetimeDB/ClientApi/InitialSubscription.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 164675d4073454c7486c6633c9aff306 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/OneOffQuery.cs b/src/SpacetimeDB/ClientApi/OneOffQuery.cs new file mode 100644 index 000000000..58766deda --- /dev/null +++ b/src/SpacetimeDB/ClientApi/OneOffQuery.cs @@ -0,0 +1,39 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class OneOffQuery + { + [DataMember(Name = "message_id")] + public System.Collections.Generic.List MessageId; + [DataMember(Name = "query_string")] + public string QueryString; + + public OneOffQuery( + System.Collections.Generic.List MessageId, + string QueryString + ) + { + this.MessageId = MessageId; + this.QueryString = QueryString; + } + + public OneOffQuery() + { + this.MessageId = new(); + this.QueryString = ""; + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/OneOffQuery.cs.meta b/src/SpacetimeDB/ClientApi/OneOffQuery.cs.meta new file mode 100644 index 000000000..cf88bb971 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/OneOffQuery.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 69eedb692f165b0c68dc2e5ccb4269a5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/OneOffQueryResponse.cs b/src/SpacetimeDB/ClientApi/OneOffQueryResponse.cs new file mode 100644 index 000000000..a39b3fe1a --- /dev/null +++ b/src/SpacetimeDB/ClientApi/OneOffQueryResponse.cs @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class OneOffQueryResponse + { + [DataMember(Name = "message_id")] + public System.Collections.Generic.List MessageId; + [DataMember(Name = "error")] + public string? Error; + [DataMember(Name = "tables")] + public System.Collections.Generic.List Tables; + [DataMember(Name = "total_host_execution_duration_micros")] + public ulong TotalHostExecutionDurationMicros; + + public OneOffQueryResponse( + System.Collections.Generic.List MessageId, + string? Error, + System.Collections.Generic.List Tables, + ulong TotalHostExecutionDurationMicros + ) + { + this.MessageId = MessageId; + this.Error = Error; + this.Tables = Tables; + this.TotalHostExecutionDurationMicros = TotalHostExecutionDurationMicros; + } + + public OneOffQueryResponse() + { + this.MessageId = new(); + this.Tables = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/OneOffQueryResponse.cs.meta b/src/SpacetimeDB/ClientApi/OneOffQueryResponse.cs.meta new file mode 100644 index 000000000..fe687a2d4 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/OneOffQueryResponse.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 628b6232147f7f844ad8aab9929e2f07 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/OneOffTable.cs b/src/SpacetimeDB/ClientApi/OneOffTable.cs new file mode 100644 index 000000000..fe667b18a --- /dev/null +++ b/src/SpacetimeDB/ClientApi/OneOffTable.cs @@ -0,0 +1,39 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class OneOffTable + { + [DataMember(Name = "table_name")] + public string TableName; + [DataMember(Name = "rows")] + public SpacetimeDB.ClientApi.BsatnRowList Rows; + + public OneOffTable( + string TableName, + SpacetimeDB.ClientApi.BsatnRowList Rows + ) + { + this.TableName = TableName; + this.Rows = Rows; + } + + public OneOffTable() + { + this.TableName = ""; + this.Rows = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/OneOffTable.cs.meta b/src/SpacetimeDB/ClientApi/OneOffTable.cs.meta new file mode 100644 index 000000000..f470acb47 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/OneOffTable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 998830667e639b1999a45be570b59e9b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/QueryId.cs b/src/SpacetimeDB/ClientApi/QueryId.cs new file mode 100644 index 000000000..07ca5419a --- /dev/null +++ b/src/SpacetimeDB/ClientApi/QueryId.cs @@ -0,0 +1,31 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class QueryId + { + [DataMember(Name = "id")] + public uint Id; + + public QueryId(uint Id) + { + this.Id = Id; + } + + public QueryId() + { + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/QueryId.cs.meta b/src/SpacetimeDB/ClientApi/QueryId.cs.meta new file mode 100644 index 000000000..392536c1e --- /dev/null +++ b/src/SpacetimeDB/ClientApi/QueryId.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5839c57344b5d64e74c4564ffb7d92f7 +MonoImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/src/SpacetimeDB/ClientApi/QueryUpdate.cs b/src/SpacetimeDB/ClientApi/QueryUpdate.cs new file mode 100644 index 000000000..25acc28e7 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/QueryUpdate.cs @@ -0,0 +1,39 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class QueryUpdate + { + [DataMember(Name = "deletes")] + public SpacetimeDB.ClientApi.BsatnRowList Deletes; + [DataMember(Name = "inserts")] + public SpacetimeDB.ClientApi.BsatnRowList Inserts; + + public QueryUpdate( + SpacetimeDB.ClientApi.BsatnRowList Deletes, + SpacetimeDB.ClientApi.BsatnRowList Inserts + ) + { + this.Deletes = Deletes; + this.Inserts = Inserts; + } + + public QueryUpdate() + { + this.Deletes = new(); + this.Inserts = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/QueryUpdate.cs.meta b/src/SpacetimeDB/ClientApi/QueryUpdate.cs.meta new file mode 100644 index 000000000..ee9369dd8 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/QueryUpdate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d989a072d0ab7664ea89ce118d38d8a5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/ReducerCallInfo.cs b/src/SpacetimeDB/ClientApi/ReducerCallInfo.cs new file mode 100644 index 000000000..ba12f1534 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/ReducerCallInfo.cs @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class ReducerCallInfo + { + [DataMember(Name = "reducer_name")] + public string ReducerName; + [DataMember(Name = "reducer_id")] + public uint ReducerId; + [DataMember(Name = "args")] + public System.Collections.Generic.List Args; + [DataMember(Name = "request_id")] + public uint RequestId; + + public ReducerCallInfo( + string ReducerName, + uint ReducerId, + System.Collections.Generic.List Args, + uint RequestId + ) + { + this.ReducerName = ReducerName; + this.ReducerId = ReducerId; + this.Args = Args; + this.RequestId = RequestId; + } + + public ReducerCallInfo() + { + this.ReducerName = ""; + this.Args = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/ReducerCallInfo.cs.meta b/src/SpacetimeDB/ClientApi/ReducerCallInfo.cs.meta new file mode 100644 index 000000000..4713aefe9 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/ReducerCallInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3eb44d3c073528b9b95219f6d4a735c9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/RowSizeHint.cs b/src/SpacetimeDB/ClientApi/RowSizeHint.cs new file mode 100644 index 000000000..71c04c1b9 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/RowSizeHint.cs @@ -0,0 +1,17 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + public partial record RowSizeHint : SpacetimeDB.TaggedEnum<( + ushort FixedSize, + System.Collections.Generic.List RowOffsets + )>; +} diff --git a/src/SpacetimeDB/ClientApi/RowSizeHint.cs.meta b/src/SpacetimeDB/ClientApi/RowSizeHint.cs.meta new file mode 100644 index 000000000..7b7754112 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/RowSizeHint.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a21b01e7a4f857a469aa9181dececc57 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/ServerMessage.cs b/src/SpacetimeDB/ClientApi/ServerMessage.cs new file mode 100644 index 000000000..bcab7a767 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/ServerMessage.cs @@ -0,0 +1,23 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + public partial record ServerMessage : SpacetimeDB.TaggedEnum<( + SpacetimeDB.ClientApi.InitialSubscription InitialSubscription, + SpacetimeDB.ClientApi.TransactionUpdate TransactionUpdate, + SpacetimeDB.ClientApi.TransactionUpdateLight TransactionUpdateLight, + SpacetimeDB.ClientApi.IdentityToken IdentityToken, + SpacetimeDB.ClientApi.OneOffQueryResponse OneOffQueryResponse, + SpacetimeDB.ClientApi.SubscribeApplied SubscribeApplied, + SpacetimeDB.ClientApi.UnsubscribeApplied UnsubscribeApplied, + SpacetimeDB.ClientApi.SubscriptionError SubscriptionError + )>; +} diff --git a/src/SpacetimeDB/ClientApi/ServerMessage.cs.meta b/src/SpacetimeDB/ClientApi/ServerMessage.cs.meta new file mode 100644 index 000000000..f52cc6b3f --- /dev/null +++ b/src/SpacetimeDB/ClientApi/ServerMessage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 771b9bdf36469247088207291d9a6f59 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/Subscribe.cs b/src/SpacetimeDB/ClientApi/Subscribe.cs new file mode 100644 index 000000000..c58f1a465 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/Subscribe.cs @@ -0,0 +1,38 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class Subscribe + { + [DataMember(Name = "query_strings")] + public System.Collections.Generic.List QueryStrings; + [DataMember(Name = "request_id")] + public uint RequestId; + + public Subscribe( + System.Collections.Generic.List QueryStrings, + uint RequestId + ) + { + this.QueryStrings = QueryStrings; + this.RequestId = RequestId; + } + + public Subscribe() + { + this.QueryStrings = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/Subscribe.cs.meta b/src/SpacetimeDB/ClientApi/Subscribe.cs.meta new file mode 100644 index 000000000..bd51967be --- /dev/null +++ b/src/SpacetimeDB/ClientApi/Subscribe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 11084f5a0b2e1ca908fe4e98cc76c79a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/SubscribeApplied.cs b/src/SpacetimeDB/ClientApi/SubscribeApplied.cs new file mode 100644 index 000000000..440ef4ca0 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/SubscribeApplied.cs @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class SubscribeApplied + { + [DataMember(Name = "request_id")] + public uint RequestId; + [DataMember(Name = "total_host_execution_duration_micros")] + public ulong TotalHostExecutionDurationMicros; + [DataMember(Name = "query_id")] + public SpacetimeDB.ClientApi.QueryId QueryId; + [DataMember(Name = "rows")] + public SpacetimeDB.ClientApi.SubscribeRows Rows; + + public SubscribeApplied( + uint RequestId, + ulong TotalHostExecutionDurationMicros, + SpacetimeDB.ClientApi.QueryId QueryId, + SpacetimeDB.ClientApi.SubscribeRows Rows + ) + { + this.RequestId = RequestId; + this.TotalHostExecutionDurationMicros = TotalHostExecutionDurationMicros; + this.QueryId = QueryId; + this.Rows = Rows; + } + + public SubscribeApplied() + { + this.QueryId = new(); + this.Rows = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/SubscribeApplied.cs.meta b/src/SpacetimeDB/ClientApi/SubscribeApplied.cs.meta new file mode 100644 index 000000000..b343d062d --- /dev/null +++ b/src/SpacetimeDB/ClientApi/SubscribeApplied.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c99e14f23b6036cd7de97be2069db72e +MonoImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/src/SpacetimeDB/ClientApi/SubscribeRows.cs b/src/SpacetimeDB/ClientApi/SubscribeRows.cs new file mode 100644 index 000000000..dffee90c4 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/SubscribeRows.cs @@ -0,0 +1,43 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class SubscribeRows + { + [DataMember(Name = "table_id")] + public uint TableId; + [DataMember(Name = "table_name")] + public string TableName; + [DataMember(Name = "table_rows")] + public SpacetimeDB.ClientApi.TableUpdate TableRows; + + public SubscribeRows( + uint TableId, + string TableName, + SpacetimeDB.ClientApi.TableUpdate TableRows + ) + { + this.TableId = TableId; + this.TableName = TableName; + this.TableRows = TableRows; + } + + public SubscribeRows() + { + this.TableName = ""; + this.TableRows = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/SubscribeRows.cs.meta b/src/SpacetimeDB/ClientApi/SubscribeRows.cs.meta new file mode 100644 index 000000000..378eac715 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/SubscribeRows.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3a92d1b128da222eb02e454367e4975b +MonoImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/src/SpacetimeDB/ClientApi/SubscribeSingle.cs b/src/SpacetimeDB/ClientApi/SubscribeSingle.cs new file mode 100644 index 000000000..5df6f3d7a --- /dev/null +++ b/src/SpacetimeDB/ClientApi/SubscribeSingle.cs @@ -0,0 +1,43 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class SubscribeSingle + { + [DataMember(Name = "query")] + public string Query; + [DataMember(Name = "request_id")] + public uint RequestId; + [DataMember(Name = "query_id")] + public SpacetimeDB.ClientApi.QueryId QueryId; + + public SubscribeSingle( + string Query, + uint RequestId, + SpacetimeDB.ClientApi.QueryId QueryId + ) + { + this.Query = Query; + this.RequestId = RequestId; + this.QueryId = QueryId; + } + + public SubscribeSingle() + { + this.Query = ""; + this.QueryId = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/SubscribeSingle.cs.meta b/src/SpacetimeDB/ClientApi/SubscribeSingle.cs.meta new file mode 100644 index 000000000..73c9c34fe --- /dev/null +++ b/src/SpacetimeDB/ClientApi/SubscribeSingle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c60bb4c52fbbd0232497865777d0d702 +MonoImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/src/SpacetimeDB/ClientApi/SubscriptionError.cs b/src/SpacetimeDB/ClientApi/SubscriptionError.cs new file mode 100644 index 000000000..249f89914 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/SubscriptionError.cs @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class SubscriptionError + { + [DataMember(Name = "total_host_execution_duration_micros")] + public ulong TotalHostExecutionDurationMicros; + [DataMember(Name = "request_id")] + public uint? RequestId; + [DataMember(Name = "query_id")] + public uint? QueryId; + [DataMember(Name = "table_id")] + public uint? TableId; + [DataMember(Name = "error")] + public string Error; + + public SubscriptionError( + ulong TotalHostExecutionDurationMicros, + uint? RequestId, + uint? QueryId, + uint? TableId, + string Error + ) + { + this.TotalHostExecutionDurationMicros = TotalHostExecutionDurationMicros; + this.RequestId = RequestId; + this.QueryId = QueryId; + this.TableId = TableId; + this.Error = Error; + } + + public SubscriptionError() + { + this.Error = ""; + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/SubscriptionError.cs.meta b/src/SpacetimeDB/ClientApi/SubscriptionError.cs.meta new file mode 100644 index 000000000..fba50ff68 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/SubscriptionError.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2ddffc0192386ada178b6d140274dfc8 +MonoImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/src/SpacetimeDB/ClientApi/TableUpdate.cs b/src/SpacetimeDB/ClientApi/TableUpdate.cs new file mode 100644 index 000000000..d3265065d --- /dev/null +++ b/src/SpacetimeDB/ClientApi/TableUpdate.cs @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class TableUpdate + { + [DataMember(Name = "table_id")] + public uint TableId; + [DataMember(Name = "table_name")] + public string TableName; + [DataMember(Name = "num_rows")] + public ulong NumRows; + [DataMember(Name = "updates")] + public System.Collections.Generic.List Updates; + + public TableUpdate( + uint TableId, + string TableName, + ulong NumRows, + System.Collections.Generic.List Updates + ) + { + this.TableId = TableId; + this.TableName = TableName; + this.NumRows = NumRows; + this.Updates = Updates; + } + + public TableUpdate() + { + this.TableName = ""; + this.Updates = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/TableUpdate.cs.meta b/src/SpacetimeDB/ClientApi/TableUpdate.cs.meta new file mode 100644 index 000000000..44d124f89 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/TableUpdate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: afe8988a93d28cd3fa95af39bde02f9d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/Timestamp.cs b/src/SpacetimeDB/ClientApi/Timestamp.cs new file mode 100644 index 000000000..27cfa7da9 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/Timestamp.cs @@ -0,0 +1,31 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class Timestamp + { + [DataMember(Name = "microseconds")] + public ulong Microseconds; + + public Timestamp(ulong Microseconds) + { + this.Microseconds = Microseconds; + } + + public Timestamp() + { + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/Timestamp.cs.meta b/src/SpacetimeDB/ClientApi/Timestamp.cs.meta new file mode 100644 index 000000000..94af80d6c --- /dev/null +++ b/src/SpacetimeDB/ClientApi/Timestamp.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 145b8ed3026f531488ee5400d4cb8894 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/TransactionUpdate.cs b/src/SpacetimeDB/ClientApi/TransactionUpdate.cs new file mode 100644 index 000000000..d2c349ce8 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/TransactionUpdate.cs @@ -0,0 +1,63 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class TransactionUpdate + { + [DataMember(Name = "status")] + public SpacetimeDB.ClientApi.UpdateStatus Status; + [DataMember(Name = "timestamp")] + public SpacetimeDB.ClientApi.Timestamp Timestamp; + [DataMember(Name = "caller_identity")] + public SpacetimeDB.Identity CallerIdentity; + [DataMember(Name = "caller_address")] + public SpacetimeDB.Address CallerAddress; + [DataMember(Name = "reducer_call")] + public SpacetimeDB.ClientApi.ReducerCallInfo ReducerCall; + [DataMember(Name = "energy_quanta_used")] + public SpacetimeDB.ClientApi.EnergyQuanta EnergyQuantaUsed; + [DataMember(Name = "host_execution_duration_micros")] + public ulong HostExecutionDurationMicros; + + public TransactionUpdate( + SpacetimeDB.ClientApi.UpdateStatus Status, + SpacetimeDB.ClientApi.Timestamp Timestamp, + SpacetimeDB.Identity CallerIdentity, + SpacetimeDB.Address CallerAddress, + SpacetimeDB.ClientApi.ReducerCallInfo ReducerCall, + SpacetimeDB.ClientApi.EnergyQuanta EnergyQuantaUsed, + ulong HostExecutionDurationMicros + ) + { + this.Status = Status; + this.Timestamp = Timestamp; + this.CallerIdentity = CallerIdentity; + this.CallerAddress = CallerAddress; + this.ReducerCall = ReducerCall; + this.EnergyQuantaUsed = EnergyQuantaUsed; + this.HostExecutionDurationMicros = HostExecutionDurationMicros; + } + + public TransactionUpdate() + { + this.Status = null!; + this.Timestamp = new(); + this.CallerIdentity = new(); + this.CallerAddress = new(); + this.ReducerCall = new(); + this.EnergyQuantaUsed = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/TransactionUpdate.cs.meta b/src/SpacetimeDB/ClientApi/TransactionUpdate.cs.meta new file mode 100644 index 000000000..37c72e6a1 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/TransactionUpdate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 08a42b1306e38dfddbcb0c0fcfc16acf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/TransactionUpdateLight.cs b/src/SpacetimeDB/ClientApi/TransactionUpdateLight.cs new file mode 100644 index 000000000..3a3ea6b58 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/TransactionUpdateLight.cs @@ -0,0 +1,38 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class TransactionUpdateLight + { + [DataMember(Name = "request_id")] + public uint RequestId; + [DataMember(Name = "update")] + public SpacetimeDB.ClientApi.DatabaseUpdate Update; + + public TransactionUpdateLight( + uint RequestId, + SpacetimeDB.ClientApi.DatabaseUpdate Update + ) + { + this.RequestId = RequestId; + this.Update = Update; + } + + public TransactionUpdateLight() + { + this.Update = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/TransactionUpdateLight.cs.meta b/src/SpacetimeDB/ClientApi/TransactionUpdateLight.cs.meta new file mode 100644 index 000000000..50cff86d4 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/TransactionUpdateLight.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: de607af1bdc1244f894fb952d4199473 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDB/ClientApi/Unsubscribe.cs b/src/SpacetimeDB/ClientApi/Unsubscribe.cs new file mode 100644 index 000000000..b6fe8d01c --- /dev/null +++ b/src/SpacetimeDB/ClientApi/Unsubscribe.cs @@ -0,0 +1,38 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class Unsubscribe + { + [DataMember(Name = "request_id")] + public uint RequestId; + [DataMember(Name = "query_id")] + public SpacetimeDB.ClientApi.QueryId QueryId; + + public Unsubscribe( + uint RequestId, + SpacetimeDB.ClientApi.QueryId QueryId + ) + { + this.RequestId = RequestId; + this.QueryId = QueryId; + } + + public Unsubscribe() + { + this.QueryId = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/Unsubscribe.cs.meta b/src/SpacetimeDB/ClientApi/Unsubscribe.cs.meta new file mode 100644 index 000000000..c825ecddb --- /dev/null +++ b/src/SpacetimeDB/ClientApi/Unsubscribe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: afdaf1dde5b73fdb44b7b0e967166a43 +MonoImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/src/SpacetimeDB/ClientApi/UnsubscribeApplied.cs b/src/SpacetimeDB/ClientApi/UnsubscribeApplied.cs new file mode 100644 index 000000000..26832e7cf --- /dev/null +++ b/src/SpacetimeDB/ClientApi/UnsubscribeApplied.cs @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + [DataContract] + public partial class UnsubscribeApplied + { + [DataMember(Name = "request_id")] + public uint RequestId; + [DataMember(Name = "total_host_execution_duration_micros")] + public ulong TotalHostExecutionDurationMicros; + [DataMember(Name = "query_id")] + public SpacetimeDB.ClientApi.QueryId QueryId; + [DataMember(Name = "rows")] + public SpacetimeDB.ClientApi.SubscribeRows Rows; + + public UnsubscribeApplied( + uint RequestId, + ulong TotalHostExecutionDurationMicros, + SpacetimeDB.ClientApi.QueryId QueryId, + SpacetimeDB.ClientApi.SubscribeRows Rows + ) + { + this.RequestId = RequestId; + this.TotalHostExecutionDurationMicros = TotalHostExecutionDurationMicros; + this.QueryId = QueryId; + this.Rows = Rows; + } + + public UnsubscribeApplied() + { + this.QueryId = new(); + this.Rows = new(); + } + + } +} diff --git a/src/SpacetimeDB/ClientApi/UnsubscribeApplied.cs.meta b/src/SpacetimeDB/ClientApi/UnsubscribeApplied.cs.meta new file mode 100644 index 000000000..668cf4783 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/UnsubscribeApplied.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a958bf68ea209aafda05cf9222cb3639 +MonoImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} diff --git a/src/SpacetimeDB/ClientApi/UpdateStatus.cs b/src/SpacetimeDB/ClientApi/UpdateStatus.cs new file mode 100644 index 000000000..b788434e9 --- /dev/null +++ b/src/SpacetimeDB/ClientApi/UpdateStatus.cs @@ -0,0 +1,18 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. +// + +#nullable enable + +using System; +using SpacetimeDB; + +namespace SpacetimeDB.ClientApi +{ + [SpacetimeDB.Type] + public partial record UpdateStatus : SpacetimeDB.TaggedEnum<( + SpacetimeDB.ClientApi.DatabaseUpdate Committed, + string Failed, + SpacetimeDB.Unit OutOfEnergy + )>; +} diff --git a/src/SpacetimeDB/ClientApi/UpdateStatus.cs.meta b/src/SpacetimeDB/ClientApi/UpdateStatus.cs.meta new file mode 100644 index 000000000..ea414a49c --- /dev/null +++ b/src/SpacetimeDB/ClientApi/UpdateStatus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2afa3ef5001b6d1439ec004b3956d887 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDBClient.cs b/src/SpacetimeDBClient.cs new file mode 100644 index 000000000..5ca2e9384 --- /dev/null +++ b/src/SpacetimeDBClient.cs @@ -0,0 +1,1159 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.IO.Compression; +using System.Linq; +using System.Net.WebSockets; +using System.Threading; +using System.Threading.Tasks; +using SpacetimeDB.BSATN; +using SpacetimeDB.Internal; +using SpacetimeDB.ClientApi; +using Thread = System.Threading.Thread; + +namespace SpacetimeDB +{ + public sealed class DbConnectionBuilder + where DbConnection : DbConnectionBase, new() + { + readonly DbConnection conn = new(); + + string? uri; + string? nameOrAddress; + string? token; + Compression? compression; + bool light; + + public DbConnection Build() + { + if (uri == null) + { + throw new InvalidOperationException("Building DbConnection with a null uri. Call WithUri() first."); + } + if (nameOrAddress == null) + { + throw new InvalidOperationException("Building DbConnection with a null nameOrAddress. Call WithModuleName() first."); + } + conn.Connect(token, uri, nameOrAddress, compression ?? Compression.Brotli, light); +#if UNITY_5_3_OR_NEWER + if (SpacetimeDBNetworkManager._instance != null) + { + SpacetimeDBNetworkManager._instance.AddConnection(conn); + } +#endif + return conn; + } + + public DbConnectionBuilder WithUri(string uri) + { + this.uri = uri; + return this; + } + + public DbConnectionBuilder WithModuleName(string nameOrAddress) + { + this.nameOrAddress = nameOrAddress; + return this; + } + + public DbConnectionBuilder WithToken(string? token) + { + this.token = token; + return this; + } + + public DbConnectionBuilder WithCompression(Compression compression) + { + this.compression = compression; + return this; + } + + public DbConnectionBuilder WithLightMode(bool light) + { + this.light = light; + return this; + } + + public delegate void ConnectCallback(DbConnection conn, Identity identity, string token); + + public DbConnectionBuilder OnConnect(ConnectCallback cb) + { + conn.onConnect += (identity, token) => cb.Invoke(conn, identity, token); + return this; + } + + public delegate void ConnectErrorCallback(Exception e); + + public DbConnectionBuilder OnConnectError(ConnectErrorCallback cb) + { + conn.webSocket.OnConnectError += (e) => cb.Invoke(e); + return this; + } + + public delegate void DisconnectCallback(DbConnection conn, Exception? e); + + public DbConnectionBuilder OnDisconnect(DisconnectCallback cb) + { + conn.webSocket.OnClose += (e) => cb.Invoke(conn, e); + return this; + } + } + + public interface IDbConnection + { + internal void LegacySubscribe(ISubscriptionHandle handle, string[] querySqls); + internal void Subscribe(ISubscriptionHandle handle, string querySql); + internal void Unsubscribe(QueryId queryId); + void FrameTick(); + void Disconnect(); + + internal Task RemoteQuery(string query) where T : IDatabaseRow, new(); + } + + public abstract class DbConnectionBase : IDbConnection + where DbConnection : DbConnectionBase, new() + { + public static DbConnectionBuilder Builder() => new(); + + readonly struct DbValue + { + public readonly IDatabaseRow value; + public readonly byte[] bytes; + + public DbValue(IDatabaseRow value, byte[] bytes) + { + this.value = value; + this.bytes = bytes; + } + } + + struct DbOp + { + public IRemoteTableHandle table; + public DbValue? delete; + public DbValue? insert; + } + + internal event Action? onConnect; + + /// + /// Called when an exception occurs when sending a message. + /// + [Obsolete] + public event Action? onSendError; + + /// + /// Dictionary of legacy subscriptions, keyed by request ID rather than query ID. + /// Only used for `SubscribeToAllTables()`. + /// + private readonly Dictionary legacySubscriptions = new(); + + /// + /// Dictionary of subscriptions, keyed by query ID. + /// + private readonly Dictionary subscriptions = new(); + + /// + /// Allocates query IDs. + /// + private UintAllocator queryIdAllocator; + + /// + /// Invoked when a reducer is returned with an error and has no client-side handler. + /// + [Obsolete] + public event Action>? onUnhandledReducerError; + + public readonly Address Address = Address.Random(); + public Identity? Identity { get; private set; } + + internal WebSocket webSocket; + private bool connectionClosed; + protected readonly ClientCache clientDB; + + protected abstract Reducer ToReducer(TransactionUpdate update); + protected abstract IEventContext ToEventContext(Event reducerEvent); + + private readonly Dictionary> waitingOneOffQueries = new(); + + private bool isClosing; + private readonly Thread networkMessageProcessThread; + public readonly Stats stats = new(); + + protected DbConnectionBase() + { + clientDB = new(this); + + var options = new WebSocket.ConnectOptions + { + //v1.bin.spacetimedb + //v1.text.spacetimedb + Protocol = "v1.bsatn.spacetimedb" + }; + webSocket = new WebSocket(options); + webSocket.OnMessage += OnMessageReceived; + webSocket.OnSendError += a => onSendError?.Invoke(a); +#if UNITY_5_3_OR_NEWER + webSocket.OnClose += (e) => + { + if (SpacetimeDBNetworkManager._instance != null) + { + SpacetimeDBNetworkManager._instance.RemoveConnection(this); + } + }; +#endif + + networkMessageProcessThread = new Thread(PreProcessMessages); + networkMessageProcessThread.Start(); + } + + struct UnprocessedMessage + { + public byte[] bytes; + public DateTime timestamp; + } + + struct ProcessedMessage + { + public ServerMessage message; + public List dbOps; + public DateTime timestamp; + public ReducerEvent? reducerEvent; + } + + struct PreProcessedMessage + { + public ProcessedMessage processed; + public Dictionary>? subscriptionInserts; + } + + private readonly BlockingCollection _messageQueue = + new(new ConcurrentQueue()); + + private readonly BlockingCollection _preProcessedNetworkMessages = + new(new ConcurrentQueue()); + + internal static bool IsTesting; + internal bool HasPreProcessedMessage => _preProcessedNetworkMessages.Count > 0; + + private readonly CancellationTokenSource _preProcessCancellationTokenSource = new(); + private CancellationToken _preProcessCancellationToken => _preProcessCancellationTokenSource.Token; + + static DbValue Decode(IRemoteTableHandle table, byte[] bin, out object? primaryKey) + { + var obj = table.DecodeValue(bin); + primaryKey = table.GetPrimaryKey(obj); + return new(obj, bin); + } + + private static readonly Status Committed = new Status.Committed(default); + private static readonly Status OutOfEnergy = new Status.OutOfEnergy(default); + + enum CompressionAlgos : byte + { + None = 0, + Brotli = 1, + Gzip = 2, + } + + private static BrotliStream BrotliReader(Stream stream) + { + return new BrotliStream(stream, CompressionMode.Decompress); + } + + private static GZipStream GzipReader(Stream stream) + { + return new GZipStream(stream, CompressionMode.Decompress); + } + + private static ServerMessage DecompressDecodeMessage(byte[] bytes) + { + using var stream = new MemoryStream(bytes); + + // The stream will never be empty. It will at least contain the compression algo. + var compression = (CompressionAlgos)stream.ReadByte(); + // Conditionally decompress and decode. + Stream decompressedStream = compression switch + { + CompressionAlgos.None => stream, + CompressionAlgos.Brotli => BrotliReader(stream), + CompressionAlgos.Gzip => GzipReader(stream), + _ => throw new InvalidOperationException("Unknown compression type"), + }; + + return new ServerMessage.BSATN().Read(new BinaryReader(decompressedStream)); + } + + private static QueryUpdate DecompressDecodeQueryUpdate(CompressableQueryUpdate update) + { + Stream decompressedStream; + + switch (update) + { + case CompressableQueryUpdate.Uncompressed(var qu): + return qu; + + case CompressableQueryUpdate.Brotli(var bytes): + decompressedStream = BrotliReader(new MemoryStream(bytes.ToArray())); + break; + + case CompressableQueryUpdate.Gzip(var bytes): + decompressedStream = GzipReader(new MemoryStream(bytes.ToArray())); + break; + + default: + throw new InvalidOperationException(); + } + + return new QueryUpdate.BSATN().Read(new BinaryReader(decompressedStream)); + } + + private static IEnumerable BsatnRowListIter(BsatnRowList list) + { + var rowsData = list.RowsData; + + return list.SizeHint switch + { + RowSizeHint.FixedSize(var size) => Enumerable + .Range(0, rowsData.Count / size) + .Select(index => rowsData.Skip(index * size).Take(size).ToArray()), + + RowSizeHint.RowOffsets(var offsets) => offsets.Zip( + offsets.Skip(1).Append((ulong)rowsData.Count), + (start, end) => rowsData.Take((int)end).Skip((int)start).ToArray() + ), + + _ => throw new InvalidOperationException("Unknown RowSizeHint variant"), + }; + } + + void PreProcessMessages() + { + while (!isClosing) + { + try + { + var message = _messageQueue.Take(_preProcessCancellationToken); + var preprocessedMessage = PreProcessMessage(message); + _preProcessedNetworkMessages.Add(preprocessedMessage, _preProcessCancellationToken); + } + catch (OperationCanceledException) + { + return; // Normal shutdown + } + } + + IEnumerable<(IRemoteTableHandle, TableUpdate)> GetTables(DatabaseUpdate updates) + { + foreach (var update in updates.Tables) + { + var tableName = update.TableName; + var table = clientDB.GetTable(tableName); + if (table == null) + { + Log.Error($"Unknown table name: {tableName}"); + continue; + } + yield return (table, update); + } + } + + (List, Dictionary>) PreProcessLegacySubscription(InitialSubscription initSub) + { + var dbOps = new List(); + // This is all of the inserts + int cap = initSub.DatabaseUpdate.Tables.Sum(a => (int)a.NumRows); + // FIXME: shouldn't this be `new(initSub.DatabaseUpdate.Tables.Length)` ? + Dictionary> subscriptionInserts = new(capacity: cap); + + HashSet GetInsertHashSet(System.Type tableType, int tableSize) + { + if (!subscriptionInserts.TryGetValue(tableType, out var hashSet)) + { + hashSet = new HashSet(capacity: tableSize, comparer: ByteArrayComparer.Instance); + subscriptionInserts[tableType] = hashSet; + } + return hashSet; + } + + // First apply all of the state + foreach (var (table, update) in GetTables(initSub.DatabaseUpdate)) + { + var hashSet = GetInsertHashSet(table.ClientTableType, (int)update.NumRows); + + PreProcessInsertOnlyTable(table, update, dbOps, hashSet); + } + return (dbOps, subscriptionInserts); + } + + /// + /// TODO: the dictionary is here for backwards compatibility and can be removed + /// once we get rid of legacy subscriptions. + /// + (List, Dictionary>) PreProcessSubscribeApplied(SubscribeApplied subscribeApplied) + { + var table = clientDB.GetTable(subscribeApplied.Rows.TableName) ?? throw new Exception($"Unknown table name: {subscribeApplied.Rows.TableName}"); + var dbOps = new List(); + HashSet inserts = new(); + + PreProcessInsertOnlyTable(table, subscribeApplied.Rows.TableRows, dbOps, inserts); + + var result = new Dictionary>(); + result[table.ClientTableType] = inserts; + + return (dbOps, result); + } + + void PreProcessInsertOnlyTable(IRemoteTableHandle table, TableUpdate update, List dbOps, HashSet inserts) + { + foreach (var cqu in update.Updates) + { + var qu = DecompressDecodeQueryUpdate(cqu); + if (qu.Deletes.RowsData.Count > 0) + { + Log.Warn("Non-insert during an insert-only server message!"); + } + foreach (var bin in BsatnRowListIter(qu.Inserts)) + { + if (!inserts.Add(bin)) + { + // Ignore duplicate inserts in the same subscription update. + continue; + } + var obj = table.DecodeValue(bin); + var op = new DbOp + { + table = table, + insert = new(obj, bin), + }; + dbOps.Add(op); + } + } + + } + + + /// + /// TODO: the dictionary is here for backwards compatibility and can be removed + /// once we get rid of legacy subscriptions. + /// + List PreProcessUnsubscribeApplied(UnsubscribeApplied unsubApplied) + { + var table = clientDB.GetTable(unsubApplied.Rows.TableName) ?? throw new Exception($"Unknown table name: {unsubApplied.Rows.TableName}"); + var dbOps = new List(); + + // First apply all of the state + foreach (var cqu in unsubApplied.Rows.TableRows.Updates) + { + var qu = DecompressDecodeQueryUpdate(cqu); + if (qu.Inserts.RowsData.Count > 0) + { + Log.Warn("Non-insert during an UnsubscribeApplied!"); + } + foreach (var bin in BsatnRowListIter(qu.Deletes)) + { + var obj = table.DecodeValue(bin); + var op = new DbOp + { + table = table, + delete = new(obj, bin), + }; + dbOps.Add(op); + } + } + + return dbOps; + } + + + + List PreProcessDatabaseUpdate(DatabaseUpdate updates) + { + var dbOps = new List(); + + // All row updates that have a primary key, this contains inserts, deletes and updates + var primaryKeyChanges = new Dictionary<(System.Type tableType, object primaryKeyValue), DbOp>(); + + // First apply all of the state + foreach (var (table, update) in GetTables(updates)) + { + foreach (var cqu in update.Updates) + { + var qu = DecompressDecodeQueryUpdate(cqu); + foreach (var row in BsatnRowListIter(qu.Inserts)) + { + var op = new DbOp { table = table, insert = Decode(table, row, out var pk) }; + if (pk != null) + { + // Compound key that we use for lookup. + // Consists of type of the table (for faster comparison that string names) + actual primary key of the row. + var key = (table.ClientTableType, pk); + + if (primaryKeyChanges.TryGetValue(key, out var oldOp)) + { + if ((op.insert is not null && oldOp.insert is not null) || (op.delete is not null && oldOp.delete is not null)) + { + Log.Warn($"Update with the same primary key was applied multiple times! tableName={update.TableName}"); + // TODO(jdetter): Is this a correctable error? This would be a major error on the + // SpacetimeDB side. + continue; + } + + var (insertOp, deleteOp) = op.insert is not null ? (op, oldOp) : (oldOp, op); + op = new DbOp + { + table = insertOp.table, + delete = deleteOp.delete, + insert = insertOp.insert, + }; + } + primaryKeyChanges[key] = op; + } + else + { + dbOps.Add(op); + } + } + + foreach (var row in BsatnRowListIter(qu.Deletes)) + { + var op = new DbOp { table = table, delete = Decode(table, row, out var pk) }; + if (pk != null) + { + // Compound key that we use for lookup. + // Consists of type of the table (for faster comparison that string names) + actual primary key of the row. + var key = (table.ClientTableType, pk); + + if (primaryKeyChanges.TryGetValue(key, out var oldOp)) + { + if ((op.insert is not null && oldOp.insert is not null) || (op.delete is not null && oldOp.delete is not null)) + { + Log.Warn($"Update with the same primary key was applied multiple times! tableName={update.TableName}"); + // TODO(jdetter): Is this a correctable error? This would be a major error on the + // SpacetimeDB side. + continue; + } + + var (insertOp, deleteOp) = op.insert is not null ? (op, oldOp) : (oldOp, op); + op = new DbOp + { + table = insertOp.table, + delete = deleteOp.delete, + insert = insertOp.insert, + }; + } + primaryKeyChanges[key] = op; + } + else + { + dbOps.Add(op); + } + } + } + } + // Combine primary key updates and non-primary key updates + dbOps.AddRange(primaryKeyChanges.Values); + return dbOps; + } + + void PreProcessOneOffQuery(OneOffQueryResponse resp) + { + /// This case does NOT produce a list of DBOps, because it should not modify the client cache state! + var messageId = new Guid(resp.MessageId.ToArray()); + + if (!waitingOneOffQueries.Remove(messageId, out var resultSource)) + { + Log.Error($"Response to unknown one-off-query: {messageId}"); + return; + } + + resultSource.SetResult(resp); + } + + PreProcessedMessage PreProcessMessage(UnprocessedMessage unprocessed) + { + var dbOps = new List(); + + var message = DecompressDecodeMessage(unprocessed.bytes); + + ReducerEvent? reducerEvent = default; + + // This is all of the inserts, used for updating the stale but un-cleared client cache. + Dictionary>? subscriptionInserts = null; + + switch (message) + { + case ServerMessage.InitialSubscription(var initSub): + (dbOps, subscriptionInserts) = PreProcessLegacySubscription(initSub); + break; + case ServerMessage.SubscribeApplied(var subscribeApplied): + (dbOps, subscriptionInserts) = PreProcessSubscribeApplied(subscribeApplied); + break; + case ServerMessage.SubscriptionError(var subscriptionError): + break; + case ServerMessage.UnsubscribeApplied(var unsubscribeApplied): + dbOps = PreProcessUnsubscribeApplied(unsubscribeApplied); + break; + case ServerMessage.TransactionUpdate(var transactionUpdate): + // Convert the generic event arguments in to a domain specific event object + try + { + reducerEvent = new( + DateTimeOffset.FromUnixTimeMilliseconds((long)transactionUpdate.Timestamp.Microseconds / 1000), + transactionUpdate.Status switch + { + UpdateStatus.Committed => Committed, + UpdateStatus.OutOfEnergy => OutOfEnergy, + UpdateStatus.Failed(var reason) => new Status.Failed(reason), + _ => throw new InvalidOperationException() + }, + transactionUpdate.CallerIdentity, + transactionUpdate.CallerAddress, + transactionUpdate.EnergyQuantaUsed.Quanta, + ToReducer(transactionUpdate)); + } + catch (Exception e) + { + Log.Exception(e); + } + + if (transactionUpdate.Status is UpdateStatus.Committed(var committed)) + { + dbOps = PreProcessDatabaseUpdate(committed); + } + break; + case ServerMessage.TransactionUpdateLight(var update): + dbOps = PreProcessDatabaseUpdate(update.Update); + break; + case ServerMessage.IdentityToken(var identityToken): + break; + case ServerMessage.OneOffQueryResponse(var resp): + PreProcessOneOffQuery(resp); + break; + + default: + throw new InvalidOperationException(); + } + + return new PreProcessedMessage + { + processed = new ProcessedMessage { message = message, dbOps = dbOps, timestamp = unprocessed.timestamp, reducerEvent = reducerEvent }, + subscriptionInserts = subscriptionInserts, + }; + } + } + + ProcessedMessage CalculateStateDiff(PreProcessedMessage preProcessedMessage) + { + var processed = preProcessedMessage.processed; + + // Perform the state diff, this has to be done on the main thread because we have to touch + // the client cache. + if (preProcessedMessage.subscriptionInserts is { } subscriptionInserts) + { + foreach (var table in clientDB.GetTables()) + { + if (!subscriptionInserts.TryGetValue(table.ClientTableType, out var hashSet)) + { + // We don't know if the user is waiting for subscriptions on other tables. + // Leave the stale data for untouched tables in the cache; this is + // the best we can do. + continue; + } + + foreach (var (rowBytes, oldValue) in table.IterEntries().Where(kv => !hashSet.Contains(kv.Key))) + { + processed.dbOps.Add(new DbOp + { + table = table, + // This is a row that we had before, but we do not have it now. + // This must have been a delete. + delete = new(oldValue, rowBytes), + }); + } + } + } + + return processed; + } + + public void Disconnect() + { + isClosing = true; + connectionClosed = true; + webSocket.Close(); + _preProcessCancellationTokenSource.Cancel(); + } + + /// + /// Connect to a remote spacetime instance. + /// + /// URI of the SpacetimeDB server (ex: https://testnet.spacetimedb.com) + /// The name or address of the database to connect to + internal void Connect(string? token, string uri, string addressOrName, Compression compression, bool light) + { + isClosing = false; + + uri = uri.Replace("http://", "ws://"); + uri = uri.Replace("https://", "wss://"); + if (!uri.StartsWith("ws://") && !uri.StartsWith("wss://")) + { + uri = $"ws://{uri}"; + } + + Log.Info($"SpacetimeDBClient: Connecting to {uri} {addressOrName}"); + if (!IsTesting) + { + Task.Run(async () => + { + try + { + await webSocket.Connect(token, uri, addressOrName, Address, compression, light); + } + catch (Exception e) + { + if (connectionClosed) + { + Log.Info("Connection closed gracefully."); + return; + } + + Log.Exception(e); + } + }); + } + } + + private void OnMessageProcessCompleteUpdate(IEventContext eventContext, List dbOps) + { + // First trigger OnBeforeDelete + foreach (var update in dbOps) + { + if (update is { delete: { value: var oldValue }, insert: null }) + { + try + { + update.table.InvokeBeforeDelete(eventContext, oldValue); + } + catch (Exception e) + { + Log.Exception(e); + } + } + } + + // Apply all of the state + for (var i = 0; i < dbOps.Count; i++) + { + // TODO: Reimplement updates when we add support for primary keys + var update = dbOps[i]; + + if (update.delete is { } delete) + { + if (update.table.DeleteEntry(delete.bytes)) + { + update.table.InternalInvokeValueDeleted(delete.value); + } + else + { + update.delete = null; + dbOps[i] = update; + } + } + + if (update.insert is { } insert) + { + if (update.table.InsertEntry(insert.bytes, insert.value)) + { + update.table.InternalInvokeValueInserted(insert.value); + } + else + { + update.insert = null; + dbOps[i] = update; + } + } + } + + // Send out events + foreach (var dbOp in dbOps) + { + try + { + switch (dbOp) + { + case { insert: { value: var newValue }, delete: { value: var oldValue } }: + dbOp.table.InvokeUpdate(eventContext, oldValue, newValue); + break; + + case { insert: { value: var newValue } }: + dbOp.table.InvokeInsert(eventContext, newValue); + break; + + case { delete: { value: var oldValue } }: + dbOp.table.InvokeDelete(eventContext, oldValue); + break; + } + } + catch (Exception e) + { + Log.Exception(e); + } + } + } + + protected abstract bool Dispatch(IEventContext context, Reducer reducer); + + private void OnMessageProcessComplete(PreProcessedMessage preProcessed) + { + var processed = CalculateStateDiff(preProcessed); + var message = processed.message; + var dbOps = processed.dbOps; + var timestamp = processed.timestamp; + + switch (message) + { + case ServerMessage.InitialSubscription(var initialSubscription): + { + stats.ParseMessageTracker.InsertRequest(timestamp, $"type={nameof(ServerMessage.InitialSubscription)}"); + stats.SubscriptionRequestTracker.FinishTrackingRequest(initialSubscription.RequestId); + var eventContext = ToEventContext(new Event.SubscribeApplied()); + OnMessageProcessCompleteUpdate(eventContext, dbOps); + if (legacySubscriptions.TryGetValue(initialSubscription.RequestId, out var subscription)) + { + try + { + subscription.OnApplied(eventContext, new SubscriptionAppliedType.LegacyActive(new())); + } + catch (Exception e) + { + Log.Exception(e); + } + } + break; + } + + case ServerMessage.SubscribeApplied(var subscribeApplied): + { + stats.ParseMessageTracker.InsertRequest(timestamp, $"type={nameof(ServerMessage.SubscribeApplied)}"); + stats.SubscriptionRequestTracker.FinishTrackingRequest(subscribeApplied.RequestId); + var eventContext = ToEventContext(new Event.SubscribeApplied()); + OnMessageProcessCompleteUpdate(eventContext, dbOps); + if (subscriptions.TryGetValue(subscribeApplied.QueryId.Id, out var subscription)) + { + try + { + subscription.OnApplied(eventContext, new SubscriptionAppliedType.Active(subscribeApplied.QueryId)); + } + catch (Exception e) + { + Log.Exception(e); + } + } + + break; + } + + case ServerMessage.SubscriptionError(var subscriptionError): + { + Log.Warn($"Subscription Error: ${subscriptionError.Error}"); + stats.ParseMessageTracker.InsertRequest(timestamp, $"type={nameof(ServerMessage.SubscriptionError)}"); + if (subscriptionError.RequestId.HasValue) + { + stats.SubscriptionRequestTracker.FinishTrackingRequest(subscriptionError.RequestId.Value); + } + // TODO: should I use a more specific exception type here? + var eventContext = ToEventContext(new Event.SubscribeError(new Exception(subscriptionError.Error))); + OnMessageProcessCompleteUpdate(eventContext, dbOps); + if (subscriptionError.QueryId.HasValue) + { + if (subscriptions.TryGetValue(subscriptionError.QueryId.Value, out var subscription)) + { + try + { + subscription.OnError(eventContext); + } + catch (Exception e) + { + Log.Exception(e); + } + } + } + else + { + Log.Warn("Received general subscription failure, disconnecting."); + Disconnect(); + } + + break; + } + + case ServerMessage.UnsubscribeApplied(var unsubscribeApplied): + { + stats.ParseMessageTracker.InsertRequest(timestamp, $"type={nameof(ServerMessage.UnsubscribeApplied)}"); + stats.SubscriptionRequestTracker.FinishTrackingRequest(unsubscribeApplied.RequestId); + var eventContext = ToEventContext(new Event.UnsubscribeApplied()); + OnMessageProcessCompleteUpdate(eventContext, dbOps); + if (subscriptions.TryGetValue(unsubscribeApplied.QueryId.Id, out var subscription)) + { + try + { + subscription.OnEnded(eventContext); + } + catch (Exception e) + { + Log.Exception(e); + } + } + } + break; + + case ServerMessage.TransactionUpdateLight(var update): + { + stats.ParseMessageTracker.InsertRequest(timestamp, $"type={nameof(ServerMessage.TransactionUpdateLight)}"); + + var eventContext = ToEventContext(new Event.UnknownTransaction()); + OnMessageProcessCompleteUpdate(eventContext, dbOps); + + break; + } + + case ServerMessage.TransactionUpdate(var transactionUpdate): + { + var reducer = transactionUpdate.ReducerCall.ReducerName; + stats.ParseMessageTracker.InsertRequest(timestamp, $"type={nameof(ServerMessage.TransactionUpdate)},reducer={reducer}"); + var hostDuration = TimeSpan.FromMilliseconds(transactionUpdate.HostExecutionDurationMicros / 1000.0d); + stats.AllReducersTracker.InsertRequest(hostDuration, $"reducer={reducer}"); + var callerIdentity = transactionUpdate.CallerIdentity; + if (callerIdentity == Identity) + { + // This was a request that we initiated + var requestId = transactionUpdate.ReducerCall.RequestId; + if (!stats.ReducerRequestTracker.FinishTrackingRequest(requestId)) + { + Log.Warn($"Failed to finish tracking reducer request: {requestId}"); + } + } + + if (processed.reducerEvent is not { } reducerEvent) + { + // If we are here, an error about unknown reducer should have already been logged, so nothing to do. + break; + } + + var eventContext = ToEventContext(new Event.Reducer(reducerEvent)); + OnMessageProcessCompleteUpdate(eventContext, dbOps); + + var reducerFound = false; + try + { + reducerFound = Dispatch(eventContext, reducerEvent.Reducer); + } + catch (Exception e) + { + Log.Exception(e); + } + + if (!reducerFound && transactionUpdate.Status is UpdateStatus.Failed(var failed)) + { + try + { + onUnhandledReducerError?.Invoke(reducerEvent); + } + catch (Exception e) + { + Log.Exception(e); + } + } + break; + } + case ServerMessage.IdentityToken(var identityToken): + try + { + Identity = identityToken.Identity; + onConnect?.Invoke(identityToken.Identity, identityToken.Token); + } + catch (Exception e) + { + Log.Exception(e); + } + break; + + case ServerMessage.OneOffQueryResponse: + /* OneOffQuery is async and handles its own responses */ + break; + + default: + throw new InvalidOperationException(); + } + } + + // Note: this method is called from unit tests. + internal void OnMessageReceived(byte[] bytes, DateTime timestamp) => + _messageQueue.Add(new UnprocessedMessage { bytes = bytes, timestamp = timestamp }); + + // TODO: this should become [Obsolete] but for now is used by autogenerated code. + public void InternalCallReducer(T args, CallReducerFlags flags) + where T : IReducerArgs, new() + { + if (!webSocket.IsConnected) + { + Log.Error("Cannot call reducer, not connected to server!"); + return; + } + + webSocket.Send(new ClientMessage.CallReducer(new CallReducer( + args.ReducerName, + IStructuralReadWrite.ToBytes(args).ToList(), + stats.ReducerRequestTracker.StartTrackingRequest(args.ReducerName), + (byte)flags + ))); + } + + void IDbConnection.LegacySubscribe(ISubscriptionHandle handle, string[] querySqls) + { + if (!webSocket.IsConnected) + { + Log.Error("Cannot subscribe, not connected to server!"); + return; + } + + var id = stats.SubscriptionRequestTracker.StartTrackingRequest(); + legacySubscriptions[id] = handle; + webSocket.Send(new ClientMessage.Subscribe( + new Subscribe + { + RequestId = id, + QueryStrings = querySqls.ToList() + } + )); + } + + void IDbConnection.Subscribe(ISubscriptionHandle handle, string querySql) + { + if (!webSocket.IsConnected) + { + Log.Error("Cannot subscribe, not connected to server!"); + return; + } + + var id = stats.SubscriptionRequestTracker.StartTrackingRequest(); + // We use a distinct ID from the request ID as a sanity check that we're not + // casting request IDs to query IDs anywhere in the new code path. + var queryId = queryIdAllocator.Next(); + subscriptions[queryId] = handle; + webSocket.Send(new ClientMessage.SubscribeSingle( + new SubscribeSingle + { + RequestId = id, + Query = querySql, + QueryId = new QueryId(queryId), + } + )); + } + + /// Usage: SpacetimeDBClientBase.instance.OneOffQuery("SELECT * FROM table WHERE sender = \"bob\""); + [Obsolete("This is replaced by ctx.Db.TableName.RemoteQuery(\"WHERE ...\")", false)] + public Task OneOffQuery(string query) where T : IDatabaseRow, new() => + ((IDbConnection)this).RemoteQuery(query); + + async Task IDbConnection.RemoteQuery(string query) + { + var messageId = Guid.NewGuid(); + var resultSource = new TaskCompletionSource(); + waitingOneOffQueries[messageId] = resultSource; + + // unsanitized here, but writes will be prevented serverside. + // the best they can do is send multiple selects, which will just result in them getting no data back. + + var requestId = stats.OneOffRequestTracker.StartTrackingRequest(); + webSocket.Send(new ClientMessage.OneOffQuery(new OneOffQuery + { + MessageId = messageId.ToByteArray().ToList(), + QueryString = query, + })); + + // Suspend for an arbitrary amount of time + var result = await resultSource.Task; + + if (!stats.OneOffRequestTracker.FinishTrackingRequest(requestId)) + { + Log.Warn($"Failed to finish tracking one off request: {requestId}"); + } + + T[] LogAndThrow(string error) + { + error = $"While processing one-off-query `{query}`, ID {messageId}: {error}"; + Log.Error(error); + throw new Exception(error); + } + + // The server got back to us + if (result.Error != null && result.Error != "") + { + return LogAndThrow($"Server error: {result.Error}"); + } + + if (result.Tables.Count != 1) + { + return LogAndThrow($"Expected a single table, but got {result.Tables.Count}"); + } + + var resultTable = result.Tables[0]; + var cacheTable = clientDB.GetTable(resultTable.TableName); + + if (cacheTable?.ClientTableType != typeof(T)) + { + return LogAndThrow($"Mismatched result type, expected {typeof(T)} but got {resultTable.TableName}"); + } + + return BsatnRowListIter(resultTable.Rows) + .Select(BSATNHelpers.Decode) + .ToArray(); + } + + public bool IsActive => webSocket.IsConnected; + + public void FrameTick() + { + webSocket.Update(); + while (_preProcessedNetworkMessages.TryTake(out var preProcessedMessage)) + { + OnMessageProcessComplete(preProcessedMessage); + } + } + + void IDbConnection.Unsubscribe(QueryId queryId) + { + if (!subscriptions.ContainsKey(queryId.Id)) + { + Log.Warn($"Unsubscribing from a subscription that the DbConnection does not know about, with QueryId {queryId.Id}"); + } + + var requestId = stats.SubscriptionRequestTracker.StartTrackingRequest(); + + webSocket.Send(new ClientMessage.Unsubscribe(new() + { + RequestId = requestId, + QueryId = queryId + })); + + } + } + + internal struct UintAllocator + { + private uint lastAllocated; + + /// + /// Allocate a new ID in a thread-unsafe way. + /// + /// A previously-unused ID. + public uint Next() + { + lastAllocated++; + return lastAllocated; + } + } +} diff --git a/src/SpacetimeDBClient.cs.meta b/src/SpacetimeDBClient.cs.meta new file mode 100644 index 000000000..54679b20d --- /dev/null +++ b/src/SpacetimeDBClient.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b2e2257b72c40ac4f94e9fe8a0a1c51c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/SpacetimeDBNetworkManager.cs b/src/SpacetimeDBNetworkManager.cs new file mode 100644 index 000000000..379bf63d8 --- /dev/null +++ b/src/SpacetimeDBNetworkManager.cs @@ -0,0 +1,61 @@ +#if UNITY_5_3_OR_NEWER +using System; +using System.Collections.Generic; +using SpacetimeDB; +using UnityEngine; + +namespace SpacetimeDB +{ + // This class is only used in Unity projects. + // Attach this to a GameObject in your scene to use SpacetimeDB. + public class SpacetimeDBNetworkManager : MonoBehaviour + { + internal static SpacetimeDBNetworkManager? _instance; + + public void Awake() + { + // Ensure that users don't create several SpacetimeDBNetworkManager instances. + // We're using a global (static) list of active connections and we don't want several instances to walk over it several times. + if (_instance != null) + { + throw new InvalidOperationException("SpacetimeDBNetworkManager is a singleton and should only be attached once."); + } + else + { + _instance = this; + } + } + + private readonly List activeConnections = new(); + + public bool AddConnection(IDbConnection conn) + { + if (activeConnections.Contains(conn)) + { + return false; + } + activeConnections.Add(conn); + return true; + + } + + public bool RemoveConnection(IDbConnection conn) + { + return activeConnections.Remove(conn); + } + + private void ForEachConnection(Action action) + { + // It's common to call disconnect from Update, which will then modify the ActiveConnections collection, + // therefore we must reverse-iterate the list of connections. + for (var x = activeConnections.Count - 1; x >= 0; x--) + { + action(activeConnections[x]); + } + } + + private void Update() => ForEachConnection(conn => conn.FrameTick()); + private void OnDestroy() => ForEachConnection(conn => conn.Disconnect()); + } +} +#endif diff --git a/src/SpacetimeDBNetworkManager.cs.meta b/src/SpacetimeDBNetworkManager.cs.meta new file mode 100644 index 000000000..e8f74142b --- /dev/null +++ b/src/SpacetimeDBNetworkManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e016ef92e52934343857fd26e55140c1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Stats.cs b/src/Stats.cs new file mode 100644 index 000000000..bac011d0b --- /dev/null +++ b/src/Stats.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; + +namespace SpacetimeDB +{ + public class NetworkRequestTracker + { + private readonly ConcurrentQueue<(DateTime End, TimeSpan Duration, string Metadata)> _requestDurations = new(); + + private uint _nextRequestId; + private readonly Dictionary _requests = new(); + + internal uint StartTrackingRequest(string metadata = "") + { + // Record the start time of the request + var newRequestId = ++_nextRequestId; + _requests[newRequestId] = (DateTime.UtcNow, metadata); + return newRequestId; + } + + internal bool FinishTrackingRequest(uint requestId) + { + if (!_requests.Remove(requestId, out var entry)) + { + // TODO: When we implement requestId json support for SpacetimeDB this shouldn't happen anymore! + // var minKey = _requests.Keys.Min(); + // entry = _requests[minKey]; + // + // if (!_requests.Remove(minKey)) + // { + // return false; + // } + return false; + } + + // Calculate the duration and add it to the queue + InsertRequest(entry.Start, entry.Metadata); + return true; + } + + internal void InsertRequest(TimeSpan duration, string metadata) + { + _requestDurations.Enqueue((DateTime.UtcNow, duration, metadata)); + } + + internal void InsertRequest(DateTime start, string metadata) + { + InsertRequest(DateTime.UtcNow - start, metadata); + } + + public ((TimeSpan Duration, string Metadata) Min, (TimeSpan Duration, string Metadata) Max)? GetMinMaxTimes(int lastSeconds) + { + var cutoff = DateTime.UtcNow.AddSeconds(-lastSeconds); + var requestDurations = _requestDurations.Where(x => x.End >= cutoff).Select(x => (x.Duration, x.Metadata)); + + if (!requestDurations.Any()) + { + return null; + } + + return (requestDurations.Min(), requestDurations.Max()); + } + + public int GetSampleCount() => _requestDurations.Count; + public int GetRequestsAwaitingResponse() => _requests.Count; + } + + public class Stats + { + public readonly NetworkRequestTracker ReducerRequestTracker = new(); + public readonly NetworkRequestTracker OneOffRequestTracker = new(); + public readonly NetworkRequestTracker SubscriptionRequestTracker = new(); + public readonly NetworkRequestTracker AllReducersTracker = new(); + public readonly NetworkRequestTracker ParseMessageTracker = new(); + } +} diff --git a/src/Stats.cs.meta b/src/Stats.cs.meta new file mode 100644 index 000000000..aa7e387ec --- /dev/null +++ b/src/Stats.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 78bde2488f9358148897c778b2ef1e6c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Table.cs b/src/Table.cs new file mode 100644 index 000000000..a0acaf37a --- /dev/null +++ b/src/Table.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +using SpacetimeDB.BSATN; + +namespace SpacetimeDB +{ + public interface IDatabaseRow : IStructuralReadWrite { } + + public abstract class RemoteBase + { + protected readonly DbConnection conn; + + protected RemoteBase(DbConnection conn) + { + this.conn = conn; + } + } + + public interface IRemoteTableHandle + { + // These methods need to be overridden by autogen. + object? GetPrimaryKey(IDatabaseRow row); + void InternalInvokeValueInserted(IDatabaseRow row); + void InternalInvokeValueDeleted(IDatabaseRow row); + + // These are provided by RemoteTableHandle. + internal Type ClientTableType { get; } + internal IEnumerable> IterEntries(); + internal bool InsertEntry(byte[] rowBytes, IDatabaseRow value); + internal bool DeleteEntry(byte[] rowBytes); + internal IDatabaseRow DecodeValue(byte[] bytes); + + internal void InvokeInsert(IEventContext context, IDatabaseRow row); + internal void InvokeDelete(IEventContext context, IDatabaseRow row); + internal void InvokeBeforeDelete(IEventContext context, IDatabaseRow row); + internal void InvokeUpdate(IEventContext context, IDatabaseRow oldRow, IDatabaseRow newRow); + + internal void Initialize(string name, IDbConnection conn); + } + + public abstract class RemoteTableHandle : IRemoteTableHandle + where EventContext : class, IEventContext + where Row : IDatabaseRow, new() + { + string? name; + IDbConnection? conn; + + void IRemoteTableHandle.Initialize(string name, IDbConnection conn) + { + this.name = name; + this.conn = conn; + } + + // These methods need to be overridden by autogen. + public virtual object? GetPrimaryKey(IDatabaseRow row) => null; + public virtual void InternalInvokeValueInserted(IDatabaseRow row) { } + public virtual void InternalInvokeValueDeleted(IDatabaseRow row) { } + + // These are provided by RemoteTableHandle. + Type IRemoteTableHandle.ClientTableType => typeof(Row); + + private readonly Dictionary Entries = new(Internal.ByteArrayComparer.Instance); + + IEnumerable> IRemoteTableHandle.IterEntries() => + Entries.Select(kv => new KeyValuePair(kv.Key, kv.Value)); + + /// + /// Inserts the value into the table. There can be no existing value with the provided BSATN bytes. + /// + /// The BSATN encoded bytes of the row to retrieve. + /// The parsed row encoded by the rowBytes. + /// True if the row was inserted, false if the row wasn't inserted because it was a duplicate. + bool IRemoteTableHandle.InsertEntry(byte[] rowBytes, IDatabaseRow value) => Entries.TryAdd(rowBytes, (Row)value); + + /// + /// Deletes a value from the table. + /// + /// The BSATN encoded bytes of the row to remove. + /// True if and only if the value was previously resident and has been deleted. + bool IRemoteTableHandle.DeleteEntry(byte[] rowBytes) + { + if (Entries.Remove(rowBytes)) + { + return true; + } + + Log.Warn("Deleting value that we don't have (no cached value available)"); + return false; + } + + // The function to use for decoding a type value. + IDatabaseRow IRemoteTableHandle.DecodeValue(byte[] bytes) => BSATNHelpers.Decode(bytes); + + public delegate void RowEventHandler(EventContext context, Row row); + public event RowEventHandler? OnInsert; + public event RowEventHandler? OnDelete; + public event RowEventHandler? OnBeforeDelete; + + public delegate void UpdateEventHandler(EventContext context, Row oldRow, Row newRow); + public event UpdateEventHandler? OnUpdate; + + public int Count => Entries.Count; + + public IEnumerable Iter() => Entries.Values; + + protected IEnumerable Query(Func filter) => Iter().Where(filter); + + public Task RemoteQuery(string query) => + conn!.RemoteQuery($"SELECT {name!}.* FROM {name!} {query}"); + + void IRemoteTableHandle.InvokeInsert(IEventContext context, IDatabaseRow row) => + OnInsert?.Invoke((EventContext)context, (Row)row); + + void IRemoteTableHandle.InvokeDelete(IEventContext context, IDatabaseRow row) => + OnDelete?.Invoke((EventContext)context, (Row)row); + + void IRemoteTableHandle.InvokeBeforeDelete(IEventContext context, IDatabaseRow row) => + OnBeforeDelete?.Invoke((EventContext)context, (Row)row); + + void IRemoteTableHandle.InvokeUpdate(IEventContext context, IDatabaseRow oldRow, IDatabaseRow newRow) => + OnUpdate?.Invoke((EventContext)context, (Row)oldRow, (Row)newRow); + } +} diff --git a/src/Table.cs.meta b/src/Table.cs.meta new file mode 100644 index 000000000..09681bfa3 --- /dev/null +++ b/src/Table.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0de7dc78e75a21a428bfa6e3dd520ba9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/src/UnityDebugLogger.cs b/src/UnityDebugLogger.cs new file mode 100644 index 000000000..94d21aee8 --- /dev/null +++ b/src/UnityDebugLogger.cs @@ -0,0 +1,34 @@ +/* SpacetimeDB logging for Unity + * * This class is only used in Unity projects. + * * + */ +#if UNITY_5_3_OR_NEWER +using System; + +namespace SpacetimeDB +{ + internal class UnityDebugLogger : ISpacetimeDBLogger + { + public void Debug(string message) => + UnityEngine.Debug.Log(message); + + public void Trace(string message) => + UnityEngine.Debug.Log(message); + + public void Info(string message) => + UnityEngine.Debug.Log(message); + + public void Warn(string message) => + UnityEngine.Debug.LogWarning(message); + + public void Error(string message) => + UnityEngine.Debug.LogError(message); + + public void Exception(string message) => + UnityEngine.Debug.LogError(message); + + public void Exception(Exception e) => + UnityEngine.Debug.LogException(e); + } +} +#endif diff --git a/src/UnityDebugLogger.cs.meta b/src/UnityDebugLogger.cs.meta new file mode 100644 index 000000000..7a161f3b0 --- /dev/null +++ b/src/UnityDebugLogger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dca83adbf482a184fae5c66692bfb3f8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Utils.cs b/src/Utils.cs new file mode 100644 index 000000000..8e25f2011 --- /dev/null +++ b/src/Utils.cs @@ -0,0 +1,6 @@ +#if !NET5_0_OR_GREATER +namespace System.Runtime.CompilerServices +{ + internal static class IsExternalInit { } // https://stackoverflow.com/a/64749403/1484415 +} +#endif diff --git a/src/Utils.cs.meta b/src/Utils.cs.meta new file mode 100644 index 000000000..750b099f7 --- /dev/null +++ b/src/Utils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6bc823297f8396b42b0805bdc1aba85f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/WebSocket.cs b/src/WebSocket.cs new file mode 100644 index 000000000..bf65c84ee --- /dev/null +++ b/src/WebSocket.cs @@ -0,0 +1,317 @@ +using SpacetimeDB.BSATN; +using SpacetimeDB.ClientApi; + +using System; +using System.Collections.Concurrent; +using System.Linq; +using System.Net.Sockets; +using System.Net.WebSockets; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace SpacetimeDB +{ + internal class WebSocket + { + public delegate void OpenEventHandler(); + + public delegate void MessageEventHandler(byte[] message, DateTime timestamp); + + public delegate void CloseEventHandler(Exception? e); + + public delegate void ConnectErrorEventHandler(Exception e); + public delegate void SendErrorEventHandler(Exception e); + + public struct ConnectOptions + { + public string Protocol; + } + + // WebSocket buffer for incoming messages + private static readonly int MAXMessageSize = 0x4000000; // 64MB + + // Connection parameters + private readonly ConnectOptions _options; + private readonly byte[] _receiveBuffer = new byte[MAXMessageSize]; + private readonly ConcurrentQueue dispatchQueue = new(); + + protected ClientWebSocket Ws = new(); + + public WebSocket(ConnectOptions options) + { + _options = options; + } + + public event OpenEventHandler? OnConnect; + public event ConnectErrorEventHandler? OnConnectError; + public event SendErrorEventHandler? OnSendError; + public event MessageEventHandler? OnMessage; + public event CloseEventHandler? OnClose; + + public bool IsConnected { get { return Ws != null && Ws.State == WebSocketState.Open; } } + + public async Task Connect(string? auth, string host, string nameOrAddress, Address clientAddress, Compression compression, bool light) + { + var uri = $"{host}/database/subscribe/{nameOrAddress}?client_address={clientAddress}&compression={compression}"; + if (light) + { + uri += "&light=true"; + } + var url = new Uri(uri); + Ws.Options.AddSubProtocol(_options.Protocol); + + var source = new CancellationTokenSource(10000); + if (!string.IsNullOrEmpty(auth)) + { + var tokenBytes = Encoding.UTF8.GetBytes($"token:{auth}"); + var base64 = Convert.ToBase64String(tokenBytes); + Ws.Options.SetRequestHeader("Authorization", $"Basic {base64}"); + } + else + { + Ws.Options.UseDefaultCredentials = true; + } + + try + { + await Ws.ConnectAsync(url, source.Token); + if (Ws.State == WebSocketState.Open) + { + if (OnConnect != null) + { + dispatchQueue.Enqueue(() => OnConnect()); + } + } + else + { + if (OnConnectError != null) + { + dispatchQueue.Enqueue(() => OnConnectError( + new Exception($"WebSocket connection failed. Current state: {Ws.State}"))); + } + return; + } + } + catch (WebSocketException ex) when (ex.WebSocketErrorCode == WebSocketError.Success) + { + // How can we get here: + // - When you go to connect and the server isn't running (port closed) - target machine actively refused + // - 404 - No module with at that module address instead of 101 upgrade + // - 401? - When the identity received by SpacetimeDB wasn't signed by its signing key + // - 400 - When the auth is malformed + if (OnConnectError != null) + { + // .net 6,7,8 has support for Ws.HttpStatusCode as long as you set + // ClientWebSocketOptions.CollectHttpResponseDetails = true + var message = "A WebSocketException occurred, even though the WebSocketErrorCode is \"Success\".\n" + + "This indicates that there was no native error information for the exception.\n" + + "Due to limitations in the .NET core version we do not have access to the HTTP status code returned by the request which would provide more info on the nature of the error.\n\n" + + "This error could arise for a number of reasons:\n" + + "1. The target machine actively refused the connection.\n" + + "2. The module you are trying to connect to does not exist (404 NOT FOUND).\n" + + "3. The auth token you sent to SpacetimeDB was not signed by the correct signing key (400 BAD REQUEST).\n" + + "4. The auth token is malformed (400 BAD REQUEST).\n" + + "5. You are not authorized (401 UNAUTHORIZED).\n\n" + + "Did you forget to start the server or publish your module?\n\n" + + "Here are some values that might help you debug:\n" + + $"Message: {ex.Message}\n" + + $"WebSocketErrorCode: {ex.WebSocketErrorCode}\n" + + $"ErrorCode: {ex.ErrorCode}\n" + + $"NativeErrorCode: {ex.NativeErrorCode}\n" + + $"InnerException Message: {ex.InnerException?.Message}\n" + + $"WebSocket CloseStatus: {Ws.CloseStatus}\n" + + $"WebSocket State: {Ws.State}\n" + + $"InnerException: {ex.InnerException}\n" + + $"Exception: {ex}" + ; + dispatchQueue.Enqueue(() => OnConnectError(new Exception(message))); + } + } + catch (WebSocketException ex) + { + if (OnConnectError != null) + { + var message = $"WebSocket connection failed: {ex.WebSocketErrorCode}\n" + + $"Exception message: {ex.Message}\n"; + dispatchQueue.Enqueue(() => OnConnectError(new Exception(message))); + } + } + catch (SocketException ex) + { + // This might occur if the server is unreachable or the DNS lookup fails. + if (OnConnectError != null) + { + dispatchQueue.Enqueue(() => OnConnectError(ex)); + } + } + catch (Exception ex) + { + if (OnConnectError != null) + { + dispatchQueue.Enqueue(() => OnConnectError(ex)); + } + } + + while (Ws.State == WebSocketState.Open) + { + try + { + var receiveResult = await Ws.ReceiveAsync(new ArraySegment(_receiveBuffer), + CancellationToken.None); + if (receiveResult.MessageType == WebSocketMessageType.Close) + { + if (Ws.State != WebSocketState.Closed) + { + await Ws.CloseAsync(WebSocketCloseStatus.NormalClosure, string.Empty, + CancellationToken.None); + } + if (OnClose != null) + { + switch (receiveResult.CloseStatus) + { + case WebSocketCloseStatus.NormalClosure: + dispatchQueue.Enqueue(() => OnClose(null)); + break; + case WebSocketCloseStatus.EndpointUnavailable: + dispatchQueue.Enqueue(() => OnClose(new Exception("(1000) The connection has closed after the request was fulfilled."))); + break; + case WebSocketCloseStatus.ProtocolError: + dispatchQueue.Enqueue(() => OnClose(new Exception("(1002) The client or server is terminating the connection because of a protocol error."))); + break; + case WebSocketCloseStatus.InvalidMessageType: + dispatchQueue.Enqueue(() => OnClose(new Exception("(1003) The client or server is terminating the connection because it cannot accept the data type it received."))); + break; + case WebSocketCloseStatus.Empty: + dispatchQueue.Enqueue(() => OnClose(new Exception("(1005) No error specified."))); + break; + case WebSocketCloseStatus.InvalidPayloadData: + dispatchQueue.Enqueue(() => OnClose(new Exception("(1007) The client or server is terminating the connection because it has received data inconsistent with the message type."))); + break; + case WebSocketCloseStatus.PolicyViolation: + dispatchQueue.Enqueue(() => OnClose(new Exception("(1008) The connection will be closed because an endpoint has received a message that violates its policy."))); + break; + case WebSocketCloseStatus.MessageTooBig: + dispatchQueue.Enqueue(() => OnClose(new Exception("(1009) Message too big"))); + break; + case WebSocketCloseStatus.MandatoryExtension: + dispatchQueue.Enqueue(() => OnClose(new Exception("(1010) The client is terminating the connection because it expected the server to negotiate an extension."))); + break; + case WebSocketCloseStatus.InternalServerError: + dispatchQueue.Enqueue(() => OnClose(new Exception("(1011) The connection will be closed by the server because of an error on the server."))); + break; + default: + dispatchQueue.Enqueue(() => OnClose(new Exception("Unknown error"))); + break; + } + } + return; + } + + var startReceive = DateTime.UtcNow; + var count = receiveResult.Count; + while (receiveResult.EndOfMessage == false) + { + if (count >= MAXMessageSize) + { + // TODO: Improve this, we should allow clients to receive messages of whatever size + var closeMessage = $"Maximum message size: {MAXMessageSize} bytes."; + await Ws.CloseAsync(WebSocketCloseStatus.MessageTooBig, closeMessage, + CancellationToken.None); + if (OnClose != null) + { + dispatchQueue.Enqueue(() => OnClose(new Exception("(1009) Message too big"))); + } + return; + } + + receiveResult = await Ws.ReceiveAsync( + new ArraySegment(_receiveBuffer, count, MAXMessageSize - count), + CancellationToken.None); + count += receiveResult.Count; + } + + if (OnMessage != null) + { + var message = _receiveBuffer.Take(count).ToArray(); + dispatchQueue.Enqueue(() => OnMessage(message, startReceive)); + } + } + catch (WebSocketException ex) + { + if (OnClose != null) dispatchQueue.Enqueue(() => OnClose(ex)); + return; + } + } + } + + public Task Close(WebSocketCloseStatus code = WebSocketCloseStatus.NormalClosure) + { + Ws?.CloseAsync(code, "Disconnecting normally.", CancellationToken.None); + + return Task.CompletedTask; + } + + private Task? senderTask; + private readonly ConcurrentQueue messageSendQueue = new(); + + /// + /// This sender guarantees that that messages are sent out in the order they are received. Our websocket + /// library only allows us to await one send call, so we have to wait until the current send call is complete + /// before we start another one. This function is also thread safe, just in case. + /// + /// The message to send + public void Send(ClientMessage message) + { + lock (messageSendQueue) + { + messageSendQueue.Enqueue(message); + senderTask ??= Task.Run(ProcessSendQueue); + } + } + + + private async Task ProcessSendQueue() + { + try + { + while (true) + { + ClientMessage message; + + lock (messageSendQueue) + { + if (!messageSendQueue.TryDequeue(out message)) + { + // We are out of messages to send + senderTask = null; + return; + } + } + + var messageBSATN = new ClientMessage.BSATN(); + var encodedMessage = IStructuralReadWrite.ToBytes(messageBSATN, message); + await Ws!.SendAsync(encodedMessage, WebSocketMessageType.Binary, true, CancellationToken.None); + } + } + catch (Exception e) + { + senderTask = null; + if (OnSendError != null) dispatchQueue.Enqueue(() => OnSendError(e)); + } + } + + public WebSocketState GetState() + { + return Ws!.State; + } + + public void Update() + { + while (dispatchQueue.TryDequeue(out var result)) + { + result(); + } + } + } +} diff --git a/src/WebSocket.cs.meta b/src/WebSocket.cs.meta new file mode 100644 index 000000000..d99b34482 --- /dev/null +++ b/src/WebSocket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 25629871099f7fb44a41043590bc668f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/com.clockworklabs.spacetimedbsdk.asmdef b/src/com.clockworklabs.spacetimedbsdk.asmdef new file mode 100644 index 000000000..ab9733e7b --- /dev/null +++ b/src/com.clockworklabs.spacetimedbsdk.asmdef @@ -0,0 +1,3 @@ +{ + "name": "com.clockworklabs.spacetimedbsdk" +} diff --git a/src/com.clockworklabs.spacetimedbsdk.asmdef.meta b/src/com.clockworklabs.spacetimedbsdk.asmdef.meta new file mode 100644 index 000000000..831582970 --- /dev/null +++ b/src/com.clockworklabs.spacetimedbsdk.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 51b18aaff8cb8384da535c99b8b52a6b +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/csc.rsp b/src/csc.rsp new file mode 100644 index 000000000..2d66b0292 --- /dev/null +++ b/src/csc.rsp @@ -0,0 +1 @@ +-nullable:enable diff --git a/src/csc.rsp.meta b/src/csc.rsp.meta new file mode 100644 index 000000000..f8faa3aae --- /dev/null +++ b/src/csc.rsp.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7e009052bf835774fb3593d29e4eb007 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/tests~/README.md b/tests~/README.md new file mode 100644 index 000000000..95f9a4003 --- /dev/null +++ b/tests~/README.md @@ -0,0 +1,20 @@ +# Running tests +You can use `dotnet test` (either in this directory or in the project root directory) to run the tests. + +# Using a different SpacetimeDB version +To run tests using a local version of the `SpacetimeDB` repo, you can add a `nuget.config` file in the **root** of this repository. + +The `tools/write-nuget-config.sh` script can generate the `nuget.config`. It takes one parameter: the path to the root SpacetimeDB repository (relative or absolute). + +Then, you need to `dotnet pack` the `BSATN.Runtime` package in the `SpacetimeDB` repo. + +Lastly, before running `dotnet test`, you should `dotnet nuget locals all --clear` to clear out any cached packages. This ensures you're actually testing with the new package you just built. + +Example: +```bash +$ export SPACETIMEDB_REPO_PATH="../SpacetimeDB" +$ tools/write-nuget-config.sh "${SPACETIMEDB_REPO_PATH}" +$ ( cd "${SPACETIMEDB_REPO_PATH}"/crates/bindings-csharp/BSATN.Runtime && dotnet pack ) +$ dotnet nuget locals all --clear +$ dotnet test +``` diff --git a/tests~/SnapshotTests.VerifySampleDump_dumpName=LegacySubscribeAll.verified.txt b/tests~/SnapshotTests.VerifySampleDump_dumpName=LegacySubscribeAll.verified.txt new file mode 100644 index 000000000..1287a5fde --- /dev/null +++ b/tests~/SnapshotTests.VerifySampleDump_dumpName=LegacySubscribeAll.verified.txt @@ -0,0 +1,436 @@ +{ + Events: { + Log: SpacetimeDBClient: Connecting to wss://spacetimedb.com example, + OnConnect: { + identity: Identity_1, + token: eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJoZXhfaWRlbnRpdHkiOiJjMjAwNDgzMTUyZDY0MmM3ZDQwMmRlMDZjYWNjMzZkY2IwYzJhMWYyYmJlYjhlN2Q1YTY3M2YyNDM1Y2NhOTc1Iiwic3ViIjoiNmQ0YjU0MzAtMDBjZi00YTk5LTkzMmMtYWQyZDA3YmFiODQxIiwiaXNzIjoibG9jYWxob3N0IiwiYXVkIjpbInNwYWNldGltZWRiIl0sImlhdCI6MTczNzY2NTc2OSwiZXhwIjpudWxsfQ.GaKhvswWYW6wpPpK70_-Tw8DKjKJ2qnidwwj1fTUf3mctcsm_UusPYSws_pSW3qGnMNnGjEXt7rRNvGvuWf9ow + }, + OnInsertUser: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.SubscribeApplied + }, + Db: {Scrubbed} + }, + user: { + identity: Identity_1, + online: true + } + }, + LogException: Unknown reducer unknown-reducer (Parameter 'Reducer'), + OnInsertUser: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_1, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_2, + CallerAddress: Guid_1, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.StdbIdentityConnected + } + } + }, + Db: {Scrubbed} + }, + user: { + identity: Identity_2, + online: true + } + }, + OnUpdateUser: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_2, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerAddress: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SetName, + name: A + } + } + }, + Db: {Scrubbed} + }, + oldUser: { + identity: Identity_1, + online: true + }, + newUser: { + identity: Identity_1, + name: A, + online: true + } + }, + OnSetName: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_2, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerAddress: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SetName, + name: A + } + } + }, + Db: {Scrubbed} + }, + OnInsertMessage: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_3, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_2, + CallerAddress: Guid_1, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Hello, A! + } + } + }, + Db: {Scrubbed} + }, + message: { + sender: Identity_2, + sent: 1718487775346381, + text: Hello, A! + } + }, + OnSendMessage: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_3, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_2, + CallerAddress: Guid_1, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Hello, A! + } + } + }, + Db: {Scrubbed} + }, + OnUpdateUser: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_4, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_2, + CallerAddress: Guid_1, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SetName, + name: B + } + } + }, + Db: {Scrubbed} + }, + oldUser: { + identity: Identity_2, + online: true + }, + newUser: { + identity: Identity_2, + name: B, + online: true + } + }, + OnSetName: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_4, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_2, + CallerAddress: Guid_1, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SetName, + name: B + } + } + }, + Db: {Scrubbed} + }, + OnInsertMessage: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_5, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerAddress: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Hello, B! + } + } + }, + Db: {Scrubbed} + }, + message: { + sender: Identity_1, + sent: 1718487783175083, + text: Hello, B! + } + }, + OnSendMessage: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_5, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerAddress: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Hello, B! + } + } + }, + Db: {Scrubbed} + }, + OnInsertMessage: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_6, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_2, + CallerAddress: Guid_1, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Goodbye! + } + } + }, + Db: {Scrubbed} + }, + message: { + sender: Identity_2, + sent: 1718487787645364, + text: Goodbye! + } + }, + OnSendMessage: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_6, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_2, + CallerAddress: Guid_1, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Goodbye! + } + } + }, + Db: {Scrubbed} + }, + OnUpdateUser: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_7, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_2, + CallerAddress: Guid_1, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.StdbIdentityDisconnected + } + } + }, + Db: {Scrubbed} + }, + oldUser: { + identity: Identity_2, + name: B, + online: true + }, + newUser: { + identity: Identity_2, + name: B, + online: false + } + }, + OnInsertMessage: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_8, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerAddress: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Goodbye! + } + } + }, + Db: {Scrubbed} + }, + message: { + sender: Identity_1, + sent: 1718487794937841, + text: Goodbye! + } + }, + OnSendMessage: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_8, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerAddress: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Goodbye! + } + } + }, + Db: {Scrubbed} + } + }, + FinalSnapshot: { + User: [ + { + identity: Identity_1, + name: A, + online: true + }, + { + identity: Identity_2, + name: B, + online: false + } + ], + Message: [ + { + sender: Identity_2, + sent: 1718487775346381, + text: Hello, A! + }, + { + sender: Identity_1, + sent: 1718487783175083, + text: Hello, B! + }, + { + sender: Identity_2, + sent: 1718487787645364, + text: Goodbye! + }, + { + sender: Identity_1, + sent: 1718487794937841, + text: Goodbye! + } + ] + }, + Stats: { + ReducerRequestTracker: { + sampleCount: 3, + requestsAwaitingResponse: 6 + }, + OneOffRequestTracker: {}, + SubscriptionRequestTracker: { + sampleCount: 1 + }, + AllReducersTracker: { + sampleCount: 9 + }, + ParseMessageTracker: { + sampleCount: 10 + } + } +} \ No newline at end of file diff --git a/tests~/SnapshotTests.VerifySampleDump_dumpName=SubscribeApplied.verified.txt b/tests~/SnapshotTests.VerifySampleDump_dumpName=SubscribeApplied.verified.txt new file mode 100644 index 000000000..ac7699011 --- /dev/null +++ b/tests~/SnapshotTests.VerifySampleDump_dumpName=SubscribeApplied.verified.txt @@ -0,0 +1,558 @@ +{ + Events: { + Log: SpacetimeDBClient: Connecting to wss://spacetimedb.com example, + OnConnect: { + identity: Identity_1, + token: eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJoZXhfaWRlbnRpdHkiOiJjMjAwNDgzMTUyZDY0MmM3ZDQwMmRlMDZjYWNjMzZkY2IwYzJhMWYyYmJlYjhlN2Q1YTY3M2YyNDM1Y2NhOTc1Iiwic3ViIjoiNmQ0YjU0MzAtMDBjZi00YTk5LTkzMmMtYWQyZDA3YmFiODQxIiwiaXNzIjoibG9jYWxob3N0IiwiYXVkIjpbInNwYWNldGltZWRiIl0sImlhdCI6MTczNzY2NTc2OSwiZXhwIjpudWxsfQ.GaKhvswWYW6wpPpK70_-Tw8DKjKJ2qnidwwj1fTUf3mctcsm_UusPYSws_pSW3qGnMNnGjEXt7rRNvGvuWf9ow + }, + OnInsertUser: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.SubscribeApplied + }, + Db: {Scrubbed} + }, + user: { + identity: Identity_1, + online: true + } + }, + LogException: Unknown reducer unknown-reducer (Parameter 'Reducer'), + OnInsertUser: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_1, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_2, + CallerAddress: Guid_1, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.StdbIdentityConnected + } + } + }, + Db: {Scrubbed} + }, + user: { + identity: Identity_2, + online: true + } + }, + OnUpdateUser: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_2, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerAddress: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SetName, + name: A + } + } + }, + Db: {Scrubbed} + }, + oldUser: { + identity: Identity_1, + online: true + }, + newUser: { + identity: Identity_1, + name: A, + online: true + } + }, + OnSetName: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_2, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerAddress: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SetName, + name: A + } + } + }, + Db: {Scrubbed} + }, + OnInsertMessage: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_3, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_2, + CallerAddress: Guid_1, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Hello, A! + } + } + }, + Db: {Scrubbed} + }, + message: { + sender: Identity_2, + sent: 1718487775346381, + text: Hello, A! + } + }, + OnSendMessage: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_3, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_2, + CallerAddress: Guid_1, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Hello, A! + } + } + }, + Db: {Scrubbed} + }, + OnUpdateUser: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_4, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_2, + CallerAddress: Guid_1, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SetName, + name: B + } + } + }, + Db: {Scrubbed} + }, + oldUser: { + identity: Identity_2, + online: true + }, + newUser: { + identity: Identity_2, + name: B, + online: true + } + }, + OnSetName: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_4, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_2, + CallerAddress: Guid_1, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SetName, + name: B + } + } + }, + Db: {Scrubbed} + }, + OnInsertMessage: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_5, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerAddress: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Hello, B! + } + } + }, + Db: {Scrubbed} + }, + message: { + sender: Identity_1, + sent: 1718487783175083, + text: Hello, B! + } + }, + OnSendMessage: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_5, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerAddress: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Hello, B! + } + } + }, + Db: {Scrubbed} + }, + OnInsertMessage: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_6, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_2, + CallerAddress: Guid_1, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Goodbye! + } + } + }, + Db: {Scrubbed} + }, + message: { + sender: Identity_2, + sent: 1718487787645364, + text: Goodbye! + } + }, + OnSendMessage: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_6, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_2, + CallerAddress: Guid_1, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Goodbye! + } + } + }, + Db: {Scrubbed} + }, + OnUpdateUser: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_7, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_2, + CallerAddress: Guid_1, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.StdbIdentityDisconnected + } + } + }, + Db: {Scrubbed} + }, + oldUser: { + identity: Identity_2, + name: B, + online: true + }, + newUser: { + identity: Identity_2, + name: B, + online: false + } + }, + OnInsertMessage: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_8, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerAddress: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Goodbye! + } + } + }, + Db: {Scrubbed} + }, + message: { + sender: Identity_1, + sent: 1718487794937841, + text: Goodbye! + } + }, + OnSendMessage: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.Reducer, + ReducerEvent: { + Timestamp: DateTimeOffset_8, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerAddress: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Goodbye! + } + } + }, + Db: {Scrubbed} + }, + OnDeleteMessage: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.UnsubscribeApplied + }, + Db: {Scrubbed} + }, + message: { + sender: Identity_2, + sent: 1718487775346381, + text: Hello, A! + } + }, + OnDeleteMessage: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.UnsubscribeApplied + }, + Db: {Scrubbed} + }, + message: { + sender: Identity_1, + sent: 1718487783175083, + text: Hello, B! + } + }, + OnDeleteMessage: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.UnsubscribeApplied + }, + Db: {Scrubbed} + }, + message: { + sender: Identity_2, + sent: 1718487787645364, + text: Goodbye! + } + }, + OnDeleteMessage: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.UnsubscribeApplied + }, + Db: {Scrubbed} + }, + message: { + sender: Identity_1, + sent: 1718487794937841, + text: Goodbye! + } + }, + LogWarning: Subscription Error: $bad query dude, + OnInsertMessage: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.SubscribeApplied + }, + Db: {Scrubbed} + }, + message: { + sender: Identity_2, + sent: 1718487775346381, + text: Hello, A! + } + }, + OnInsertMessage: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.SubscribeApplied + }, + Db: {Scrubbed} + }, + message: { + sender: Identity_1, + sent: 1718487783175083, + text: Hello, B! + } + }, + OnInsertMessage: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.SubscribeApplied + }, + Db: {Scrubbed} + }, + message: { + sender: Identity_2, + sent: 1718487787645364, + text: Goodbye! + } + }, + OnInsertMessage: { + eventContext: { + Reducers: {Scrubbed}, + SetReducerFlags: {}, + Event: { + $type: Event.SubscribeApplied + }, + Db: {Scrubbed} + }, + message: { + sender: Identity_1, + sent: 1718487794937841, + text: Goodbye! + } + } + }, + FinalSnapshot: { + User: [ + { + identity: Identity_1, + name: A, + online: true + }, + { + identity: Identity_2, + name: B, + online: false + } + ], + Message: [ + { + sender: Identity_1, + sent: 1718487794937841, + text: Goodbye! + }, + { + sender: Identity_2, + sent: 1718487787645364, + text: Goodbye! + }, + { + sender: Identity_1, + sent: 1718487783175083, + text: Hello, B! + }, + { + sender: Identity_2, + sent: 1718487775346381, + text: Hello, A! + } + ] + }, + Stats: { + ReducerRequestTracker: { + sampleCount: 3, + requestsAwaitingResponse: 6 + }, + OneOffRequestTracker: {}, + SubscriptionRequestTracker: { + sampleCount: 1, + requestsAwaitingResponse: 2 + }, + AllReducersTracker: { + sampleCount: 9 + }, + ParseMessageTracker: { + sampleCount: 14 + } + } +} \ No newline at end of file diff --git a/tests~/SnapshotTests.cs b/tests~/SnapshotTests.cs new file mode 100644 index 000000000..df57fde30 --- /dev/null +++ b/tests~/SnapshotTests.cs @@ -0,0 +1,542 @@ +namespace SpacetimeDB.Tests; + +using System.IO.Compression; +using SpacetimeDB.BSATN; +using SpacetimeDB.ClientApi; +using SpacetimeDB.Types; +using Xunit; + +using U128 = SpacetimeDB.U128; + +public class SnapshotTests +{ + class Events : List> + { + private bool frozen; + + public void Add(string name, object? value = null) + { + if (frozen) + { + throw new InvalidOperationException("This is a bug. We have snapshotted the events and don't expect any more to arrive."); + } + base.Add(new(name, value)); + } + + public void Freeze() + { + frozen = true; + } + } + + class EventsConverter : WriteOnlyJsonConverter + { + public override void Write(VerifyJsonWriter writer, Events events) + { + writer.WriteStartObject(); + foreach (var (name, value) in events) + { + writer.WriteMember(events, value, name); + } + writer.WriteEndObject(); + } + } + + class TimestampConverter : WriteOnlyJsonConverter + { + public override void Write(VerifyJsonWriter writer, Timestamp timestamp) + { + writer.WriteValue(timestamp.Microseconds); + } + } + + class EnergyQuantaConverter : WriteOnlyJsonConverter + { + public override void Write(VerifyJsonWriter writer, EnergyQuanta value) + { + writer.WriteRawValueIfNoStrict(value.Quanta.ToString()); + } + } + + class TestLogger(Events events) : ISpacetimeDBLogger + { + public void Debug(string message) + { + events.Add("Debug", message); + } + + public void Trace(string message) + { + events.Add("Trace", message); + } + + public void Info(string message) + { + events.Add("Log", message); + } + + public void Warn(string message) + { + events.Add("LogWarning", message); + } + + public void Error(string message) + { + events.Add("LogError", message); + } + + public void Exception(string message) + { + events.Add("LogException", message); + } + + public void Exception(Exception e) + { + events.Add("LogException", e.Message); + } + } + + private static ServerMessage.IdentityToken SampleId(string identity, string token, string address) => + new(new() + { + Identity = Identity.From(Convert.FromBase64String(identity)), + Token = token, + Address = Address.From(Convert.FromBase64String(address)) ?? throw new InvalidDataException("address") + }); + + private static ServerMessage.InitialSubscription SampleLegacyInitialSubscription( + uint requestId, + ulong hostExecutionDuration, + List updates + ) => new(new() + { + RequestId = requestId, + TotalHostExecutionDurationMicros = hostExecutionDuration, + DatabaseUpdate = new DatabaseUpdate + { + Tables = updates + } + }); + + private static ServerMessage.SubscribeApplied SampleSubscribeApplied( + uint requestId, + uint queryId, + ulong hostExecutionDuration, + TableUpdate tableUpdate + ) => new(new() + { + RequestId = requestId, + TotalHostExecutionDurationMicros = hostExecutionDuration, + QueryId = new(queryId), + Rows = new() + { + // This message contains redundant data, shrug. + // Copy out the redundant fields. + TableId = tableUpdate.TableId, + TableName = tableUpdate.TableName, + TableRows = tableUpdate + } + }); + + private static ServerMessage.UnsubscribeApplied SampleUnsubscribeApplied( + uint requestId, + uint queryId, + ulong hostExecutionDuration, + TableUpdate tableUpdate + ) => new(new() + { + RequestId = requestId, + TotalHostExecutionDurationMicros = hostExecutionDuration, + QueryId = new(queryId), + Rows = new() + { + // This message contains redundant data, shrug. + // Copy out the redundant fields. + TableId = tableUpdate.TableId, + TableName = tableUpdate.TableName, + TableRows = tableUpdate + } + }); + + private static ServerMessage.SubscriptionError SampleSubscriptionError( + uint? requestId, + uint? queryId, + uint? tableId, + string error, + ulong hostExecutionDuration + ) => new(new() + { + RequestId = requestId, + QueryId = queryId, + TableId = tableId, + Error = error, + TotalHostExecutionDurationMicros = hostExecutionDuration, + }); + + private static ServerMessage.TransactionUpdate SampleTransactionUpdate( + ulong timestamp, + string callerIdentity, + string callerAddress, + uint requestId, + string reducerName, + ulong energyQuantaUsed, + ulong hostExecutionDuration, + List updates, + byte[]? args + ) => new(new() + { + Timestamp = new Timestamp { Microseconds = timestamp }, + CallerIdentity = Identity.From(Convert.FromBase64String(callerIdentity)), + CallerAddress = Address.From(Convert.FromBase64String(callerAddress)) ?? throw new InvalidDataException("callerAddress"), + HostExecutionDurationMicros = hostExecutionDuration, + EnergyQuantaUsed = new() + { + Quanta = new U128(0, energyQuantaUsed), + }, + ReducerCall = new() + { + RequestId = requestId, + ReducerName = reducerName, + Args = [.. (args ?? [])] + }, + Status = new UpdateStatus.Committed(new() + { + Tables = updates + }) + }); + + private static TableUpdate SampleUpdate( + uint tableId, + string tableName, + List inserts, + List deletes + ) where T : IStructuralReadWrite => new() + { + TableId = tableId, + TableName = tableName, + NumRows = (ulong)(inserts.Count + deletes.Count), + Updates = [new CompressableQueryUpdate.Uncompressed(new QueryUpdate( + EncodeRowList(deletes), EncodeRowList(inserts)))] + }; + + private static BsatnRowList EncodeRowList(in List list) where T : IStructuralReadWrite + { + var offsets = new List(); + var stream = new MemoryStream(); + var writer = new BinaryWriter(stream); + foreach (var elem in list) + { + offsets.Add((ulong)stream.Length); + elem.WriteFields(writer); + } + return new BsatnRowList + { + RowsData = stream.ToArray().ToList(), + SizeHint = new RowSizeHint.RowOffsets(offsets) + }; + } + + private static byte[] Encode(in T value) where T : IStructuralReadWrite + { + var o = new MemoryStream(); + var w = new BinaryWriter(o); + value.WriteFields(w); + return o.ToArray(); + } + + private static readonly uint USER_TABLE_ID = 4097; + private static readonly string USER_TABLE_NAME = "user"; + private static readonly uint MESSAGE_TABLE_ID = 4098; + private static readonly string MESSAGE_TABLE_NAME = "message"; + + + private static TableUpdate SampleUserInsert(string identity, string? name, bool online) => + SampleUpdate(USER_TABLE_ID, USER_TABLE_NAME, [new User + { + Identity = Identity.From(Convert.FromBase64String(identity)), + Name = name, + Online = online + }], []); + + private static TableUpdate SampleUserUpdate(string identity, string? oldName, string? newName, bool oldOnline, bool newOnline) => + SampleUpdate(USER_TABLE_ID, USER_TABLE_NAME, [new User + { + Identity = Identity.From(Convert.FromBase64String(identity)), + Name = newName, + Online = newOnline + }], [new User + { + Identity = Identity.From(Convert.FromBase64String(identity)), + Name = oldName, + Online = oldOnline + }]); + + + private static Message SampleMessage(string identity, ulong sent, string text) => new() + { + Sender = Identity.From(Convert.FromBase64String(identity)), + Sent = sent, + Text = text + }; + + private static TableUpdate SampleMessageInsert(List messages) => + SampleUpdate(MESSAGE_TABLE_ID, MESSAGE_TABLE_NAME, messages, []); + + private static TableUpdate SampleMessageDelete(List messages) => + SampleUpdate(MESSAGE_TABLE_ID, MESSAGE_TABLE_NAME, [], messages); + + public static IEnumerable SampleDump() + { + var sampleMessage0 = SampleMessage("l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", 1718487775346381, "Hello, A!"); + var sampleMessage1 = SampleMessage("j5DMlKmWjfbSl7qmZQOok7HDSwsAJopRSJjdlUsNogs=", 1718487783175083, "Hello, B!"); + var sampleMessage2 = SampleMessage("l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", 1718487787645364, "Goodbye!"); + var sampleMessage3 = SampleMessage("j5DMlKmWjfbSl7qmZQOok7HDSwsAJopRSJjdlUsNogs=", 1718487794937841, "Goodbye!"); + + yield return new object[] { "LegacySubscribeAll", + new ServerMessage[] { + SampleId( + "j5DMlKmWjfbSl7qmZQOok7HDSwsAJopRSJjdlUsNogs=", + "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJoZXhfaWRlbnRpdHkiOiJjMjAwNDgzMTUyZDY0MmM3ZDQwMmRlMDZjYWNjMzZkY2IwYzJhMWYyYmJlYjhlN2Q1YTY3M2YyNDM1Y2NhOTc1Iiwic3ViIjoiNmQ0YjU0MzAtMDBjZi00YTk5LTkzMmMtYWQyZDA3YmFiODQxIiwiaXNzIjoibG9jYWxob3N0IiwiYXVkIjpbInNwYWNldGltZWRiIl0sImlhdCI6MTczNzY2NTc2OSwiZXhwIjpudWxsfQ.GaKhvswWYW6wpPpK70_-Tw8DKjKJ2qnidwwj1fTUf3mctcsm_UusPYSws_pSW3qGnMNnGjEXt7rRNvGvuWf9ow", + "Vd4dFzcEzhLHJ6uNL8VXFg==" + ), + SampleLegacyInitialSubscription( + 1, 366, [SampleUserInsert("j5DMlKmWjfbSl7qmZQOok7HDSwsAJopRSJjdlUsNogs=", null, true)] + ), + SampleTransactionUpdate(0, "l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", "Kwmeu5riP20rvCTNbBipLA==", + 0, "unknown-reducer", 0, 40, [], null + ), + SampleTransactionUpdate( + 1718487763059031, "l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", "Kwmeu5riP20rvCTNbBipLA==", + 0, "__identity_connected__", 1957615, 66, [SampleUserInsert("l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", null, true)], + null + ), + SampleTransactionUpdate( + 1718487768057579, "j5DMlKmWjfbSl7qmZQOok7HDSwsAJopRSJjdlUsNogs=", "Vd4dFzcEzhLHJ6uNL8VXFg==", + 1, "set_name", 4345615, 70, [SampleUserUpdate("j5DMlKmWjfbSl7qmZQOok7HDSwsAJopRSJjdlUsNogs=", null, "A", true, true)], + Encode(new Reducer.SetName { Name = "A" }) + ), + SampleTransactionUpdate( + 1718487775346381, "l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", "Kwmeu5riP20rvCTNbBipLA==", + 1, "send_message", 2779615, 57, [SampleMessageInsert([ + sampleMessage0 + ])], + Encode(new Reducer.SendMessage { Text = "Hello, A!" }) + ), + SampleTransactionUpdate( + 1718487777307855, "l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", "Kwmeu5riP20rvCTNbBipLA==", + 2, "set_name", 4268615, 98, [SampleUserUpdate("l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", null, "B", true, true)], + Encode(new Reducer.SetName { Name = "B" }) + ), + SampleTransactionUpdate( + 1718487783175083, "j5DMlKmWjfbSl7qmZQOok7HDSwsAJopRSJjdlUsNogs=", "Vd4dFzcEzhLHJ6uNL8VXFg==", + 2, "send_message", 2677615, 40, [SampleMessageInsert([ + sampleMessage1 + ])], + Encode(new Reducer.SendMessage { Text = "Hello, B!" }) + ), + SampleTransactionUpdate( + 1718487787645364, "l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", "Kwmeu5riP20rvCTNbBipLA==", + 3, "send_message", 2636615, 28, [SampleMessageInsert([ + sampleMessage2 + ])], + Encode(new Reducer.SendMessage { Text = "Goodbye!" }) + ), + SampleTransactionUpdate( + 1718487791901504, "l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", "Kwmeu5riP20rvCTNbBipLA==", + 0, "__identity_disconnected__", 3595615, 75, [SampleUserUpdate("l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", "B", "B", true, false)], + null + ), + SampleTransactionUpdate( + 1718487794937841, "j5DMlKmWjfbSl7qmZQOok7HDSwsAJopRSJjdlUsNogs=", "Vd4dFzcEzhLHJ6uNL8VXFg==", + 3, "send_message", 2636615, 34, [SampleMessageInsert([ + sampleMessage3 + ])], + Encode(new Reducer.SendMessage { Text = "Goodbye!" }) + ), + } + }; + yield return new object[] { "SubscribeApplied", + new ServerMessage[] { + SampleId( + "j5DMlKmWjfbSl7qmZQOok7HDSwsAJopRSJjdlUsNogs=", + "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJoZXhfaWRlbnRpdHkiOiJjMjAwNDgzMTUyZDY0MmM3ZDQwMmRlMDZjYWNjMzZkY2IwYzJhMWYyYmJlYjhlN2Q1YTY3M2YyNDM1Y2NhOTc1Iiwic3ViIjoiNmQ0YjU0MzAtMDBjZi00YTk5LTkzMmMtYWQyZDA3YmFiODQxIiwiaXNzIjoibG9jYWxob3N0IiwiYXVkIjpbInNwYWNldGltZWRiIl0sImlhdCI6MTczNzY2NTc2OSwiZXhwIjpudWxsfQ.GaKhvswWYW6wpPpK70_-Tw8DKjKJ2qnidwwj1fTUf3mctcsm_UusPYSws_pSW3qGnMNnGjEXt7rRNvGvuWf9ow", + "Vd4dFzcEzhLHJ6uNL8VXFg==" + ), + SampleSubscribeApplied( + 1, 1, 366, SampleUserInsert("j5DMlKmWjfbSl7qmZQOok7HDSwsAJopRSJjdlUsNogs=", null, true) + ), + SampleSubscribeApplied( + 1, 2, 277, SampleUpdate(MESSAGE_TABLE_ID, MESSAGE_TABLE_NAME, [], []) + ), + SampleTransactionUpdate(0, "l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", "Kwmeu5riP20rvCTNbBipLA==", + 0, "unknown-reducer", 0, 40, [], null + ), + SampleTransactionUpdate( + 1718487763059031, "l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", "Kwmeu5riP20rvCTNbBipLA==", + 0, "__identity_connected__", 1957615, 66, [SampleUserInsert("l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", null, true)], + null + ), + SampleTransactionUpdate( + 1718487768057579, "j5DMlKmWjfbSl7qmZQOok7HDSwsAJopRSJjdlUsNogs=", "Vd4dFzcEzhLHJ6uNL8VXFg==", + 1, "set_name", 4345615, 70, [SampleUserUpdate("j5DMlKmWjfbSl7qmZQOok7HDSwsAJopRSJjdlUsNogs=", null, "A", true, true)], + Encode(new Reducer.SetName { Name = "A" }) + ), + SampleTransactionUpdate( + 1718487775346381, "l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", "Kwmeu5riP20rvCTNbBipLA==", + 1, "send_message", 2779615, 57, [SampleMessageInsert([ + sampleMessage0 + ])], + Encode(new Reducer.SendMessage { Text = "Hello, A!" }) + ), + SampleTransactionUpdate( + 1718487777307855, "l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", "Kwmeu5riP20rvCTNbBipLA==", + 2, "set_name", 4268615, 98, [SampleUserUpdate("l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", null, "B", true, true)], + Encode(new Reducer.SetName { Name = "B" }) + ), + SampleTransactionUpdate( + 1718487783175083, "j5DMlKmWjfbSl7qmZQOok7HDSwsAJopRSJjdlUsNogs=", "Vd4dFzcEzhLHJ6uNL8VXFg==", + 2, "send_message", 2677615, 40, [SampleMessageInsert([ + sampleMessage1 + ])], + Encode(new Reducer.SendMessage { Text = "Hello, B!" }) + ), + SampleTransactionUpdate( + 1718487787645364, "l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", "Kwmeu5riP20rvCTNbBipLA==", + 3, "send_message", 2636615, 28, [SampleMessageInsert([ + sampleMessage2 + ])], + Encode(new Reducer.SendMessage { Text = "Goodbye!" }) + ), + SampleTransactionUpdate( + 1718487791901504, "l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", "Kwmeu5riP20rvCTNbBipLA==", + 0, "__identity_disconnected__", 3595615, 75, [SampleUserUpdate("l0qzG1GPRtC1mwr+54q98tv0325gozLc6cNzq4vrzqY=", "B", "B", true, false)], + null + ), + SampleTransactionUpdate( + 1718487794937841, "j5DMlKmWjfbSl7qmZQOok7HDSwsAJopRSJjdlUsNogs=", "Vd4dFzcEzhLHJ6uNL8VXFg==", + 3, "send_message", 2636615, 34, [SampleMessageInsert([ + sampleMessage3 + ])], + Encode(new Reducer.SendMessage { Text = "Goodbye!" }) + ), + // Let's pretend the user unsubscribed from the table Messages... + SampleUnsubscribeApplied(0, + 2, 55, SampleMessageDelete([sampleMessage0, sampleMessage1, sampleMessage2, sampleMessage3])), + // Tried to resubscribe unsuccessfully... + SampleSubscriptionError(0, 3, MESSAGE_TABLE_ID, "bad query dude", 69), + // Then successfully resubscribed. + SampleSubscribeApplied(0, 4, 53, SampleMessageInsert([sampleMessage0, sampleMessage1, sampleMessage2, sampleMessage3])) + } + }; + + } + + [Theory] + [MemberData(nameof(SampleDump))] + public async Task VerifySampleDump(string dumpName, ServerMessage[] sampleDumpParsed) + { + var events = new Events(); + + Log.Current = new TestLogger(events); + + DbConnection.IsTesting = true; + + var client = + DbConnection.Builder() + .WithUri("wss://spacetimedb.com") + .WithModuleName("example") + .OnConnect((conn, identity, token) => events.Add("OnConnect", new { identity, token })) + .Build(); + + // But for proper testing we need to convert it back to raw binary messages as if it was received over network. + var sampleDumpBinary = sampleDumpParsed.Select( + (message, i) => + { + // Start tracking requests in the stats handler so that those request IDs can later be found. + switch (message) + { + case ServerMessage.InitialSubscription(var _): + client.stats.SubscriptionRequestTracker.StartTrackingRequest($"sample#{i}"); + break; + case ServerMessage.SubscribeApplied(var _): + client.stats.SubscriptionRequestTracker.StartTrackingRequest($"sample#{i}"); + break; + case ServerMessage.TransactionUpdate(var _): + client.stats.ReducerRequestTracker.StartTrackingRequest($"sample#{i}"); + break; + } + using var output = new MemoryStream(); + output.WriteByte(1); // Write compression tag. + using (var brotli = new BrotliStream(output, CompressionMode.Compress)) + { + using var w = new BinaryWriter(brotli); + new ServerMessage.BSATN().Write(w, message); + } + return output.ToArray(); + } + ); + +#pragma warning disable CS0612 // Using obsolete API + client.onUnhandledReducerError += (exception) => + events.Add("OnUnhandledReducerError", exception); +#pragma warning restore CS0612 // Using obsolete API + client.Reducers.OnSendMessage += (eventContext, _text) => + events.Add("OnSendMessage", eventContext); + client.Reducers.OnSetName += (eventContext, _name) => events.Add("OnSetName", eventContext); + + client.Db.User.OnDelete += (eventContext, user) => + events.Add("OnDeleteUser", new { eventContext, user }); + client.Db.User.OnInsert += (eventContext, user) => + events.Add("OnInsertUser", new { eventContext, user }); + client.Db.User.OnUpdate += (eventContext, oldUser, newUser) => + events.Add( + "OnUpdateUser", + new + { + eventContext, + oldUser, + newUser + } + ); + + client.Db.Message.OnDelete += (eventContext, message) => + events.Add("OnDeleteMessage", new { eventContext, message }); + client.Db.Message.OnInsert += (eventContext, message) => + events.Add("OnInsertMessage", new { eventContext, message }); + + // Simulate receiving WebSocket messages. + foreach (var sample in sampleDumpBinary) + { + client.OnMessageReceived(sample, DateTime.UtcNow); + // Wait for this message to be picked up by the background thread, preprocessed and stored in the preprocessed queue. + // Otherwise we'll get inconsistent output order between test reruns. + while (!client.HasPreProcessedMessage) { } + // Once the message is in the preprocessed queue, we can invoke Update() to handle events on the main thread. + client.FrameTick(); + } + + // Verify dumped events and the final client state. + events.Freeze(); + await Verify( + new + { + Events = events, + FinalSnapshot = new + { + User = client.Db.User.Iter().ToList(), + Message = client.Db.Message.Iter().ToList() + }, + Stats = client.stats + } + ) + .UseParameters(dumpName) + .AddExtraSettings(settings => settings.Converters.AddRange([ + new EventsConverter(), + new TimestampConverter(), + new EnergyQuantaConverter() + ])) + .ScrubMember(x => x.Status) + .ScrubMember>(x => x.Db) + .ScrubMember(x => x.Reducers); + } +} diff --git a/tests~/VerifyInit.cs b/tests~/VerifyInit.cs new file mode 100644 index 000000000..eab677634 --- /dev/null +++ b/tests~/VerifyInit.cs @@ -0,0 +1,81 @@ +namespace SpacetimeDB.Tests; + +using System.Runtime.CompilerServices; +using Argon; +using SpacetimeDB.Types; + +static class VerifyInit +{ + // A converter that scrubs identity to a stable string. + class IdentityConverter : WriteOnlyJsonConverter + { + private static readonly List seenIdentities = []; + + public override void Write(VerifyJsonWriter writer, Identity value) + { + var index = seenIdentities.IndexOf(value); + if (index == -1) + { + index = seenIdentities.Count; + seenIdentities.Add(value); + } + + writer.WriteValue($"Identity_{index + 1}"); + } + } + + class AddressConverter : WriteOnlyJsonConverter
+ { + public override void Write(VerifyJsonWriter writer, Address value) + { + // Addresses are GUIDs, which Verify scrubs automatically. + writer.WriteValue(value.ToString()); + } + } + + class NetworkRequestTrackerConverter : WriteOnlyJsonConverter + { + public override void Write(VerifyJsonWriter writer, NetworkRequestTracker value) + { + writer.WriteStartObject(); + + var sampleCount = value.GetSampleCount(); + if (sampleCount > 0) + { + writer.WriteMember(value, sampleCount, nameof(sampleCount)); + } + + var requestsAwaitingResponse = value.GetRequestsAwaitingResponse(); + if (requestsAwaitingResponse > 0) + { + writer.WriteMember( + value, + requestsAwaitingResponse, + nameof(requestsAwaitingResponse) + ); + } + + // We don't use the stats, since they are nondeterministic. + + writer.WriteEndObject(); + } + } + + [ModuleInitializer] + public static void Init() + { + Environment.SetEnvironmentVariable("DiffEngine_TargetOnLeft", "true"); + + VerifierSettings.AddExtraSettings(settings => + { + settings.Converters.AddRange( + [ + new IdentityConverter(), + new AddressConverter(), + new NetworkRequestTrackerConverter() + ] + ); + settings.TypeNameHandling = TypeNameHandling.Auto; + }); + } +} diff --git a/tests~/tests.csproj b/tests~/tests.csproj new file mode 100644 index 000000000..6845e9043 --- /dev/null +++ b/tests~/tests.csproj @@ -0,0 +1,29 @@ + + + + net8.0 + enable + enable + SpacetimeDB.Tests + + false + true + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + diff --git a/tools~/gen-client-api.bat b/tools~/gen-client-api.bat new file mode 100644 index 000000000..23196f94b --- /dev/null +++ b/tools~/gen-client-api.bat @@ -0,0 +1,20 @@ +@echo off +setlocal + +if "%CL_HOME%"=="" ( + echo "Variable CL_HOME not set" + exit /b 1 +) + +cd %CL_HOME%\SpacetimeDB\crates\client-api-messages +cargo run --example get_ws_schema > %CL_HOME%/schema.json + +cd %CL_HOME%\SpacetimeDB\crates\cli +cargo run -- generate -l csharp --namespace SpacetimeDB.ClientApi ^ + --module-def %CL_HOME%\schema.json ^ + -o %CL_HOME%\spacetimedb-csharp-sdk\src\SpacetimeDB\ClientApi + +cd %CL_HOME%\spacetimedb-csharp-sdk\src\SpacetimeDB\ClientApi +del /q _Globals + +del %CL_HOME%\schema.json diff --git a/tools~/gen-client-api.sh b/tools~/gen-client-api.sh new file mode 100755 index 000000000..a34fd0d66 --- /dev/null +++ b/tools~/gen-client-api.sh @@ -0,0 +1,11 @@ +set -ueo pipefail + +STDB_PATH="$1" +SDK_PATH="$(dirname "$0")/.." + +cargo run --manifest-path $STDB_PATH/crates/client-api-messages/Cargo.toml --example get_ws_schema | +cargo run --manifest-path $STDB_PATH/crates/cli/Cargo.toml -- generate -l csharp --namespace SpacetimeDB.ClientApi \ + --module-def \ + -o $SDK_PATH/src/SpacetimeDB/ClientApi + +rm -rf $SDK_PATH/src/SpacetimeDB/ClientApi/_Globals diff --git a/tools~/write-nuget-config.sh b/tools~/write-nuget-config.sh new file mode 100755 index 000000000..1655fc96b --- /dev/null +++ b/tools~/write-nuget-config.sh @@ -0,0 +1,35 @@ +set -ueo pipefail + +SPACETIMEDB_REPO_PATH="$1" + +cd "$(dirname "$(readlink -f "$0")")" +cd .. + +# Write out the nuget config file to `nuget.config`. This causes the spacetimedb-csharp-sdk repository +# to be aware of the local versions of the `bindings-csharp` packages in SpacetimeDB, and use them if +# available. +# See https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file for more info on the config file, +# and https://tldp.org/LDP/abs/html/here-docs.html for more info on this bash feature. +cat >nuget.config < + + + + + + + + + + + + + + + + + +EOF + +echo "Wrote nuget.config contents:" +cat nuget.config diff --git a/unity-tests~ b/unity-tests~ new file mode 160000 index 000000000..a8d9e3598 --- /dev/null +++ b/unity-tests~ @@ -0,0 +1 @@ +Subproject commit a8d9e359875ad22b409fda8be204e53d2d7b96e7