Skip to content

Commit

Permalink
onStreamData相关事件触发
Browse files Browse the repository at this point in the history
  • Loading branch information
kebiao committed Jan 29, 2018
1 parent 2b1193b commit bfbf232
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion EntityCall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public Bundle newCall()
if(type == EntityCall.ENTITYCALL_TYPE.ENTITYCALL_TYPE_CELL)
bundle.newMessage(Message.messages["Baseapp_onRemoteCallCellMethodFromClient"]);
else
bundle.newMessage(Message.messages["Base_onRemoteMethodCall"]);
bundle.newMessage(Message.messages["Entity_onRemoteMethodCall"]);

bundle.writeInt32(this.id);

Expand Down
7 changes: 5 additions & 2 deletions KBEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2593,16 +2593,19 @@ private void _updateVolatileData(Int32 entityID, float x, float y, float z, floa
*/
public void Client_onStreamDataStarted(Int16 id, UInt32 datasize, string descr)
{
Event.fireOut("onStreamDataStarted", new object[]{id, datasize, descr});
}

public void Client_onStreamDataRecv(MemoryStream stream)
{
// Int16 resID = stream.readInt16();
// byte[] datas = stream.readBlob();
Int16 resID = stream.readInt16();
byte[] datas = stream.readBlob();
Event.fireOut("onStreamDataRecv", new object[]{resID, datas});
}

public void Client_onStreamDataCompleted(Int16 id)
{
Event.fireOut("onStreamDataCompleted", new object[]{id});
}
}

Expand Down
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Usage
}

2: Implment the KBE defined entity (including the client part)
See: kbengine\kbengine_demos_assets\scripts\entities.xml£¬hasClient="true" need to implment
See: kbengine\kbengine_demos_assets\scripts\entities.xml��hasClient="true" need to implment
<Account hasClient="true"></Account>
<Monster hasClient="true"></Monster>
<Gate hasClient="true"></Gate>
Expand Down Expand Up @@ -263,6 +263,31 @@ KBE-Plugin fire-out events(KBE => Unity):
Event-datas:
No datas.

Download events:
onStreamDataStarted
Description:
Start downloading data.

Event-datas:
uint16: resouce id
uint32: data size
string: description

onStreamDataRecv
Description:
Receive data.

Event-datas:
uint16: resouce id
bytes: datas

onStreamDataCompleted
Description:
The downloaded data is completed.

Event-datas:
uint16: resouce id



KBE-Plugin fire-in events(Unity => KBE):
Expand Down

0 comments on commit bfbf232

Please sign in to comment.