Skip to content

Commit 0a64251

Browse files
committed
Merge branch 'release8.1'
# Conflicts: # Unity/Assets/Scripts/Hotfix/Client/Demo/Main/ClientSenderComponentSystem.cs # Unity/Assets/Scripts/Hotfix/Client/Demo/NetClient/LoginHelper.cs
2 parents 5b53c47 + 40121c3 commit 0a64251

File tree

224 files changed

+15291
-910
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

224 files changed

+15291
-910
lines changed

Design/Datas/AIConfig.xlsx

10.2 KB
Binary file not shown.

Design/Datas/Demo.xlsx

9.07 KB
Binary file not shown.

Design/Datas/OneConfig.xlsx

8.81 KB
Binary file not shown.
9.32 KB
Binary file not shown.
10.3 KB
Binary file not shown.
11.4 KB
Binary file not shown.
9.63 KB
Binary file not shown.

Design/Datas/UnitConfig.xlsx

1.14 MB
Binary file not shown.

Design/Datas/__beans__.xlsx

9.15 KB
Binary file not shown.

Design/Datas/__enums__.xlsx

9.14 KB
Binary file not shown.

Design/Datas/__tables__.xlsx

10.6 KB
Binary file not shown.

Design/Defines/builtin.xml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<module name="">
2+
<enum name="AudioType">
3+
<var name="UNKNOWN" value="0"/>
4+
<var name="ACC" value="1"/>
5+
<var name="AIFF" value="2"/>
6+
<mapper target="client" codeTarget="cs-bin,cs-simple-json">
7+
<option name="type" value="UnityEngine.AudioType"/>
8+
</mapper>
9+
<mapper target="server" codeTarget="cs-bin,cs-dotnet-json">
10+
<option name="type" value="CustomAudioType"/>
11+
</mapper>
12+
</enum>
13+
14+
<bean name="vec2" valueType="1" sep="," group="*">
15+
<var name="x" type="float"/>
16+
<var name="y" type="float"/>
17+
<mapper target="client" codeTarget="cs-bin,cs-simple-json">
18+
<option name="type" value="UnityEngine.Vector2"/>
19+
<option name="constructor" value="ExternalTypeUtil.NewVector2"/>
20+
</mapper>
21+
<mapper target="server" codeTarget="cs-bin,cs-dotnet-json">
22+
<option name="type" value="System.Numerics.Vector2"/>
23+
<option name="constructor" value="ExternalTypeUtil.NewVector2"/>
24+
</mapper>
25+
</bean>
26+
<bean name="vec3" valueType="1" sep="," group="*">
27+
<var name="x" type="float"/>
28+
<var name="y" type="float"/>
29+
<var name="z" type="float"/>
30+
<mapper target="client" codeTarget="cs-bin,cs-simple-json">
31+
<option name="type" value="UnityEngine.Vector3"/>
32+
<option name="constructor" value="ExternalTypeUtil.NewVector3"/>
33+
</mapper>
34+
<mapper target="server" codeTarget="cs-bin,cs-dotnet-json">
35+
<option name="type" value="System.Numerics.Vector3"/>
36+
<option name="constructor" value="ExternalTypeUtil.NewVector3"/>
37+
</mapper>
38+
</bean>
39+
<bean name="vec4" valueType="1" sep="," group="*">
40+
<var name="x" type="float"/>
41+
<var name="y" type="float"/>
42+
<var name="z" type="float"/>
43+
<var name="w" type="float"/>
44+
<mapper target="client" codeTarget="cs-bin,cs-simple-json">
45+
<option name="type" value="UnityEngine.Vector4"/>
46+
<option name="constructor" value="ExternalTypeUtil.NewVector4"/>
47+
</mapper>
48+
<mapper target="server" codeTarget="cs-bin,cs-dotnet-json">
49+
<option name="type" value="System.Numerics.Vector4"/>
50+
<option name="constructor" value="ExternalTypeUtil.NewVector4"/>
51+
</mapper>
52+
</bean>
53+
</module>

