https://github.com/kbengine/kbengine_ue4_plugins
This client-plugins-project is written for kbengine(a MMOG engine of server)
https://github.com/kbengine/kbengine_ue4_plugins
Last synced: 2 months ago
JSON representation
This client-plugins-project is written for kbengine(a MMOG engine of server)
- Host: GitHub
- URL: https://github.com/kbengine/kbengine_ue4_plugins
- Owner: kbengine
- Created: 2016-09-29T10:48:11.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-30T06:46:46.000Z (about 6 years ago)
- Last Synced: 2025-04-01T07:54:14.180Z (3 months ago)
- Language: C++
- Homepage: http://kbengine.org
- Size: 415 KB
- Stars: 35
- Watchers: 13
- Forks: 37
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
kbengine_ue4_plugins
========================Usage
---------------------1: add "KBEnginePlugins" to *.Build.cs
{ProjectName}\Source\{ProjectName}\{ProjectName}.Build.cs
PublicDependencyModuleNames.AddRange(new string[] { ..., "KBEnginePlugins" });2: Create clientapp Blueprint
1: Add KBEMain Component(Reference: https://github.com/kbengine/kbengine_ue4_demo/blob/master/Content/ClientApp.uasset).
2: Set the parameters of the component.3: Implment the KBE defined entity (including the client part)
See: kbengine\kbengine_demos_assets\scripts\entities.xml(hasClient="true") need to implment
class Account : public Entity
{
// entity initialization
virtual void __init__() override
{
}
}Call entity server method
entity.baseCall("base_func", 1, "arg2", "argN")
entity.cellCall("cell_func", 1, "arg2", "argN")4: Monitor KBE-plugins event
For example:
class KBENGINE_UE4_DEMO_API AGameModeLogin : public AGameMode
{
// Called when the game starts or when spawned
virtual void BeginPlay() override
{
KBENGINE_REGISTER_EVENT("onConnectionState", onConnectionState);
}// KBE-plugins event fired
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "KBEngine")
void onConnectionState(const UKBEventData* pEventData);
}5: Fire events to the KBE-plugins
For example:
UKBEventData_login* pEventData = NewObject();
pEventData->username = username;
pEventData->password = password;
pEventData->datas = datas;
KBENGINE_EVENT_FIRE("login", pEventData);KBE-Plugin fire-out events(KBE => UE4):
---------------------Entity events:
onEnterWorld
Description:
Entity enter the client-world.Event-datas:
Enity
onLeaveWorld
Description:
Entity leave the client-world.Event-datas:
EnityonEnterSpace
Description:
Player enter the new space.Event-datas:
EnityonLeaveSpace
Description:
Player enter the space.Event-datas:
EnityonCreateAccountResult
Description:
Create account feedback results.Event-datas:
uint16: retcode
http://kbengine.org/docs/configuration/server_errors.htmlbytes: 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: isControlledonLoseControlledEntity
Description:
Lose controlled entity.Event-datas:
Enityset_position
Description:
Sets the current position of the entity.Event-datas:
Enityset_direction
Description:
Sets the current direction of the entity.Event-datas:
EnityupdatePosition
Description:
The entity position is updated, you can smooth the moving entity to new location.Event-datas:
EnityProtocol events:
onVersionNotMatch
Description:
Engine version mismatch.Event-datas:
string: clientVersion
string: serverVersiononScriptVersionNotMatch
Description:
script version mismatch.Event-datas:
string: clientScriptVersion
string: serverScriptVersionLoginapp_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.htmlonLoginFailed
Description:
Login failed.Event-datas:
uint16: retcode
bytes: serverdatas
http://kbengine.org/docs/configuration/server_errors.htmlonLoginBaseappFailed
Description:
Login baseapp failed.Event-datas:
uint16: retcode
http://kbengine.org/docs/configuration/server_errors.htmlonReloginBaseappFailed
Description:
Relogin baseapp failed.Event-datas:
uint16: retcode
http://kbengine.org/docs/configuration/server_errors.htmlonReloginBaseappSuccessfully
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: resPathonSetSpaceData
Description:
Server spaceData set data.Event-datas:
int32: spaceID
string: key
string valueonDelSpaceData
Description:
Server spaceData delete data.Event-datas:
int32: spaceID
string: keyNetwork events:
onConnectionState
Description:
Status of connection server.Event-datas:
bool: success or failonDisconnected
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: descriptiononStreamDataRecv
Description:
Receive data.Event-datas:
uint16: resouce id
bytes: datasonStreamDataCompleted
Description:
The downloaded data is completed.Event-datas:
uint16: resouce idKBE-Plugin fire-in events(UE4 => 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.reloginBaseapp
Description:
Relogin to baseapp.Event-datas:
No datas.resetPassword
Description:
Reset password.Event-datas:
string: accountNamenewPassword
Description:
Request to set up a new password for the account.
Note: account must be onlineEvent-datas:
string: old_password
string: new_passwordbindAccountEmail
Description:
Request server binding account Email.
Note: account must be onlineEvent-datas:
string: emailAddress