krpctools 0.5.0__zip → 0.5.4__zip
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.
- {krpctools-0.5.0 → krpctools-0.5.4}/CHANGES.txt +6 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/COPYING +4 -4
- {krpctools-0.5.0 → krpctools-0.5.4}/LICENSE +1 -1
- {krpctools-0.5.0 → krpctools-0.5.4}/PKG-INFO +1 -1
- krpctools-0.5.4/VERSION.txt +1 -0
- krpctools-0.5.4/krpctools/bin/Google.Protobuf.dll +0 -0
- krpctools-0.5.4/krpctools/bin/KRPC.Core.dll +0 -0
- krpctools-0.5.0/krpctools/bin/KRPC.xml → krpctools-0.5.4/krpctools/bin/KRPC.Core.xml +1166 -1427
- krpctools-0.5.4/krpctools/bin/KRPC.IO.Ports.dll +0 -0
- krpctools-0.5.4/krpctools/bin/Newtonsoft.Json.dll +0 -0
- krpctools-0.5.4/krpctools/bin/ServiceDefinitions.exe +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/bin/System.Core.dll +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/bin/System.Xml.dll +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/bin/System.dll +0 -0
- krpctools-0.5.4/krpctools/bin/TestServer-0.5.4.zip +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/bin/mscorlib.dll +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/generator.py +3 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/python.py +118 -39
- krpctools-0.5.4/krpctools/clientgen/python.tmpl +289 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/cnano.tmpl +2 -8
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/cpp.tmpl +2 -8
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/java.tmpl +2 -8
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/nodes.py +3 -1
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/python.tmpl +2 -8
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/lang/python.py +8 -4
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/servicedefs/__init__.py +15 -2
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/TestService.json +42 -2
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgen-TestService-cnano.txt +34 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgen-TestService-cpp.txt +45 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgen-TestService-csharp.txt +21 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgen-TestService-java.txt +35 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgentest.py +6 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-TestService-cnano.rst +61 -49
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-TestService-cpp.rst +61 -49
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-TestService-csharp.rst +12 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-TestService-java.rst +62 -49
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-TestService-lua.rst +14 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-TestService-python.rst +66 -92
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgentest.py +1 -1
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/utils.py +2 -2
- krpctools-0.5.4/krpctools/version.py +1 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools.egg-info/PKG-INFO +1 -1
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools.egg-info/SOURCES.txt +4 -3
- krpctools-0.5.0/VERSION.txt +0 -1
- krpctools-0.5.0/krpctools/bin/Google.Protobuf.dll +0 -0
- krpctools-0.5.0/krpctools/bin/KRPC.dll +0 -0
- krpctools-0.5.0/krpctools/bin/Newtonsoft.Json.dll +0 -0
- krpctools-0.5.0/krpctools/bin/ServiceDefinitions.exe +0 -0
- krpctools-0.5.0/krpctools/bin/TestServer-0.5.0.zip +0 -0
- krpctools-0.5.0/krpctools/clientgen/python.tmpl +0 -111
- krpctools-0.5.0/krpctools/version.py +0 -1
- {krpctools-0.5.0 → krpctools-0.5.4}/MANIFEST.in +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/README.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/__init__.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/bin/NDesk.Options.dll +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/bin/System.IO.dll +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/bin/System.Runtime.dll +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/__init__.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/cnano.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/cnano.tmpl +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/cpp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/cpp.tmpl +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/csharp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/csharp.tmpl +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/docparser.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/java.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/java.tmpl +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/__init__.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/cnano.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/cpp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/csharp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/csharp.tmpl +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/docgen.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/domain.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/extensions.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/java.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/lua.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/lua.tmpl +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/python.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/utils.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/lang/__init__.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/lang/cnano.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/lang/cpp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/lang/csharp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/lang/java.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/lang/language.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/lang/lua.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/Empty.json +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/__init__.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgen-Empty-cnano.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgen-Empty-cpp.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgen-Empty-csharp.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgen-Empty-java.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-Empty-cnano.rst +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-Empty-cpp.rst +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-Empty-csharp.rst +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-Empty-java.rst +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-Empty-lua.rst +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-Empty-python.rst +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_clientgen_cnano.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_clientgen_cpp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_clientgen_csharp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_clientgen_java.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_docgen_cnano.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_docgen_cpp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_docgen_csharp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_docgen_java.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_docgen_lua.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_docgen_python.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools.egg-info/dependency_links.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools.egg-info/entry_points.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools.egg-info/requires.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools.egg-info/top_level.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/setup.cfg +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/setup.py +0 -0
|
@@ -44,9 +44,7 @@
|
|
|
44
44
|
{% endfor %}
|
|
45
45
|
{% if hasdoc(x.documentation, './returns') %}{{ returns(x.documentation) | indent }}
|
|
46
46
|
{% endif %}
|
|
47
|
-
{% if x.game_scenes != None %}
|
|
48
47
|
{{ game_scenes(x.game_scenes) }}
|
|
49
|
-
{% endif %}
|
|
50
48
|
|
|
51
49
|
{% if hasdoc(x.documentation, './remarks') %}{{ remarks(x.documentation) | indent }}
|
|
52
50
|
|
|
@@ -68,9 +66,7 @@
|
|
|
68
66
|
|
|
69
67
|
{% if hasdoc(x.documentation, './returns') %}{{ returns(x.documentation) | indent }}
|
|
70
68
|
{% endif %}
|
|
71
|
-
{% if x.game_scenes != None %}
|
|
72
69
|
{{ game_scenes(x.game_scenes) }}
|
|
73
|
-
{% endif %}
|
|
74
70
|
|
|
75
71
|
{% if hasdoc(x.documentation, './remarks') %}{{ remarks(x.documentation) | indent }}
|
|
76
72
|
|
|
@@ -90,9 +86,7 @@
|
|
|
90
86
|
{% endfor %}
|
|
91
87
|
{% if hasdoc(x.documentation, './returns') %}{{ returns(x.documentation) | indent }}
|
|
92
88
|
{% endif %}
|
|
93
|
-
{% if x.game_scenes != None %}
|
|
94
89
|
{{ game_scenes(x.game_scenes) }}
|
|
95
|
-
{% endif %}
|
|
96
90
|
|
|
97
91
|
{% if hasdoc(x.documentation, './remarks') %}{{ remarks(x.documentation) | indent }}
|
|
98
92
|
|
|
@@ -112,9 +106,7 @@
|
|
|
112
106
|
{% endfor %}
|
|
113
107
|
{% if hasdoc(x.documentation, './returns') %}{{ returns(x.documentation) | indent }}
|
|
114
108
|
{% endif %}
|
|
115
|
-
{% if x.game_scenes != None %}
|
|
116
109
|
{{ game_scenes(x.game_scenes) }}
|
|
117
|
-
{% endif %}
|
|
118
110
|
|
|
119
111
|
{% if hasdoc(x.documentation, './remarks') %}{{ remarks(x.documentation) | indent }}
|
|
120
112
|
|
|
@@ -167,5 +159,7 @@
|
|
|
167
159
|
{% endmacro %}
|
|
168
160
|
|
|
169
161
|
{% macro game_scenes(x) %}
|
|
162
|
+
{% if x != None and x != 'All' %}
|
|
170
163
|
:Game Scenes: {{ x }}
|
|
164
|
+
{% endif %}
|
|
171
165
|
{% endmacro %}
|
|
@@ -122,7 +122,8 @@ class Class(Appendable):
|
|
|
122
122
|
|
|
123
123
|
class Parameter(Appendable):
|
|
124
124
|
# pylint: disable=redefined-builtin
|
|
125
|
-
def __init__(self, name, type, documentation,
|
|
125
|
+
def __init__(self, name, type, documentation,
|
|
126
|
+
default_value=None, nullable=False):
|
|
126
127
|
super().__init__()
|
|
127
128
|
self.name = name
|
|
128
129
|
self.type = as_type(self.types, type)
|
|
@@ -130,6 +131,7 @@ class Parameter(Appendable):
|
|
|
130
131
|
if default_value is not None:
|
|
131
132
|
default_value = decode_default_value(default_value, self.type)
|
|
132
133
|
self.default_value = default_value
|
|
134
|
+
self.nullable = nullable
|
|
133
135
|
self.documentation = documentation
|
|
134
136
|
|
|
135
137
|
|
|
@@ -47,9 +47,7 @@
|
|
|
47
47
|
{% if x.return_type != None %}
|
|
48
48
|
:rtype: {{ domain.type_description(x.return_type) }}
|
|
49
49
|
{% endif %}
|
|
50
|
-
{% if x.game_scenes != None %}
|
|
51
50
|
{{ game_scenes(x.game_scenes) }}
|
|
52
|
-
{% endif %}
|
|
53
51
|
|
|
54
52
|
{% if hasdoc(x.documentation, './remarks') %}{{ remarks(x.documentation) | indent }}
|
|
55
53
|
|
|
@@ -68,9 +66,7 @@
|
|
|
68
66
|
{% if hasdoc(x.documentation, './returns') %}{{ returns(x.documentation) | indent }}
|
|
69
67
|
{% endif %}
|
|
70
68
|
:rtype: {{ domain.type_description(x.type) }}
|
|
71
|
-
{% if x.game_scenes != None %}
|
|
72
69
|
{{ game_scenes(x.game_scenes) }}
|
|
73
|
-
{% endif %}
|
|
74
70
|
|
|
75
71
|
{% if hasdoc(x.documentation, './remarks') %}{{ remarks(x.documentation) | indent }}
|
|
76
72
|
|
|
@@ -93,9 +89,7 @@
|
|
|
93
89
|
{% if x.return_type != None %}
|
|
94
90
|
:rtype: {{ domain.type_description(x.return_type) }}
|
|
95
91
|
{% endif %}
|
|
96
|
-
{% if x.game_scenes != None %}
|
|
97
92
|
{{ game_scenes(x.game_scenes) }}
|
|
98
|
-
{% endif %}
|
|
99
93
|
|
|
100
94
|
{% if hasdoc(x.documentation, './remarks') %}{{ remarks(x.documentation) | indent }}
|
|
101
95
|
|
|
@@ -118,9 +112,7 @@
|
|
|
118
112
|
{% if x.return_type != None %}
|
|
119
113
|
:rtype: {{ domain.type_description(x.return_type) }}
|
|
120
114
|
{% endif %}
|
|
121
|
-
{% if x.game_scenes != None %}
|
|
122
115
|
{{ game_scenes(x.game_scenes) }}
|
|
123
|
-
{% endif %}
|
|
124
116
|
|
|
125
117
|
{% if hasdoc(x.documentation, './remarks') %}{{ remarks(x.documentation) | indent }}
|
|
126
118
|
|
|
@@ -179,5 +171,7 @@
|
|
|
179
171
|
{% endmacro %}
|
|
180
172
|
|
|
181
173
|
{% macro game_scenes(x) %}
|
|
174
|
+
{% if x != None and x != 'All' %}
|
|
182
175
|
:Game Scenes: {{ x }}
|
|
176
|
+
{% endif %}
|
|
183
177
|
{% endmacro %}
|
|
@@ -4,6 +4,7 @@ from krpc.schema.KRPC_pb2 import Type
|
|
|
4
4
|
from krpc.types import \
|
|
5
5
|
ValueType, ClassType, EnumerationType, MessageType, \
|
|
6
6
|
TupleType, ListType, SetType, DictionaryType
|
|
7
|
+
from krpc.utils import snake_case
|
|
7
8
|
from .language import Language
|
|
8
9
|
|
|
9
10
|
|
|
@@ -17,6 +18,9 @@ class PythonLanguage(Language):
|
|
|
17
18
|
'false': 'False'
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
def parse_name(self, name):
|
|
22
|
+
return super().parse_name(snake_case(name))
|
|
23
|
+
|
|
20
24
|
def parse_type(self, typ):
|
|
21
25
|
if isinstance(typ, ValueType):
|
|
22
26
|
# python3 fix: get type name from protobuf type code
|
|
@@ -49,10 +53,10 @@ class PythonLanguage(Language):
|
|
|
49
53
|
if (isinstance(typ, ValueType) and
|
|
50
54
|
typ.protobuf_type.code == Type.STRING):
|
|
51
55
|
return '\'%s\'' % value
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
if value is None:
|
|
57
|
+
return 'None'
|
|
58
|
+
if isinstance(typ, EnumerationType):
|
|
59
|
+
return self.parse_type(typ) + '(%d)' % value
|
|
56
60
|
return str(value)
|
|
57
61
|
|
|
58
62
|
def shorten_ref(self, name):
|
|
@@ -53,7 +53,6 @@ def servicedefs(ksp, service, assemblies):
|
|
|
53
53
|
if not os.path.exists(ksp):
|
|
54
54
|
raise RuntimeError('Kerbal Space Program directory does not exist.')
|
|
55
55
|
|
|
56
|
-
# TODO: delete when done
|
|
57
56
|
bindir = tempfile.mkdtemp(prefix='krpc-servicedefs-')
|
|
58
57
|
tmpout = bindir+'/out.json'
|
|
59
58
|
|
|
@@ -70,7 +69,18 @@ def servicedefs(ksp, service, assemblies):
|
|
|
70
69
|
ksp_dlls = [
|
|
71
70
|
'Assembly-CSharp.dll',
|
|
72
71
|
'Assembly-CSharp-firstpass.dll',
|
|
73
|
-
'UnityEngine.dll'
|
|
72
|
+
'UnityEngine.dll',
|
|
73
|
+
'UnityEngine.AnimationModule.dll',
|
|
74
|
+
'UnityEngine.AssetBundleModule.dll',
|
|
75
|
+
'UnityEngine.CoreModule.dll',
|
|
76
|
+
'UnityEngine.IMGUIModule.dll',
|
|
77
|
+
'UnityEngine.InputLegacyModule.dll',
|
|
78
|
+
'UnityEngine.ScreenCaptureModule.dll',
|
|
79
|
+
'UnityEngine.SharedInternalsModule.dll',
|
|
80
|
+
'UnityEngine.TextRenderingModule.dll',
|
|
81
|
+
'UnityEngine.UI.dll',
|
|
82
|
+
'UnityEngine.UIModule.dll',
|
|
83
|
+
'UnityEngine.UnityWebRequestWWWModule.dll',
|
|
74
84
|
]
|
|
75
85
|
ksp_data = 'KSP_Data/Managed'
|
|
76
86
|
if not os.path.exists(os.path.join(ksp, ksp_data)):
|
|
@@ -85,11 +95,14 @@ def servicedefs(ksp, service, assemblies):
|
|
|
85
95
|
'--output=%s' % tmpout, service] + assemblies,
|
|
86
96
|
stderr=subprocess.STDOUT)
|
|
87
97
|
except subprocess.CalledProcessError as ex:
|
|
98
|
+
shutil.rmtree(bindir)
|
|
88
99
|
raise RuntimeError(ex.output) from ex
|
|
89
100
|
|
|
90
101
|
with open(tmpout, 'r') as fp:
|
|
91
102
|
return fp.read()
|
|
92
103
|
|
|
104
|
+
shutil.rmtree(bindir)
|
|
105
|
+
|
|
93
106
|
|
|
94
107
|
if __name__ == '__main__':
|
|
95
108
|
main()
|
|
@@ -170,7 +170,8 @@
|
|
|
170
170
|
"code": "CLASS",
|
|
171
171
|
"service": "TestService",
|
|
172
172
|
"name": "TestClass"
|
|
173
|
-
}
|
|
173
|
+
},
|
|
174
|
+
"nullable": true
|
|
174
175
|
}
|
|
175
176
|
],
|
|
176
177
|
"return_type": {
|
|
@@ -896,7 +897,8 @@
|
|
|
896
897
|
"code": "CLASS",
|
|
897
898
|
"service": "TestService",
|
|
898
899
|
"name": "TestClass"
|
|
899
|
-
}
|
|
900
|
+
},
|
|
901
|
+
"nullable": true
|
|
900
902
|
}
|
|
901
903
|
],
|
|
902
904
|
"return_type": {
|
|
@@ -1055,6 +1057,44 @@
|
|
|
1055
1057
|
}
|
|
1056
1058
|
],
|
|
1057
1059
|
"documentation": ""
|
|
1060
|
+
},
|
|
1061
|
+
"TestClass_set_StringPropertyPrivateGet": {
|
|
1062
|
+
"id": 54,
|
|
1063
|
+
"parameters": [
|
|
1064
|
+
{
|
|
1065
|
+
"name": "this",
|
|
1066
|
+
"type": {
|
|
1067
|
+
"code": "CLASS",
|
|
1068
|
+
"service": "TestService",
|
|
1069
|
+
"name": "TestClass"
|
|
1070
|
+
}
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
"name": "value",
|
|
1074
|
+
"type": {
|
|
1075
|
+
"code": "STRING"
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
],
|
|
1079
|
+
"documentation": ""
|
|
1080
|
+
},
|
|
1081
|
+
"TestClass_get_StringPropertyPrivateSet": {
|
|
1082
|
+
"id": 55,
|
|
1083
|
+
"parameters": [
|
|
1084
|
+
{
|
|
1085
|
+
"name": "this",
|
|
1086
|
+
"type": {
|
|
1087
|
+
"code": "CLASS",
|
|
1088
|
+
"service": "TestService",
|
|
1089
|
+
"name": "TestClass"
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
],
|
|
1093
|
+
"return_type": {
|
|
1094
|
+
"code": "STRING"
|
|
1095
|
+
},
|
|
1096
|
+
"return_is_nullable": false,
|
|
1097
|
+
"documentation": ""
|
|
1058
1098
|
}
|
|
1059
1099
|
},
|
|
1060
1100
|
"classes": {
|
|
@@ -337,6 +337,10 @@ krpc_error_t krpc_TestService_TestClass_ObjectProperty(krpc_connection_t connect
|
|
|
337
337
|
|
|
338
338
|
krpc_error_t krpc_TestService_TestClass_set_ObjectProperty(krpc_connection_t connection, krpc_TestService_TestClass_t instance, krpc_TestService_TestClass_t value);
|
|
339
339
|
|
|
340
|
+
krpc_error_t krpc_TestService_TestClass_set_StringPropertyPrivateGet(krpc_connection_t connection, krpc_TestService_TestClass_t instance, const char * value);
|
|
341
|
+
|
|
342
|
+
krpc_error_t krpc_TestService_TestClass_StringPropertyPrivateSet(krpc_connection_t connection, char * * returnValue, krpc_TestService_TestClass_t instance);
|
|
343
|
+
|
|
340
344
|
// Implementation
|
|
341
345
|
|
|
342
346
|
#ifndef KRPC_IMPL_TYPE_DICTIONARY_INT32_BOOL
|
|
@@ -2010,6 +2014,36 @@ inline krpc_error_t krpc_TestService_TestClass_set_ObjectProperty(krpc_connectio
|
|
|
2010
2014
|
return KRPC_OK;
|
|
2011
2015
|
}
|
|
2012
2016
|
|
|
2017
|
+
inline krpc_error_t krpc_TestService_TestClass_set_StringPropertyPrivateGet(krpc_connection_t connection, krpc_TestService_TestClass_t instance, const char * value) {
|
|
2018
|
+
krpc_call_t _call;
|
|
2019
|
+
krpc_argument_t _arguments[2];
|
|
2020
|
+
KRPC_CHECK(krpc_call(&_call, 9999, 54, 2, _arguments));
|
|
2021
|
+
KRPC_CHECK(krpc_add_argument(&_call, 0, &krpc_encode_callback_uint64, &instance));
|
|
2022
|
+
KRPC_CHECK(krpc_add_argument(&_call, 1, &krpc_encode_callback_string, &value));
|
|
2023
|
+
krpc_result_t _result = KRPC_RESULT_INIT_DEFAULT;
|
|
2024
|
+
KRPC_CHECK(krpc_init_result(&_result));
|
|
2025
|
+
KRPC_CHECK(krpc_invoke(connection, &_result.message, &_call.message));
|
|
2026
|
+
KRPC_CHECK(krpc_free_result(&_result));
|
|
2027
|
+
return KRPC_OK;
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
inline krpc_error_t krpc_TestService_TestClass_StringPropertyPrivateSet(krpc_connection_t connection, char * * returnValue, krpc_TestService_TestClass_t instance) {
|
|
2031
|
+
krpc_call_t _call;
|
|
2032
|
+
krpc_argument_t _arguments[1];
|
|
2033
|
+
KRPC_CHECK(krpc_call(&_call, 9999, 55, 1, _arguments));
|
|
2034
|
+
KRPC_CHECK(krpc_add_argument(&_call, 0, &krpc_encode_callback_uint64, &instance));
|
|
2035
|
+
krpc_result_t _result = KRPC_RESULT_INIT_DEFAULT;
|
|
2036
|
+
KRPC_CHECK(krpc_init_result(&_result));
|
|
2037
|
+
KRPC_CHECK(krpc_invoke(connection, &_result.message, &_call.message));
|
|
2038
|
+
if (returnValue) {
|
|
2039
|
+
pb_istream_t _stream;
|
|
2040
|
+
KRPC_CHECK(krpc_get_return_value(&_result, &_stream));
|
|
2041
|
+
KRPC_CHECK(krpc_decode_string(&_stream, returnValue));
|
|
2042
|
+
}
|
|
2043
|
+
KRPC_CHECK(krpc_free_result(&_result));
|
|
2044
|
+
return KRPC_OK;
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2013
2047
|
inline krpc_error_t krpc_TestService_TestClass_StaticMethod(krpc_connection_t connection, char * * returnValue, const char * a, const char * b) {
|
|
2014
2048
|
krpc_call_t _call;
|
|
2015
2049
|
krpc_argument_t _arguments[2];
|
|
@@ -344,6 +344,10 @@ class TestService : public Service {
|
|
|
344
344
|
|
|
345
345
|
void set_object_property(TestService::TestClass value);
|
|
346
346
|
|
|
347
|
+
void set_string_property_private_get(std::string value);
|
|
348
|
+
|
|
349
|
+
std::string string_property_private_set();
|
|
350
|
+
|
|
347
351
|
::krpc::Stream<std::string> float_to_string_stream(float x);
|
|
348
352
|
|
|
349
353
|
::krpc::Stream<std::string> get_value_stream();
|
|
@@ -358,6 +362,8 @@ class TestService : public Service {
|
|
|
358
362
|
|
|
359
363
|
::krpc::Stream<TestService::TestClass> object_property_stream();
|
|
360
364
|
|
|
365
|
+
::krpc::Stream<std::string> string_property_private_set_stream();
|
|
366
|
+
|
|
361
367
|
::krpc::schema::ProcedureCall float_to_string_call(float x);
|
|
362
368
|
|
|
363
369
|
::krpc::schema::ProcedureCall get_value_call();
|
|
@@ -375,6 +381,10 @@ class TestService : public Service {
|
|
|
375
381
|
::krpc::schema::ProcedureCall object_property_call();
|
|
376
382
|
|
|
377
383
|
::krpc::schema::ProcedureCall set_object_property_call(TestService::TestClass value);
|
|
384
|
+
|
|
385
|
+
::krpc::schema::ProcedureCall set_string_property_private_get_call(std::string value);
|
|
386
|
+
|
|
387
|
+
::krpc::schema::ProcedureCall string_property_private_set_call();
|
|
378
388
|
};
|
|
379
389
|
};
|
|
380
390
|
|
|
@@ -1322,6 +1332,22 @@ inline void TestService::TestClass::set_object_property(TestService::TestClass v
|
|
|
1322
1332
|
this->_client->invoke("TestService", "TestClass_set_ObjectProperty", _args);
|
|
1323
1333
|
}
|
|
1324
1334
|
|
|
1335
|
+
inline void TestService::TestClass::set_string_property_private_get(std::string value) {
|
|
1336
|
+
std::vector<std::string> _args;
|
|
1337
|
+
_args.push_back(encoder::encode(*this));
|
|
1338
|
+
_args.push_back(encoder::encode(value));
|
|
1339
|
+
this->_client->invoke("TestService", "TestClass_set_StringPropertyPrivateGet", _args);
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
inline std::string TestService::TestClass::string_property_private_set() {
|
|
1343
|
+
std::vector<std::string> _args;
|
|
1344
|
+
_args.push_back(encoder::encode(*this));
|
|
1345
|
+
std::string _data = this->_client->invoke("TestService", "TestClass_get_StringPropertyPrivateSet", _args);
|
|
1346
|
+
std::string _result;
|
|
1347
|
+
decoder::decode(_result, _data, this->_client);
|
|
1348
|
+
return _result;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1325
1351
|
inline std::string TestService::TestClass::static_method(Client& _client, std::string a = "", std::string b = "") {
|
|
1326
1352
|
std::vector<std::string> _args;
|
|
1327
1353
|
_args.push_back(encoder::encode(a));
|
|
@@ -1374,6 +1400,12 @@ inline ::krpc::Stream<TestService::TestClass> TestService::TestClass::object_pro
|
|
|
1374
1400
|
return ::krpc::Stream<TestService::TestClass>(this->_client, this->_client->build_call("TestService", "TestClass_get_ObjectProperty", _args));
|
|
1375
1401
|
}
|
|
1376
1402
|
|
|
1403
|
+
inline ::krpc::Stream<std::string> TestService::TestClass::string_property_private_set_stream() {
|
|
1404
|
+
std::vector<std::string> _args;
|
|
1405
|
+
_args.push_back(encoder::encode(*this));
|
|
1406
|
+
return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "TestClass_get_StringPropertyPrivateSet", _args));
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1377
1409
|
inline ::krpc::Stream<std::string> TestService::TestClass::static_method_stream(Client& _client, std::string a = "", std::string b = "") {
|
|
1378
1410
|
std::vector<std::string> _args;
|
|
1379
1411
|
_args.push_back(encoder::encode(a));
|
|
@@ -1437,6 +1469,19 @@ inline ::krpc::schema::ProcedureCall TestService::TestClass::set_object_property
|
|
|
1437
1469
|
return this->_client->build_call("TestService", "TestClass_set_ObjectProperty", _args);
|
|
1438
1470
|
}
|
|
1439
1471
|
|
|
1472
|
+
inline ::krpc::schema::ProcedureCall TestService::TestClass::set_string_property_private_get_call(std::string value) {
|
|
1473
|
+
std::vector<std::string> _args;
|
|
1474
|
+
_args.push_back(encoder::encode(*this));
|
|
1475
|
+
_args.push_back(encoder::encode(value));
|
|
1476
|
+
return this->_client->build_call("TestService", "TestClass_set_StringPropertyPrivateGet", _args);
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
inline ::krpc::schema::ProcedureCall TestService::TestClass::string_property_private_set_call() {
|
|
1480
|
+
std::vector<std::string> _args;
|
|
1481
|
+
_args.push_back(encoder::encode(*this));
|
|
1482
|
+
return this->_client->build_call("TestService", "TestClass_get_StringPropertyPrivateSet", _args);
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1440
1485
|
inline ::krpc::schema::ProcedureCall TestService::TestClass::static_method_call(Client& _client, std::string a = "", std::string b = "") {
|
|
1441
1486
|
std::vector<std::string> _args;
|
|
1442
1487
|
_args.push_back(encoder::encode(a));
|
|
@@ -622,5 +622,26 @@ namespace KRPC.Client.Services.TestService
|
|
|
622
622
|
connection.Invoke ("TestService", "TestClass_set_ObjectProperty", _args);
|
|
623
623
|
}
|
|
624
624
|
}
|
|
625
|
+
|
|
626
|
+
public string StringPropertyPrivateGet {
|
|
627
|
+
set {
|
|
628
|
+
var _args = new ByteString[] {
|
|
629
|
+
global::KRPC.Client.Encoder.Encode (this, typeof(TestService.TestClass)),
|
|
630
|
+
global::KRPC.Client.Encoder.Encode (value, typeof(string))
|
|
631
|
+
};
|
|
632
|
+
connection.Invoke ("TestService", "TestClass_set_StringPropertyPrivateGet", _args);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
[global::KRPC.Client.Attributes.RPCAttribute ("TestService", "TestClass_get_StringPropertyPrivateSet")]
|
|
637
|
+
public string StringPropertyPrivateSet {
|
|
638
|
+
get {
|
|
639
|
+
var _args = new ByteString[] {
|
|
640
|
+
global::KRPC.Client.Encoder.Encode (this, typeof(TestService.TestClass))
|
|
641
|
+
};
|
|
642
|
+
ByteString _data = connection.Invoke ("TestService", "TestClass_get_StringPropertyPrivateSet", _args);
|
|
643
|
+
return (string)global::KRPC.Client.Encoder.Decode (_data, typeof(string), connection);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
625
646
|
}
|
|
626
647
|
}
|
|
@@ -613,6 +613,28 @@ public class TestService {
|
|
|
613
613
|
this.connection.invoke("TestService", "TestClass_set_ObjectProperty", _args);
|
|
614
614
|
}
|
|
615
615
|
|
|
616
|
+
@SuppressWarnings({ "unchecked" })
|
|
617
|
+
@RPCInfo(service = "TestService", procedure = "TestClass_set_StringPropertyPrivateGet", types = _Types.class)
|
|
618
|
+
public void setStringPropertyPrivateGet(String value) throws RPCException
|
|
619
|
+
{
|
|
620
|
+
ByteString[] _args = new ByteString[] {
|
|
621
|
+
Encoder.encode(this, krpc.client.Types.createClass("TestService", "TestClass")),
|
|
622
|
+
Encoder.encode(value, krpc.client.Types.createValue(krpc.schema.KRPC.Type.TypeCode.STRING))
|
|
623
|
+
};
|
|
624
|
+
this.connection.invoke("TestService", "TestClass_set_StringPropertyPrivateGet", _args);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
@SuppressWarnings({ "unchecked" })
|
|
628
|
+
@RPCInfo(service = "TestService", procedure = "TestClass_get_StringPropertyPrivateSet", types = _Types.class)
|
|
629
|
+
public String getStringPropertyPrivateSet() throws RPCException
|
|
630
|
+
{
|
|
631
|
+
ByteString[] _args = new ByteString[] {
|
|
632
|
+
Encoder.encode(this, krpc.client.Types.createClass("TestService", "TestClass"))
|
|
633
|
+
};
|
|
634
|
+
ByteString _data = this.connection.invoke("TestService", "TestClass_get_StringPropertyPrivateSet", _args);
|
|
635
|
+
return (String) Encoder.decode(_data, krpc.client.Types.createValue(krpc.schema.KRPC.Type.TypeCode.STRING), this.connection);
|
|
636
|
+
}
|
|
637
|
+
|
|
616
638
|
@SuppressWarnings({ "unchecked" })
|
|
617
639
|
@RPCInfo(service = "TestService", procedure = "TestClass_static_StaticMethod", types = _Types.class)
|
|
618
640
|
public static String staticMethod(Connection connection, String a, String b) throws RPCException
|
|
@@ -735,6 +757,10 @@ public class TestService {
|
|
|
735
757
|
return krpc.client.Types.createClass("TestService", "TestClass");
|
|
736
758
|
case "TestClass_set_ObjectProperty":
|
|
737
759
|
return null;
|
|
760
|
+
case "TestClass_set_StringPropertyPrivateGet":
|
|
761
|
+
return null;
|
|
762
|
+
case "TestClass_get_StringPropertyPrivateSet":
|
|
763
|
+
return krpc.client.Types.createValue(krpc.schema.KRPC.Type.TypeCode.STRING);
|
|
738
764
|
}
|
|
739
765
|
throw new IllegalArgumentException("Procedure '" + procedure +"' not found");
|
|
740
766
|
}
|
|
@@ -954,6 +980,15 @@ public class TestService {
|
|
|
954
980
|
krpc.client.Types.createClass("TestService", "TestClass"),
|
|
955
981
|
krpc.client.Types.createClass("TestService", "TestClass")
|
|
956
982
|
};
|
|
983
|
+
case "TestClass_set_StringPropertyPrivateGet":
|
|
984
|
+
return new krpc.schema.KRPC.Type[] {
|
|
985
|
+
krpc.client.Types.createClass("TestService", "TestClass"),
|
|
986
|
+
krpc.client.Types.createValue(krpc.schema.KRPC.Type.TypeCode.STRING)
|
|
987
|
+
};
|
|
988
|
+
case "TestClass_get_StringPropertyPrivateSet":
|
|
989
|
+
return new krpc.schema.KRPC.Type[] {
|
|
990
|
+
krpc.client.Types.createClass("TestService", "TestClass")
|
|
991
|
+
};
|
|
957
992
|
case "TestClass_static_StaticMethod":
|
|
958
993
|
return new krpc.schema.KRPC.Type[] {
|
|
959
994
|
krpc.client.Types.createValue(krpc.schema.KRPC.Type.TypeCode.STRING),
|
|
@@ -11,6 +11,12 @@ class ClientGenTestCase:
|
|
|
11
11
|
g = self.generator(
|
|
12
12
|
macro_template, service_name, defs[service_name])
|
|
13
13
|
actual = g.generate()
|
|
14
|
+
|
|
15
|
+
# with open('/home/alex/workspaces/krpc/krpc/' +
|
|
16
|
+
# 'tools/krpctools/krpctools/test/' +
|
|
17
|
+
# 'clientgen-'+name+'-'+self.language+'.txt', 'w') as f:
|
|
18
|
+
# f.write(actual)
|
|
19
|
+
|
|
14
20
|
expected = resource_string(
|
|
15
21
|
'krpctools.test',
|
|
16
22
|
'clientgen-'+name+'-'+self.language+'.txt').decode('utf-8')
|