Skip to content

Commit 8e95d7d

Browse files
authored
Merge pull request kbengine#1 from kbengine/master
同步更新
2 parents 8009780 + dee7634 commit 8e95d7d

Some content is hidden

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

62 files changed

+20769
-20185
lines changed

docs/api/kbengine_api(cn).chm

1.86 KB
Binary file not shown.

docs/api/kbengine_api(en).chm

3.43 KB
Binary file not shown.

kbe/res/sdk_templates/client/js/kbengine.js

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2775,33 +2775,44 @@ KBEngine.KBEngineArgs = function()
27752775
-----------------------------------------------------------------------------------------*/
27762776
KBEngine.EventTypes =
27772777
{
2778+
// ------------------------------------账号相关------------------------------------
2779+
27782780
// Create new account.
27792781
// <para> param1(string): accountName</para>
27802782
// <para> param2(string): password</para>
27812783
// <para> param3(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.</para>
27822784
createAccount : "createAccount",
27832785

2784-
// Login to server.
2785-
// <para> param1(string): accountName</para>
2786-
// <para> param2(string): password</para>
2787-
// <para> param3(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.</para>
2788-
login : "login",
2789-
2790-
// Logout to baseapp, called when exiting the client.
2791-
logout : "logout",
2792-
2793-
// Relogin to baseapp.
2794-
reloginBaseapp : "reloginBaseapp",
2786+
// Create account feedback results.
2787+
// <para> param1(uint16): retcode. // server_errors</para>
2788+
// <para> param2(bytes): datas. // If you use third-party account system, the system may fill some of the third-party additional datas. </para>
2789+
onCreateAccountResult : "onCreateAccountResult",
27952790

27962791
// Request server binding account Email.
27972792
// <para> param1(string): emailAddress</para>
27982793
bindAccountEmail : "bindAccountEmail",
27992794

2795+
// Response from binding account Email request.
2796+
// <para> param1(uint16): retcode. // server_errors</para>
2797+
onBindAccountEmail : "onBindAccountEmail",
2798+
28002799
// Request to set up a new password for the account. Note: account must be online.
28012800
// <para> param1(string): old_password</para>
28022801
// <para> param2(string): new_password</para>
28032802
newPassword : "newPassword",
28042803

2804+
// Response from a new password request.
2805+
// <para> param1(uint16): retcode. // server_errors</para>
2806+
onNewPassword : "onNewPassword",
2807+
2808+
// Request to reset password for the account. Note: account must be online.
2809+
// <para> param1(string): username</para>
2810+
resetPassword : "resetPassword",
2811+
2812+
// Response from a reset password request.
2813+
// <para> param1(uint16): retcode. // server_errors</para>
2814+
onResetPassword : "onResetPassword",
2815+
28052816
// ------------------------------------连接相关------------------------------------
28062817

28072818
// Kicked of the current server.
@@ -2817,10 +2828,17 @@ KBEngine.EventTypes =
28172828

28182829
// ------------------------------------logon相关------------------------------------
28192830

2820-
// Create account feedback results.
2821-
// <para> param1(uint16): retcode. // server_errors</para>
2822-
// <para> param2(bytes): datas. // If you use third-party account system, the system may fill some of the third-party additional datas. </para>
2823-
onCreateAccountResult : "onCreateAccountResult",
2831+
// Login to server.
2832+
// <para> param1(string): accountName</para>
2833+
// <para> param2(string): password</para>
2834+
// <para> param3(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.</para>
2835+
login : "login",
2836+
2837+
// Logout to baseapp, called when exiting the client.
2838+
logout : "logout",
2839+
2840+
// Relogin to baseapp.
2841+
reloginBaseapp : "reloginBaseapp",
28242842

28252843
// Engine version mismatch.
28262844
// <para> param1(string): clientVersion
@@ -3075,6 +3093,7 @@ KBEngine.KBEngineApp = function(kbengineArgs)
30753093
KBEngine.Event.register(KBEngine.EventTypes.reloginBaseapp, KBEngine.app, "reloginBaseapp");
30763094
KBEngine.Event.register(KBEngine.EventTypes.bindAccountEmail, KBEngine.app, "bindAccountEmail");
30773095
KBEngine.Event.register(KBEngine.EventTypes.newPassword, KBEngine.app, "newPassword");
3096+
KBEngine.Event.register(KBEngine.EventTypes.resetPassword, KBEngine.app, "resetPassword");
30783097
}
30793098

30803099
this.uninstallEvents = function()
@@ -3085,6 +3104,7 @@ KBEngine.KBEngineApp = function(kbengineArgs)
30853104
KBEngine.Event.deregister(KBEngine.EventTypes.reloginBaseapp, KBEngine.app);
30863105
KBEngine.Event.deregister(KBEngine.EventTypes.bindAccountEmail, KBEngine.app);
30873106
KBEngine.Event.deregister(KBEngine.EventTypes.newPassword, KBEngine.app);
3107+
KBEngine.Event.deregister(KBEngine.EventTypes.resetPassword, KBEngine.app);
30883108
}
30893109

30903110
this.hello = function()
@@ -4043,7 +4063,7 @@ KBEngine.KBEngineApp = function(kbengineArgs)
40434063
}
40444064
}
40454065

4046-
this.reset_password = function(username)
4066+
this.resetPassword = function(username)
40474067
{
40484068
KBEngine.app.reset();
40494069
KBEngine.app.username = username;
@@ -5550,6 +5570,8 @@ KBEngine.KBEngineApp = function(kbengineArgs)
55505570

55515571
this.Client_onReqAccountResetPasswordCB = function(failedcode)
55525572
{
5573+
KBEngine.Event.fire(KBEngine.EventTypes.onResetPassword, failedcode);
5574+
55535575
if(failedcode != 0)
55545576
{
55555577
KBEngine.ERROR_MSG("KBEngineApp::Client_onReqAccountResetPasswordCB: " + KBEngine.app.username + " is failed! code=" + failedcode + "(" + KBEngine.app.serverErrs[failedcode].name + ")!");
@@ -5561,6 +5583,8 @@ KBEngine.KBEngineApp = function(kbengineArgs)
55615583

55625584
this.Client_onReqAccountBindEmailCB = function(failedcode)
55635585
{
5586+
KBEngine.Event.fire(KBEngine.EventTypes.onBindAccountEmail, failedcode);
5587+
55645588
if(failedcode != 0)
55655589
{
55665590
KBEngine.ERROR_MSG("KBEngineApp::Client_onReqAccountBindEmailCB: " + KBEngine.app.username + " is failed! code=" + failedcode +"(" + KBEngine.app.serverErrs[failedcode].name + ")!");
@@ -5572,6 +5596,8 @@ KBEngine.KBEngineApp = function(kbengineArgs)
55725596

55735597
this.Client_onReqAccountNewPasswordCB = function(failedcode)
55745598
{
5599+
KBEngine.Event.fire(KBEngine.EventTypes.onNewPassword, failedcode);
5600+
55755601
if(failedcode != 0)
55765602
{
55775603
KBEngine.ERROR_MSG("KBEngineApp::Client_onReqAccountNewPasswordCB: " + KBEngine.app.username + " is failed! code=" + failedcode + "(" +KBEngine.app.serverErrs[failedcode].name + ")!");

0 commit comments

Comments
 (0)