{"id":19228010,"url":"https://github.com/kbengine/kbengine_js_plugins","last_synced_at":"2025-04-21T01:31:57.546Z","repository":{"id":29193960,"uuid":"32725122","full_name":"kbengine/kbengine_js_plugins","owner":"kbengine","description":" This client-plugins-project is written for kbengine(a MMOG engine of server)  ","archived":false,"fork":false,"pushed_at":"2021-09-01T14:28:45.000Z","size":375,"stargazers_count":51,"open_issues_count":2,"forks_count":49,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-01T07:54:18.150Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://kbengine.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kbengine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-23T10:24:00.000Z","updated_at":"2024-05-28T15:14:01.000Z","dependencies_parsed_at":"2022-08-17T19:40:52.152Z","dependency_job_id":null,"html_url":"https://github.com/kbengine/kbengine_js_plugins","commit_stats":null,"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbengine%2Fkbengine_js_plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbengine%2Fkbengine_js_plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbengine%2Fkbengine_js_plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbengine%2Fkbengine_js_plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kbengine","download_url":"https://codeload.github.com/kbengine/kbengine_js_plugins/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249982556,"owners_count":21355719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T15:26:23.970Z","updated_at":"2025-04-21T01:31:57.264Z","avatar_url":"https://github.com/kbengine.png","language":"JavaScript","readme":"kbengine_js_plugins\n========================\n\n\n\nUsage\n---------------------\n\n\t1: Create KBEngine\n\t\t// Initialization\n\t\tvar args = new KBEngine.KBEngineArgs();\n\t\t\n\t\targs.ip = \"127.0.0.1\";\n\t\targs.port = 20013;\n\t\tKBEngine.create(args);\n\n\t2: Implment the KBE defined entity (including the client part)\n\t\tSee: kbengine\\kbengine_demos_assets\\scripts\\entities.xml(hasClient=\"true\") need to implment\n\t\t\t\u003cAccount hasClient=\"true\"\u003e\u003c/Account\u003e\n\t\t\t\u003cMonster hasClient=\"true\"\u003e\u003c/Monster\u003e\n\t\t\t\u003cGate hasClient=\"true\"\u003e\u003c/Gate\u003e\n\t\t\t\u003cSpace/\u003e\n\n\t\t\tKBEngine.Account = KBEngine.Entity.extend(\n\t\t\t{\n\t\t\t\t// entity initialization\n\t\t\t\t__init__ : function()\n\t\t\t\t{\n\t\t\t\t\tthis._super();\n\t\t\t\t}\n\t\t\t}\n\n\t\tCall entity server method\n\t\t\tentity.baseCall(\"base_func\", 1, \"arg2\", \"argN\")\n\t\t\tentity.cellCall(\"cell_func\", 1, \"arg2\", \"argN\")\n\n\t3: Monitor KBE-plugins event\n\t\tFor example:\n\t\t\tvar StartSceneLayer = Class.extend({\n\t\t\t{\n\t\t\t\tinstallEvents : function()\n\t\t\t\t{\n\t\t\t\t\tKBEngine.Event.register(\"onConnectionState\", this, \"onConnectionState\");\n\t\t\t\t}\n\n\t\t\t\tonConnectionState : function(success)\n\t\t\t\t{\n\t\t\t\t\t// KBE-plugins event fired\n\t\t\t\t}\n\t\t\t}\n\n\t4: Fire events to the KBE-plugins\n\t\tFor example:\n\t\t\tKBEngine.Event.fire(\"login\", this.usernamebox.getString(), this.passwordbox.getString(), \"kbengine_cocos2d_js_demo\");  \n\n\n\nKBE-Plugin fire-out events(KBE =\u003e Unity):\n---------------------\n\n\tEntity events:\n\t\tonEnterWorld\n\t\t\tDescription: \n\t\t\t\tEntity enter the client-world.\n\n\t\t\tEvent-datas: \n\t\t\t\tEnity\n\t\t\t\t\n\n\t\tonLeaveWorld\n\t\t\tDescription: \n\t\t\t\tEntity leave the client-world.\n\n\t\t\tEvent-datas: \n\t\t\t\tEnity\n\n\t\tonEnterSpace\n\t\t\tDescription: \n\t\t\t\tPlayer enter the new space.\n\n\t\t\tEvent-datas: \n\t\t\t\tEnity\n\n\t\tonLeaveSpace\n\t\t\tDescription: \n\t\t\t\tPlayer enter the space.\n\n\t\t\tEvent-datas: \n\t\t\t\tEnity\n\n\t\tonCreateAccountResult\n\t\t\tDescription: \n\t\t\t\tCreate account feedback results.\n\n\t\t\tEvent-datas: \n\t\t\t\tuint16: retcode\n\t\t\t\t\thttp://kbengine.org/docs/configuration/server_errors.html\n\n\t\t\t\tbytes: datas\n\t\t\t\t\tIf you use third-party account system, the system may fill some of the third-party additional datas.\n\n\t\tonControlled\n\t\t\tDescription: \n\t\t\t\tTriggered when the entity is controlled or out of control.\n\n\t\t\tEvent-datas: \n\t\t\t\tEnity\n\t\t\t\tbool: isControlled\n\n\t\tonLoseControlledEntity\n\t\t\tDescription: \n\t\t\t\tLose controlled entity.\n\n\t\t\tEvent-datas: \n\t\t\t\tEnity\n\n\t\tset_position\n\t\t\tDescription: \n\t\t\t\tSets the current position of the entity.\n\n\t\t\tEvent-datas: \n\t\t\t\tEnity\n\n\t\tset_direction\n\t\t\tDescription: \n\t\t\t\tSets the current direction of the entity.\n\n\t\t\tEvent-datas: \n\t\t\t\tEnity\n\n\t\tupdatePosition\n\t\t\tDescription: \n\t\t\t\tThe entity position is updated, you can smooth the moving entity to new location.\n\n\t\t\tEvent-datas: \n\t\t\t\tEnity\n\n\tProtocol events:\n\t\tonVersionNotMatch\n\t\t\tDescription: \n\t\t\t\tEngine version mismatch.\n\n\t\t\tEvent-datas: \n\t\t\t\tstring: clientVersion\n\t\t\t\tstring: serverVersion\n\n\t\tonScriptVersionNotMatch\n\t\t\tDescription: \n\t\t\t\tscript version mismatch.\n\n\t\t\tEvent-datas: \n\t\t\t\tstring: clientScriptVersion\n\t\t\t\tstring: serverScriptVersion\n\n\t\tLoginapp_importClientMessages\n\t\t\tDescription: \n\t\t\t\tImporting the message protocol for loginapp and client.\n\n\t\t\tEvent-datas: \n\t\t\t\tNo datas.\n\n\t\tBaseapp_importClientMessages\n\t\t\tDescription: \n\t\t\t\tImporting the message protocol for baseapp and client.\n\n\t\t\tEvent-datas: \n\t\t\t\tNo datas.\n\n\t\tBaseapp_importClientEntityDef\n\t\t\tDescription: \n\t\t\t\tProtocol description for importing entities.\n\n\t\t\tEvent-datas: \n\t\t\t\tNo datas.\n\n\tLogin and Logout status:\n\t\tonLoginBaseapp\n\t\t\tDescription: \n\t\t\t\tLogin to baseapp.\n\n\t\t\tEvent-datas: \n\t\t\t\tNo datas.\n\n\t\tonReloginBaseapp\n\t\t\tDescription: \n\t\t\t\tRelogin to baseapp.\n\n\t\t\tEvent-datas: \n\t\t\t\tNo datas.\n\n\t\tonKicked\n\t\t\tDescription: \n\t\t\t\tKicked of the current server.\n\n\t\t\tEvent-datas: \n\t\t\t\tuint16: retcode\n\t\t\t\t\thttp://kbengine.org/docs/configuration/server_errors.html\n\n\t\tonLoginFailed\n\t\t\tDescription: \n\t\t\t\tLogin failed.\n\n\t\t\tEvent-datas: \n\t\t\t\tuint16: retcode\n\t\t\t\tbytes: serverdatas\n\t\t\t\t\thttp://kbengine.org/docs/configuration/server_errors.html\n\n\t\tonLoginBaseappFailed\n\t\t\tDescription: \n\t\t\t\tLogin baseapp failed.\n\n\t\t\tEvent-datas: \n\t\t\t\tuint16: retcode\n\t\t\t\t\thttp://kbengine.org/docs/configuration/server_errors.html\n\n\t\tonReloginBaseappFailed\n\t\t\tDescription: \n\t\t\t\tRelogin baseapp failed.\n\n\t\t\tEvent-datas: \n\t\t\t\tuint16: retcode\n\t\t\t\t\thttp://kbengine.org/docs/configuration/server_errors.html\n\n\t\tonReloginBaseappSuccessfully\n\t\t\tDescription: \n\t\t\t\tRelogin baseapp success.\n\n\t\t\tEvent-datas: \n\t\t\t\tNo datas.\n\t\n\tSpace events:\n\t\taddSpaceGeometryMapping\n\t\t\tDescription: \n\t\t\t\tThe current space is specified by the geometry mapping.\n\t\t\t\tPopular said is to load the specified Map Resources.\n\n\t\t\tEvent-datas: \n\t\t\t\tstring: resPath\n\n\t\tonSetSpaceData\n\t\t\tDescription: \n\t\t\t\tServer spaceData set data.\n\n\t\t\tEvent-datas: \n\t\t\t\tint32: spaceID\n\t\t\t\tstring: key\n\t\t\t\tstring value\n\n\t\tonDelSpaceData\n\t\t\tDescription: \n\t\t\t\tServer spaceData delete data.\n\n\t\t\tEvent-datas: \n\t\t\t\tint32: spaceID\n\t\t\t\tstring: key\n\n\tNetwork events:\n\t\tonConnectionState\n\t\t\tDescription: \n\t\t\t\tStatus of connection server.\n\n\t\t\tEvent-datas: \n\t\t\t\tbool: success or fail\n\n\t\tonDisconnected\n\t\t\tDescription: \n\t\t\t\tStatus of connection server.\n\n\t\t\tEvent-datas: \n\t\t\t\tNo datas.\n\n\tDownload events:\n\t\tonStreamDataStarted\n\t\t\tDescription: \n\t\t\t\tStart downloading data.\n\n\t\t\tEvent-datas: \n\t\t\t\tuint16: resouce id\n\t\t\t\tuint32: data size\n\t\t\t\tstring: description\n\n\t\tonStreamDataRecv\n\t\t\tDescription: \n\t\t\t\tReceive data.\n\n\t\t\tEvent-datas: \n\t\t\t\tuint16: resouce id\n\t\t\t\tbytes: datas\n\n\t\tonStreamDataCompleted\n\t\t\tDescription: \n\t\t\t\tThe downloaded data is completed.\n\n\t\t\tEvent-datas: \n\t\t\t\tuint16: resouce id\n\n\n\nKBE-Plugin fire-in events(Unity =\u003e KBE):\n---------------------\n\n\tcreateAccount\n\t\t\tDescription: \n\t\t\t\tCreate new account.\n\n\t\t\tEvent-datas: \n\t\t\t\tstring: accountName\n\t\t\t\tstring: password\n\t\t\t\tbytes: datas\n\t\t\t\t\tDatas by user defined.\n\t\t\t\t\tData will be recorded into the KBE account database, you can access the datas through the script layer.\n\t\t\t\t\tIf you use third-party account system, datas will be submitted to the third-party system.\n\t\t\t\t\n\n\tlogin\n\t\t\tDescription: \n\t\t\t\tLogin to server.\n\n\t\t\tEvent-datas: \n\t\t\t\tstring: accountName\n\t\t\t\tstring: password\n\t\t\t\tbytes: datas\n\t\t\t\t\tDatas by user defined.\n\t\t\t\t\tData will be recorded into the KBE account database, you can access the datas through the script layer.\n\t\t\t\t\tIf you use third-party account system, datas will be submitted to the third-party system.\n\n\treloginBaseapp\n\t\t\tDescription: \n\t\t\t\tRelogin to baseapp.\n\n\t\t\tEvent-datas: \n\t\t\t\tNo datas.\n\n\tresetPassword\n\t\t\tDescription: \n\t\t\t\tReset password.\n\n\t\t\tEvent-datas: \n\t\t\t\tstring: accountName\n\n\tnewPassword\n\t\t\tDescription: \n\t\t\t\tRequest to set up a new password for the account.\n\t\t\t\tNote: account must be online\n\n\t\t\tEvent-datas: \n\t\t\t\tstring: old_password\n\t\t\t\tstring: new_password\n\n\tbindAccountEmail\n\t\t\tDescription: \n\t\t\t\tRequest server binding account Email.\n\t\t\t\tNote: account must be online\n\n\t\t\tEvent-datas: \n\t\t\t\tstring: emailAddress\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkbengine%2Fkbengine_js_plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkbengine%2Fkbengine_js_plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkbengine%2Fkbengine_js_plugins/lists"}