kbengine_unity3d_plugins
========================
Usage
---------------------
1: Generate client plugins through projects
1: Double click to run kbengine\*assets\gensdk.bat
2: Copy kbengine_unity3d_plugins to {UnityProjectName}\Assets\Plugins
2: Create clientapp.cs
using KBEngine;
public class clientapp : KBEMain
{
}
3: Implment the KBE defined entity (including the client part)
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>
<Space/>
public class Account : AccountBase
{
// entity initialization
public override void __init__()
{
}
}
Call entity server method
Account.cs: baseEntityCall.reqAvatarList();
Avatar.cs: cellEntityCall.relive(reliveType);
Reference: https://github.com/kbengine/kbengine/issues/532
4: Monitor KBE-plugins event
For example:
public class UI : MonoBehaviour
{
void Start ()
{
KBEngine.Event.registerOut("onConnectionState", this, "onConnectionState");
}
public void onConnectionState(bool success)
{
// KBE-plugins event fired
}
}
5: Fire events to the KBE-plugins
For example:
KBEngine.Event.fireIn("login", "stringAccount", "stringPasswd", System.Text.Encoding.UTF8.GetBytes("kbengine_unity3d_demo"));
KBE-Plugin fire-out events(KBE => Unity):
---------------------
Entity events:
onEnterWorld
Description:
Entity enter the client-world.
Event-datas:
Enity
onLeaveWorld
Description:
Entity leave the client-world.
Event-datas:
Enity
onEnterSpace
Description:
Player enter the new space.
Event-datas:
Enity
onLeaveSpace
Description:
Player enter the space.
Event-datas:
Enity
onCreateAccountResult
Description:
Create account feedback results.
Event-datas:
uint16: retcode
http://kbengine.org/docs/configuration/server_errors.html
bytes: datas
If you use third-party account system, the system may fill some of the third-party additional datas.
onControlled
Description:
Triggered when the entity is controlled or out of control.
Event-datas:
Enity
bool: isControlled
onLoseControlledEntity
Description:
Lose controlled entity.
Event-datas:
Enity
set_position
Description:
Sets the current position of the entity.
Event-datas:
Enity
set_direction
Description:
Sets the current direction of the entity.
Event-datas:
Enity
updatePosition
Description:
The entity position is updated, you can smooth the moving entity to new location.
Event-datas:
Enity
Protocol events:
onVersionNotMatch
Description:
Engine version mismatch.
Event-datas:
string: clientVersion
string: serverVersion
onScriptVersionNotMatch
Description:
script version mismatch.
Event-datas:
string: clientScriptVersion
string: serverScriptVersion
Loginapp_importClientMessages
Description:
Importing the message protocol for loginapp and client.
Event-datas:
No datas.
Baseapp_importClientMessages
Description:
Importing the message protocol for baseapp and client.
Event-datas:
No datas.
Baseapp_importClientEntityDef
Description:
Protocol description for importing entities.
Event-datas:
No datas.
Login and Logout status:
onLoginBaseapp
Description:
Login to baseapp.
Event-datas:
No datas.
onReloginBaseapp
Description:
Relogin to baseapp.
Event-datas:
No datas.
onKicked
Description:
Kicked of the current server.
Event-datas:
uint16: retcode
http://kbengine.org/docs/configuration/server_errors.html
onLoginFailed
Description:
Login failed.
Event-datas:
uint16: retcode
http://kbengine.org/docs/configuration/server_errors.html
onLoginBaseappFailed
Description:
Login baseapp failed.
Event-datas:
uint16: retcode
http://kbengine.org/docs/configuration/server_errors.html
onReloginBaseappFailed
Description:
Relogin baseapp failed.
Event-datas:
uint16: retcode
http://kbengine.org/docs/configuration/server_errors.html
onReloginBaseappSuccessfully
Description:
Relogin baseapp success.
Event-datas:
No datas.
Space events:
addSpaceGeometryMapping
Description:
The current space is specified by the geometry mapping.
Popular said is to load the specified Map Resources.
Event-datas:
string: resPath
onSetSpaceData
Description:
Server spaceData set data.
Event-datas:
int32: spaceID
string: key
string value
onDelSpaceData
Description:
Server spaceData delete data.
Event-datas:
int32: spaceID
string: key
Network events:
onConnectionState
Description:
Status of connection server.
Event-datas:
bool: success or fail
onDisconnected
Description:
Status of connection server.
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):
---------------------
createAccount
Description:
Create new account.
Event-datas:
string: accountName
string: password
bytes: datas
Datas by user defined.
Data will be recorded into the KBE account database, you can access the datas through the script layer.
If you use third-party account system, datas will be submitted to the third-party system.
login
Description:
Login to server.
Event-datas:
string: accountName
string: password
bytes: datas
Datas by user defined.
Data will be recorded into the KBE account database, you can access the datas through the script layer.
If you use third-party account system, datas will be submitted to the third-party system.
logout
Description:
Logout to baseapp, called when exiting the client.
Event-datas:
No datas.
reloginBaseapp
Description:
Relogin to baseapp.
Event-datas:
No datas.
resetPassword
Description:
Reset password.
Event-datas:
string: accountName
newPassword
Description:
Request to set up a new password for the account.
Note: account must be online
Event-datas:
string: old_password
string: new_password
bindAccountEmail
Description:
Request server binding account Email.
Note: account must be online
Event-datas:
string: emailAddress
没有合适的资源?快使用搜索试试~ 我知道了~
kbengine_unity3d_demo-2.4.5.zip_DEMO_KBE_U3DDEMO_kbe_demo_u3d
共253个文件
meta:127个
cs:78个
asset:16个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 194 浏览量
2022-09-23
20:49:54
上传
评论
收藏 6.85MB ZIP 举报
温馨提示
KBE+U3Ddemo利用unity与kbe引擎制作的demo演示
资源推荐
资源详情
资源评论
收起资源包目录
kbengine_unity3d_demo-2.4.5.zip_DEMO_KBE_U3DDEMO_kbe_demo_u3d (253个子文件)
ProjectSettings.asset 51KB
NavMeshAreas.asset 9KB
NavMeshLayers.asset 9KB
TagManager.asset 6KB
InputManager.asset 5KB
QualitySettings.asset 5KB
GraphicsSettings.asset 4KB
Physics2DSettings.asset 4KB
EditorBuildSettings.asset 4KB
DynamicsManager.asset 4KB
UnityConnectSettings.asset 4KB
EditorSettings.asset 4KB
AudioManager.asset 4KB
TimeManager.asset 4KB
NetworkManager.asset 4KB
ClusterInputManager.asset 4KB
Messages.cs 76KB
EntityDef.cs 75KB
KBEngine.cs 68KB
KCP.cs 37KB
Event.cs 26KB
Blowfish.cs 25KB
CharacterMotor.cs 24KB
KBETypes.cs 23KB
AvatarBase.cs 21KB
MonsterBase.cs 15KB
DataTypes.cs 15KB
UI.cs 13KB
Avatar.cs 11KB
NPCBase.cs 10KB
Entity.cs 9KB
MemoryStream.cs 9KB
GateBase.cs 9KB
World.cs 9KB
SpaceDuplicateBase.cs 9KB
SpawnPointBase.cs 8KB
SpacesBase.cs 8KB
SpaceBase.cs 8KB
ServerErrorDescrs.cs 7KB
NetworkInterfaceBase.cs 7KB
AccountBase.cs 6KB
EncryptionFilter.cs 6KB
CustomDataTypes.cs 6KB
NetworkInterfaceKCP.cs 6KB
GameEntity.cs 6KB
ClientSDKUpdater.cs 5KB
Bundle.cs 5KB
MessageReaderTCP.cs 4KB
PacketReceiverTCP.cs 4KB
KBEMain.cs 4KB
TestNoBaseBase.cs 4KB
TestBase.cs 4KB
PacketSenderTCP.cs 3KB
PacketReceiverKCP.cs 3KB
Account.cs 3KB
EntityCall.cs 3KB
Monster.cs 2KB
EntityCallAvatarBase.cs 2KB
KBEngineArgs.cs 2KB
MouseLook.cs 2KB
TestNoBase.cs 2KB
PacketSenderKCP.cs 2KB
Test.cs 2KB
NetworkInterfaceTCP.cs 2KB
ScriptModule.cs 2KB
EntityCallAccountBase.cs 2KB
FPSInputController.cs 2KB
Property.cs 2KB
PacketSenderBase.cs 2KB
Dbg.cs 1KB
EntityComponent.cs 1KB
PacketReceiverBase.cs 1KB
EntityCallTestBase.cs 1KB
SkillObject.cs 1KB
EntityCallTestNoBaseBase.cs 1KB
Skill.cs 1KB
SkillBox.cs 1KB
NPC.cs 1KB
Math.cs 910B
Gate.cs 856B
ShowFPS.cs 787B
EntityCallSpaceDuplicateBase.cs 743B
Profile.cs 727B
EntityCallSpawnPointBase.cs 723B
ObjectPool.cs 718B
EntityCallMonsterBase.cs 708B
EntityCallSpacesBase.cs 703B
EntityCallSpaceBase.cs 698B
EntityCallGateBase.cs 693B
EntityCallNPCBase.cs 688B
Method.cs 578B
MessageReaderKCP.cs 547B
MessageReaderBase.cs 470B
clientapp.cs 122B
Constructor.FBX 3.52MB
Palm.fbx 135KB
.gitignore 380B
.gitignore 380B
.gitmodules 127B
palmbranch.mat 5KB
共 253 条
- 1
- 2
- 3
资源评论
JaniceLu
- 粉丝: 78
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功