@dcl/protocol 1.0.0-27226386025.commit-c056d32 → 1.0.0-27358757907.commit-3c70e8a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,35 @@
1
+ // Decentraland.Networking.Bitwise — Quantize
2
+ // Copy this file into your project alongside generated *.Bitwise.cs files.
3
+ // ReSharper disable once RedundantUsingDirective
4
+
5
+ using System;
6
+
7
+ namespace Decentraland.Networking.Bitwise
8
+ // ReSharper disable once ArrangeNamespaceBody
9
+ {
10
+ /// <summary>
11
+ /// Static helpers for quantizing float values to/from unsigned integers.
12
+ /// Intended for use with protobuf uint32 fields: the integer is transmitted
13
+ /// as a protobuf varint, while the float accessor lives in a generated partial class.
14
+ /// </summary>
15
+ public static class Quantize
16
+ {
17
+ /// <summary>
18
+ /// Encodes <paramref name="value" /> to a quantized <see cref="uint" />.
19
+ /// Values outside [<paramref name="min" />, <paramref name="max" />] are clamped.
20
+ /// </summary>
21
+ public static uint Encode(float value, float min, float max, int bits)
22
+ {
23
+ var steps = (1u << bits) - 1;
24
+ var t = Math.Clamp((value - min) / (max - min), 0f, 1f);
25
+ return (uint)MathF.Round(t * steps);
26
+ }
27
+
28
+ /// <summary>Decodes a quantized <see cref="uint" /> back to a float.</summary>
29
+ public static float Decode(uint encoded, float min, float max, int bits)
30
+ {
31
+ var steps = (1u << bits) - 1;
32
+ return (float)encoded / steps * (max - min) + min;
33
+ }
34
+ }
35
+ }
package/proto/buf.yaml DELETED
@@ -1,47 +0,0 @@
1
- version: v1
2
- breaking:
3
- use:
4
- - WIRE_JSON
5
- ignore:
6
- - google
7
- lint:
8
- use:
9
- - DIRECTORY_SAME_PACKAGE
10
- - PACKAGE_DEFINED
11
- - PACKAGE_DIRECTORY_MATCH
12
- - PACKAGE_SAME_DIRECTORY
13
- - ENUM_PASCAL_CASE
14
- - ENUM_VALUE_UPPER_SNAKE_CASE
15
- - FIELD_LOWER_SNAKE_CASE
16
- - MESSAGE_PASCAL_CASE
17
- - ONEOF_LOWER_SNAKE_CASE
18
- - PACKAGE_LOWER_SNAKE_CASE
19
- - RPC_PASCAL_CASE
20
- - SERVICE_PASCAL_CASE
21
- - PACKAGE_SAME_CSHARP_NAMESPACE
22
- - PACKAGE_SAME_GO_PACKAGE
23
- - PACKAGE_SAME_JAVA_MULTIPLE_FILES
24
- - PACKAGE_SAME_JAVA_PACKAGE
25
- - PACKAGE_SAME_PHP_NAMESPACE
26
- - PACKAGE_SAME_RUBY_PACKAGE
27
- - PACKAGE_SAME_SWIFT_PREFIX
28
- - ENUM_FIRST_VALUE_ZERO
29
- - ENUM_NO_ALLOW_ALIAS
30
- - IMPORT_NO_WEAK
31
- - IMPORT_NO_PUBLIC
32
- - IMPORT_USED
33
- - FILE_LOWER_SNAKE_CASE
34
- # Ignored:the default value is used
35
- # - ENUM_ZERO_VALUE_SUFFIX
36
- # Ignored: if a prefix is needed in the target language, implement a preprocessor
37
- # - ENUM_VALUE_PREFIX
38
- # Not wished
39
- # - PACKAGE_VERSION_SUFFIX
40
- # TODO: See if this needs to be added
41
- # - RPC_REQUEST_RESPONSE_UNIQUE
42
- # - RPC_REQUEST_STANDARD_NAME
43
- # - RPC_RESPONSE_STANDARD_NAME
44
- # - SERVICE_SUFFIX
45
- ignore:
46
- - google
47
- - decentraland/renderer/engine_interface.proto
@@ -1,27 +0,0 @@
1
- Copyright 2014, Google Inc. All rights reserved.
2
-
3
- Redistribution and use in source and binary forms, with or without
4
- modification, are permitted provided that the following conditions are
5
- met:
6
-
7
- * Redistributions of source code must retain the above copyright
8
- notice, this list of conditions and the following disclaimer.
9
- * Redistributions in binary form must reproduce the above
10
- copyright notice, this list of conditions and the following disclaimer
11
- in the documentation and/or other materials provided with the
12
- distribution.
13
- * Neither the name of Google Inc. nor the names of its
14
- contributors may be used to endorse or promote products derived from
15
- this software without specific prior written permission.
16
-
17
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1 +0,0 @@
1
- This folder contains stripped and pre-parsed definitions of common Google types. These files are not used by protobuf.js directly but are here so you can use or include them where required.
@@ -1,83 +0,0 @@
1
- {
2
- "nested": {
3
- "google": {
4
- "nested": {
5
- "api": {
6
- "nested": {
7
- "http": {
8
- "type": "HttpRule",
9
- "id": 72295728,
10
- "extend": "google.protobuf.MethodOptions"
11
- },
12
- "HttpRule": {
13
- "oneofs": {
14
- "pattern": {
15
- "oneof": [
16
- "get",
17
- "put",
18
- "post",
19
- "delete",
20
- "patch",
21
- "custom"
22
- ]
23
- }
24
- },
25
- "fields": {
26
- "get": {
27
- "type": "string",
28
- "id": 2
29
- },
30
- "put": {
31
- "type": "string",
32
- "id": 3
33
- },
34
- "post": {
35
- "type": "string",
36
- "id": 4
37
- },
38
- "delete": {
39
- "type": "string",
40
- "id": 5
41
- },
42
- "patch": {
43
- "type": "string",
44
- "id": 6
45
- },
46
- "custom": {
47
- "type": "CustomHttpPattern",
48
- "id": 8
49
- },
50
- "selector": {
51
- "type": "string",
52
- "id": 1
53
- },
54
- "body": {
55
- "type": "string",
56
- "id": 7
57
- },
58
- "additionalBindings": {
59
- "rule": "repeated",
60
- "type": "HttpRule",
61
- "id": 11
62
- }
63
- }
64
- }
65
- }
66
- },
67
- "protobuf": {
68
- "nested": {
69
- "MethodOptions": {
70
- "fields": {},
71
- "extensions": [
72
- [
73
- 1000,
74
- 536870911
75
- ]
76
- ]
77
- }
78
- }
79
- }
80
- }
81
- }
82
- }
83
- }
@@ -1,11 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package google.api;
4
-
5
- import "google/api/http.proto";
6
- import "google/protobuf/descriptor.proto";
7
-
8
- extend google.protobuf.MethodOptions {
9
-
10
- HttpRule http = 72295728;
11
- }
@@ -1,86 +0,0 @@
1
- {
2
- "nested": {
3
- "google": {
4
- "nested": {
5
- "api": {
6
- "nested": {
7
- "Http": {
8
- "fields": {
9
- "rules": {
10
- "rule": "repeated",
11
- "type": "HttpRule",
12
- "id": 1
13
- }
14
- }
15
- },
16
- "HttpRule": {
17
- "oneofs": {
18
- "pattern": {
19
- "oneof": [
20
- "get",
21
- "put",
22
- "post",
23
- "delete",
24
- "patch",
25
- "custom"
26
- ]
27
- }
28
- },
29
- "fields": {
30
- "get": {
31
- "type": "string",
32
- "id": 2
33
- },
34
- "put": {
35
- "type": "string",
36
- "id": 3
37
- },
38
- "post": {
39
- "type": "string",
40
- "id": 4
41
- },
42
- "delete": {
43
- "type": "string",
44
- "id": 5
45
- },
46
- "patch": {
47
- "type": "string",
48
- "id": 6
49
- },
50
- "custom": {
51
- "type": "CustomHttpPattern",
52
- "id": 8
53
- },
54
- "selector": {
55
- "type": "string",
56
- "id": 1
57
- },
58
- "body": {
59
- "type": "string",
60
- "id": 7
61
- },
62
- "additionalBindings": {
63
- "rule": "repeated",
64
- "type": "HttpRule",
65
- "id": 11
66
- }
67
- }
68
- },
69
- "CustomHttpPattern": {
70
- "fields": {
71
- "kind": {
72
- "type": "string",
73
- "id": 1
74
- },
75
- "path": {
76
- "type": "string",
77
- "id": 2
78
- }
79
- }
80
- }
81
- }
82
- }
83
- }
84
- }
85
- }
86
- }
@@ -1,31 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package google.api;
4
-
5
- message Http {
6
-
7
- repeated HttpRule rules = 1;
8
- }
9
-
10
- message HttpRule {
11
-
12
- oneof pattern {
13
-
14
- string get = 2;
15
- string put = 3;
16
- string post = 4;
17
- string delete = 5;
18
- string patch = 6;
19
- CustomHttpPattern custom = 8;
20
- }
21
-
22
- string selector = 1;
23
- string body = 7;
24
- repeated HttpRule additional_bindings = 11;
25
- }
26
-
27
- message CustomHttpPattern {
28
-
29
- string kind = 1;
30
- string path = 2;
31
- }
@@ -1,118 +0,0 @@
1
- {
2
- "nested": {
3
- "google": {
4
- "nested": {
5
- "protobuf": {
6
- "nested": {
7
- "Api": {
8
- "fields": {
9
- "name": {
10
- "type": "string",
11
- "id": 1
12
- },
13
- "methods": {
14
- "rule": "repeated",
15
- "type": "Method",
16
- "id": 2
17
- },
18
- "options": {
19
- "rule": "repeated",
20
- "type": "Option",
21
- "id": 3
22
- },
23
- "version": {
24
- "type": "string",
25
- "id": 4
26
- },
27
- "sourceContext": {
28
- "type": "SourceContext",
29
- "id": 5
30
- },
31
- "mixins": {
32
- "rule": "repeated",
33
- "type": "Mixin",
34
- "id": 6
35
- },
36
- "syntax": {
37
- "type": "Syntax",
38
- "id": 7
39
- }
40
- }
41
- },
42
- "Method": {
43
- "fields": {
44
- "name": {
45
- "type": "string",
46
- "id": 1
47
- },
48
- "requestTypeUrl": {
49
- "type": "string",
50
- "id": 2
51
- },
52
- "requestStreaming": {
53
- "type": "bool",
54
- "id": 3
55
- },
56
- "responseTypeUrl": {
57
- "type": "string",
58
- "id": 4
59
- },
60
- "responseStreaming": {
61
- "type": "bool",
62
- "id": 5
63
- },
64
- "options": {
65
- "rule": "repeated",
66
- "type": "Option",
67
- "id": 6
68
- },
69
- "syntax": {
70
- "type": "Syntax",
71
- "id": 7
72
- }
73
- }
74
- },
75
- "Mixin": {
76
- "fields": {
77
- "name": {
78
- "type": "string",
79
- "id": 1
80
- },
81
- "root": {
82
- "type": "string",
83
- "id": 2
84
- }
85
- }
86
- },
87
- "SourceContext": {
88
- "fields": {
89
- "fileName": {
90
- "type": "string",
91
- "id": 1
92
- }
93
- }
94
- },
95
- "Option": {
96
- "fields": {
97
- "name": {
98
- "type": "string",
99
- "id": 1
100
- },
101
- "value": {
102
- "type": "Any",
103
- "id": 2
104
- }
105
- }
106
- },
107
- "Syntax": {
108
- "values": {
109
- "SYNTAX_PROTO2": 0,
110
- "SYNTAX_PROTO3": 1
111
- }
112
- }
113
- }
114
- }
115
- }
116
- }
117
- }
118
- }
@@ -1,34 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package google.protobuf;
4
-
5
- import "google/protobuf/source_context.proto";
6
- import "google/protobuf/type.proto";
7
-
8
- message Api {
9
-
10
- string name = 1;
11
- repeated Method methods = 2;
12
- repeated Option options = 3;
13
- string version = 4;
14
- SourceContext source_context = 5;
15
- repeated Mixin mixins = 6;
16
- Syntax syntax = 7;
17
- }
18
-
19
- message Method {
20
-
21
- string name = 1;
22
- string request_type_url = 2;
23
- bool request_streaming = 3;
24
- string response_type_url = 4;
25
- bool response_streaming = 5;
26
- repeated Option options = 6;
27
- Syntax syntax = 7;
28
- }
29
-
30
- message Mixin {
31
-
32
- string name = 1;
33
- string root = 2;
34
- }