Design/__luban__.conf

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"groups":
3+
[
4+
{"names":["c"], "default":true},
5+
{"names":["s"], "default":true},
6+
{"names":["e"], "default":true}
7+
],
8+
"schemaFiles":
9+
[
10+
{"fileName":"Defines", "type":""},
11+
{"fileName":"Datas/__tables__.xlsx", "type":"table"},
12+
{"fileName":"Datas/__beans__.xlsx", "type":"bean"},
13+
{"fileName":"Datas/__enums__.xlsx", "type":"enum"}
14+
],
15+
"dataDir": "Datas",
16+
"targets":
17+
[
18+
{"name":"client", "manager":"Tables", "groups":["c"], "topModule":"ET"},
19+
{"name":"server", "manager":"Tables", "groups":["s"], "topModule":"ET"},
20+
{"name":"all", "manager":"Tables", "groups":["c","s"], "topModule":"ET"},
21+
{"name":"editor", "manager":"Tables", "groups":["e"], "topModule":"ET.Editor"}
22+
]
23+
}

DotNet/ThirdParty/DotNet.ThirdParty.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232

3333
<ItemGroup>
3434

35+
<Compile Include="..\..\Unity\Assets\Scripts\ThirdParty\LubanLib\**\*.cs">
36+
<Link>LubanLib/%(RecursiveDir)%(FileName)%(Extension)</Link>
37+
</Compile>
38+
3539
<Compile Include="..\..\Unity\Assets\Scripts\ThirdParty\TrueSync\**\*.cs">
3640
<Link>TrueSync/%(RecursiveDir)%(FileName)%(Extension)</Link>
3741
</Compile>
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
using Luban;
2+
{{
3+
parent_def_type = __bean.parent_def_type
4+
export_fields = __bean.export_fields
5+
hierarchy_export_fields = __bean.hierarchy_export_fields
6+
}}
7+
{{namespace_with_grace_begin __namespace_with_top_module}}
8+
{{~if __bean.comment != '' ~}}
9+
/// <summary>
10+
/// {{escape_comment __bean.comment}}
11+
/// </summary>
12+
{{~end~}}
13+
{{~
14+
func get_ref_name
15+
ret (format_property_name __code_style $0.name) + '_Ref'
16+
end
17+
18+
func get_index_var_name
19+
ret (format_property_name __code_style $0.name) + '_Index'
20+
end
21+
22+
func generate_resolve_field_ref
23+
field = $0
24+
fieldName = format_property_name __code_style field.name
25+
refTable = get_ref_table field
26+
if can_generate_ref field
27+
tableName = format_property_name __code_style refTable.name
28+
if field.is_nullable
29+
ret (get_ref_name field) + ' = ' + fieldName + '!= null ? ' + tableName + '.Instance.GetOrDefault(' + (get_value_of_nullable_type field.ctype fieldName) + ') : null;'
30+
else
31+
ret (get_ref_name field) + ' = ' + tableName + '.Instance.GetOrDefault(' + fieldName + ');'
32+
end
33+
else
34+
if (is_field_bean_need_resolve_ref field)
35+
ret fieldName + '?.ResolveRef();'
36+
else if (is_field_array_like_need_resolve_ref field)
37+
ret 'foreach (var _e in ' + fieldName + ') { _e?.ResolveRef(); }'
38+
else if (is_field_map_need_resolve_ref field)
39+
ret 'foreach (var _e in ' + fieldName + '.Values) { _e?.ResolveRef(); }'
40+
else
41+
ret ''
42+
end
43+
end
44+
end
45+
~}}
46+
{{~if __bean.is_value_type~}}
47+
public partial struct {{__name}}
48+
{{~else~}}
49+
[EnableClass]
50+
public {{class_modifier __bean}} partial class {{__name}} : {{if parent_def_type}}{{__bean.parent}}{{else}}BeanBase{{end}}
51+
{{~end~}}
52+
{
53+
public {{__name}}(ByteBuf _buf){{if parent_def_type}} : base(_buf) {{end}}
54+
{
55+
{{~ for field in export_fields
56+
fieldName = format_property_name __code_style field.name
57+
~}}
58+
{{deserialize '_buf' fieldName field.ctype}}
59+
{{~if can_generate_ref field~}}
60+
{{get_ref_name field}} = null;
61+
{{~end~}}
62+
{{~if has_index field~}}
63+
foreach(var _v in {{fieldName}})
64+
{
65+
{{get_index_var_name field}}.Add(_v.{{format_property_name __code_style (get_index_field field).name}}, _v);
66+
}
67+
{{~end~}}
68+
{{~end~}}
69+
70+
PostInit();
71+
}
72+
73+
public static {{__name}} Deserialize{{__name}}(ByteBuf _buf)
74+
{
75+
{{~if __bean.is_abstract_type~}}
76+
switch (_buf.ReadInt())
77+
{
78+
{{~for child in __bean.hierarchy_not_abstract_children~}}
79+
case {{child.full_name}}.__ID__: return new {{child.full_name}}(_buf);
80+
{{~end~}}
81+
default: throw new SerializationException();
82+
}
83+
{{~else~}}
84+
return new {{__bean.full_name}}(_buf);
85+
{{~end~}}
86+
}
87+
88+
{{~ for field in export_fields ~}}
89+
{{~if field.comment != '' ~}}
90+
/// <summary>
91+
/// {{escape_comment field.comment}}
92+
/// </summary>
93+
{{~end~}}
94+
public readonly {{declaring_type_name field.ctype}} {{format_property_name __code_style field.name}};
95+
96+
{{~if can_generate_ref field~}}
97+
public {{declaring_type_name (get_ref_type field)}} {{get_ref_name field}} { get; private set; }
98+
99+
{{~end~}}
100+
{{~if has_index field
101+
indexMapType = get_index_map_type field
102+
~}}
103+
public readonly {{declaring_type_name indexMapType}} {{get_index_var_name field}} = new {{declaring_type_name indexMapType}}();
104+
105+
{{~end~}}
106+
{{~end~}}
107+
108+
{{~if !__bean.is_abstract_type && !__bean.is_value_type~}}
109+
public const int __ID__ = {{__bean.id}};
110+
public override int GetTypeId() => __ID__;
111+
{{~end~}}
112+
113+
public {{method_modifier __bean}} void ResolveRef()
114+
{
115+
{{~if parent_def_type~}}
116+
base.ResolveRef();
117+
{{~end~}}
118+
{{~for field in export_fields~}}
119+
{{generate_resolve_field_ref field}}
120+
{{~end~}}
121+
122+
PostResolve();
123+
}
124+
125+
public override string ToString()
126+
{
127+
return "{{full_name}}{ "
128+
{{~for field in hierarchy_export_fields ~}}
129+
+ "{{format_field_name __code_style field.name}}:" + {{to_pretty_string (format_property_name __code_style field.name) field.ctype}} + ","
130+
{{~end~}}
131+
+ "}";
132+
}
133+
134+
partial void PostInit();
135+
partial void PostResolve();
136+
}
137+
{{namespace_with_grace_end __namespace_with_top_module}}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{{~
2+
comment = __enum.comment
3+
items = __enum.items
4+
~}}
5+
{{namespace_with_grace_begin __namespace_with_top_module}}
6+
{{~if comment != '' ~}}
7+
/// <summary>
8+
/// {{escape_comment comment}}
9+
/// </summary>
10+
{{~end~}}
11+
{{~if __enum.is_flags~}}
12+
[System.Flags]
13+
{{~end~}}
14+
public enum {{__name}}
15+
{
16+
{{~ for item in items ~}}
17+
{{~if item.comment != '' ~}}
18+
/// <summary>
19+
/// {{escape_comment item.comment_or_alias}}
20+
/// </summary>
21+
{{~end~}}
22+
{{format_enum_item_name __code_style item.name}} = {{item.value}},
23+
24+
{{~end~}}
25+
}
26+
{{namespace_with_grace_end __namespace_with_top_module}}

0 commit comments

Comments
 (0)