Skip to content

Commit cd5e947

Browse files
committed
客户端插件改为生成版本,支持KBEngine2.0组件机制
kbengine/kbengine#532
1 parent 77dda64 commit cd5e947

File tree

116 files changed

+17422
-392
lines changed

Some content is hidden

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

116 files changed

+17422
-392
lines changed

Assets/Plugins/kbengine.meta

Lines changed: 0 additions & 5 deletions
This file was deleted.
Submodule kbengine_unity3d_plugins deleted from 17b7bd1

Assets/Plugins/kbengine/kbengine_unity3d_plugins.meta

Lines changed: 0 additions & 5 deletions
This file was deleted.

Assets/Plugins/kbengine_unity3d_plugins.meta

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 284 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
/*
2+
Generated by KBEngine!
3+
Please do not modify this file!
4+
Please inherit this module, such as: (class Account : AccountBase)
5+
tools = kbcmd
6+
*/
7+
8+
namespace KBEngine
9+
{
10+
using UnityEngine;
11+
using System;
12+
using System.Collections;
13+
using System.Collections.Generic;
14+
15+
// defined in */scripts/entity_defs/Account.def
16+
// Please inherit and implement "class Account : AccountBase"
17+
public abstract class AccountBase : Entity
18+
{
19+
public EntityBaseEntityCall_AccountBase baseEntityCall = null;
20+
public EntityCellEntityCall_AccountBase cellEntityCall = null;
21+
22+
public UInt64 lastSelCharacter = 0;
23+
public virtual void onLastSelCharacterChanged(UInt64 oldValue) {}
24+
25+
public abstract void onCreateAvatarResult(Byte arg1, AVATAR_INFOS arg2);
26+
public abstract void onRemoveAvatar(UInt64 arg1);
27+
public abstract void onReqAvatarList(AVATAR_INFOS_LIST arg1);
28+
29+
public AccountBase()
30+
{
31+
}
32+
33+
public override void onGetBase()
34+
{
35+
baseEntityCall = new EntityBaseEntityCall_AccountBase(id, className);
36+
}
37+
38+
public override void onGetCell()
39+
{
40+
cellEntityCall = new EntityCellEntityCall_AccountBase(id, className);
41+
}
42+
43+
public override void onLoseCell()
44+
{
45+
cellEntityCall = null;
46+
}
47+
48+
public override EntityCall getBaseEntityCall()
49+
{
50+
return baseEntityCall;
51+
}
52+
53+
public override EntityCall getCellEntityCall()
54+
{
55+
return cellEntityCall;
56+
}
57+
58+
public override void onRemoteMethodCall(MemoryStream stream)
59+
{
60+
ScriptModule sm = EntityDef.moduledefs["Account"];
61+
62+
UInt16 methodUtype = 0;
63+
UInt16 componentPropertyUType = 0;
64+
65+
if(sm.useMethodDescrAlias)
66+
{
67+
componentPropertyUType = stream.readUint8();
68+
methodUtype = stream.readUint8();
69+
}
70+
else
71+
{
72+
componentPropertyUType = stream.readUint16();
73+
methodUtype = stream.readUint16();
74+
}
75+
76+
Method method = null;
77+
78+
if(componentPropertyUType == 0)
79+
{
80+
method = sm.idmethods[methodUtype];
81+
}
82+
else
83+
{
84+
Property pComponentPropertyDescription = sm.idpropertys[componentPropertyUType];
85+
switch(pComponentPropertyDescription.properUtype)
86+
{
87+
default:
88+
break;
89+
}
90+
91+
return;
92+
}
93+
94+
switch(method.methodUtype)
95+
{
96+
case 10005:
97+
Byte onCreateAvatarResult_arg1 = stream.readUint8();
98+
AVATAR_INFOS onCreateAvatarResult_arg2 = ((DATATYPE_AVATAR_INFOS)method.args[1]).createFromStreamEx(stream);
99+
onCreateAvatarResult(onCreateAvatarResult_arg1, onCreateAvatarResult_arg2);
100+
break;
101+
case 3:
102+
UInt64 onRemoveAvatar_arg1 = stream.readUint64();
103+
onRemoveAvatar(onRemoveAvatar_arg1);
104+
break;
105+
case 10003:
106+
AVATAR_INFOS_LIST onReqAvatarList_arg1 = ((DATATYPE_AVATAR_INFOS_LIST)method.args[0]).createFromStreamEx(stream);
107+
onReqAvatarList(onReqAvatarList_arg1);
108+
break;
109+
default:
110+
break;
111+
};
112+
}
113+
114+
public override void onUpdatePropertys(MemoryStream stream)
115+
{
116+
ScriptModule sm = EntityDef.moduledefs["Account"];
117+
Dictionary<UInt16, Property> pdatas = sm.idpropertys;
118+
119+
while(stream.length() > 0)
120+
{
121+
UInt16 _t_utype = 0;
122+
UInt16 _t_child_utype = 0;
123+
124+
{
125+
if(sm.usePropertyDescrAlias)
126+
{
127+
_t_utype = stream.readUint8();
128+
_t_child_utype = stream.readUint8();
129+
}
130+
else
131+
{
132+
_t_utype = stream.readUint16();
133+
_t_child_utype = stream.readUint16();
134+
}
135+
}
136+
137+
Property prop = null;
138+
139+
if(_t_utype == 0)
140+
{
141+
prop = pdatas[_t_child_utype];
142+
}
143+
else
144+
{
145+
Property pComponentPropertyDescription = pdatas[_t_utype];
146+
switch(pComponentPropertyDescription.properUtype)
147+
{
148+
default:
149+
break;
150+
}
151+
152+
return;
153+
}
154+
155+
switch(prop.properUtype)
156+
{
157+
case 40001:
158+
Vector3 oldval_direction = direction;
159+
direction = stream.readVector3();
160+
161+
if(prop.isBase())
162+
{
163+
if(inited)
164+
onDirectionChanged(oldval_direction);
165+
}
166+
else
167+
{
168+
if(inWorld)
169+
onDirectionChanged(oldval_direction);
170+
}
171+
172+
break;
173+
case 2:
174+
UInt64 oldval_lastSelCharacter = lastSelCharacter;
175+
lastSelCharacter = stream.readUint64();
176+
177+
if(prop.isBase())
178+
{
179+
if(inited)
180+
onLastSelCharacterChanged(oldval_lastSelCharacter);
181+
}
182+
else
183+
{
184+
if(inWorld)
185+
onLastSelCharacterChanged(oldval_lastSelCharacter);
186+
}
187+
188+
break;
189+
case 40000:
190+
Vector3 oldval_position = position;
191+
position = stream.readVector3();
192+
193+
if(prop.isBase())
194+
{
195+
if(inited)
196+
onPositionChanged(oldval_position);
197+
}
198+
else
199+
{
200+
if(inWorld)
201+
onPositionChanged(oldval_position);
202+
}
203+
204+
break;
205+
case 40002:
206+
stream.readUint32();
207+
break;
208+
default:
209+
break;
210+
};
211+
}
212+
}
213+
214+
public override void callPropertysSetMethods()
215+
{
216+
ScriptModule sm = EntityDef.moduledefs["Account"];
217+
Dictionary<UInt16, Property> pdatas = sm.idpropertys;
218+
219+
Vector3 oldval_direction = direction;
220+
Property prop_direction = pdatas[2];
221+
if(prop_direction.isBase())
222+
{
223+
if(inited && !inWorld)
224+
onDirectionChanged(oldval_direction);
225+
}
226+
else
227+
{
228+
if(inWorld)
229+
{
230+
if(prop_direction.isOwnerOnly() && !isPlayer())
231+
{
232+
}
233+
else
234+
{
235+
onDirectionChanged(oldval_direction);
236+
}
237+
}
238+
}
239+
240+
UInt64 oldval_lastSelCharacter = lastSelCharacter;
241+
Property prop_lastSelCharacter = pdatas[4];
242+
if(prop_lastSelCharacter.isBase())
243+
{
244+
if(inited && !inWorld)
245+
onLastSelCharacterChanged(oldval_lastSelCharacter);
246+
}
247+
else
248+
{
249+
if(inWorld)
250+
{
251+
if(prop_lastSelCharacter.isOwnerOnly() && !isPlayer())
252+
{
253+
}
254+
else
255+
{
256+
onLastSelCharacterChanged(oldval_lastSelCharacter);
257+
}
258+
}
259+
}
260+
261+
Vector3 oldval_position = position;
262+
Property prop_position = pdatas[1];
263+
if(prop_position.isBase())
264+
{
265+
if(inited && !inWorld)
266+
onPositionChanged(oldval_position);
267+
}
268+
else
269+
{
270+
if(inWorld)
271+
{
272+
if(prop_position.isOwnerOnly() && !isPlayer())
273+
{
274+
}
275+
else
276+
{
277+
onPositionChanged(oldval_position);
278+
}
279+
}
280+
}
281+
282+
}
283+
}
284+
}

Assets/Plugins/kbengine_unity3d_plugins/AccountBase.cs.meta

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)