Skip to content

Commit 1dac1c9

Browse files
committed
纠正错别字(ReLogin, DisableConnect, ConnectStatus )=> (relogin, disconnected, connectionState)
1 parent 6591aa9 commit 1dac1c9

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

KBEngine.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public enum CLIENT_TYPE
8686

8787
// 服务端与客户端的版本号以及协议MD5
8888
public string serverVersion = "";
89-
public string clientVersion = "0.9.0";
89+
public string clientVersion = "0.9.12";
9090
public string serverScriptVersion = "";
9191
public string clientScriptVersion = "0.1.0";
9292
public string serverProtocolMD5 = "";
@@ -180,7 +180,7 @@ void installEvents()
180180
{
181181
Event.registerIn("createAccount", this, "createAccount");
182182
Event.registerIn("login", this, "login");
183-
Event.registerIn("reLoginBaseapp", this, "reLoginBaseapp");
183+
Event.registerIn("reloginBaseapp", this, "reloginBaseapp");
184184
Event.registerIn("resetPassword", this, "resetPassword");
185185
Event.registerIn("bindAccountEmail", this, "bindAccountEmail");
186186
Event.registerIn("newPassword", this, "newPassword");
@@ -624,25 +624,25 @@ private void onLogin_baseapp()
624624
重登录到网关(baseapp)
625625
一些移动类应用容易掉线,可以使用该功能快速的重新与服务端建立通信
626626
*/
627-
public void reLoginBaseapp()
627+
public void reloginBaseapp()
628628
{
629-
Event.fireAll("onReLoginBaseapp", new object[]{});
629+
Event.fireAll("onReloginBaseapp", new object[]{});
630630
_networkInterface.connectTo(baseappIP, baseappPort, onReConnectTo_baseapp_callback, null);
631631
}
632632

633633
private void onReConnectTo_baseapp_callback(string ip, int port, bool success, object userData)
634634
{
635635
if(!success)
636636
{
637-
Dbg.ERROR_MSG(string.Format("KBEngine::reLoginBaseapp(): connect {0}:{1} is error!", ip, port));
637+
Dbg.ERROR_MSG(string.Format("KBEngine::reloginBaseapp(): connect {0}:{1} is error!", ip, port));
638638
return;
639639
}
640640

641641

642642
Dbg.DEBUG_MSG(string.Format("KBEngine::relogin_baseapp(): connect {0}:{1} is successfully!", ip, port));
643643

644644
Bundle bundle = Bundle.createObject();
645-
bundle.newMessage(Message.messages["Baseapp_reLoginBaseapp"]);
645+
bundle.newMessage(Message.messages["Baseapp_reloginBaseapp"]);
646646
bundle.writeString(username);
647647
bundle.writeString(password);
648648
bundle.writeUint64(entity_uuid);
@@ -1395,20 +1395,20 @@ public void Client_onLoginBaseappFailed(UInt16 failedcode)
13951395
/*
13961396
重登录baseapp失败了
13971397
*/
1398-
public void Client_onReLoginBaseappFailed(UInt16 failedcode)
1398+
public void Client_onReloginBaseappFailed(UInt16 failedcode)
13991399
{
1400-
Dbg.ERROR_MSG("KBEngine::Client_onReLoginBaseappFailed: failedcode(" + failedcode + ")!");
1401-
Event.fireAll("onReLoginBaseappFailed", new object[]{failedcode});
1400+
Dbg.ERROR_MSG("KBEngine::Client_onReloginBaseappFailed: failedcode(" + failedcode + ")!");
1401+
Event.fireAll("onReloginBaseappFailed", new object[]{failedcode});
14021402
}
14031403

14041404
/*
14051405
登录baseapp成功了
14061406
*/
1407-
public void Client_onReLoginBaseappSuccessfully(MemoryStream stream)
1407+
public void Client_onReloginBaseappSuccessfully(MemoryStream stream)
14081408
{
14091409
entity_uuid = stream.readUint64();
1410-
Dbg.DEBUG_MSG("KBEngine::Client_onReLoginBaseappSuccessfully: name(" + username + ")!");
1411-
Event.fireAll("onReLoginBaseappSuccessfully", new object[]{});
1410+
Dbg.DEBUG_MSG("KBEngine::Client_onReloginBaseappSuccessfully: name(" + username + ")!");
1411+
Event.fireAll("onReloginBaseappSuccessfully", new object[]{});
14121412
}
14131413

14141414
/*

NetworkInterface.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void close()
7575
{
7676
_socket.Close(0);
7777
_socket = null;
78-
Event.fireAll("onDisableConnect", new object[]{});
78+
Event.fireAll("onDisconnected", new object[]{});
7979
}
8080

8181
_socket = null;
@@ -91,23 +91,23 @@ public virtual bool valid()
9191
return ((_socket != null) && (_socket.Connected == true));
9292
}
9393

94-
public void _onConnectStatus(ConnectState state)
94+
public void _onConnectionState(ConnectState state)
9595
{
9696
KBEngine.Event.deregisterIn(this);
9797

9898
bool success = (state.error == "" && valid());
9999
if (success)
100100
{
101-
Dbg.DEBUG_MSG(string.Format("NetworkInterface::_onConnectStatus(), connect to {0} is success!", state.socket.RemoteEndPoint.ToString()));
101+
Dbg.DEBUG_MSG(string.Format("NetworkInterface::_onConnectionState(), connect to {0} is success!", state.socket.RemoteEndPoint.ToString()));
102102
_packetReceiver = new PacketReceiver(this);
103103
_packetReceiver.startRecv();
104104
}
105105
else
106106
{
107-
Dbg.ERROR_MSG(string.Format("NetworkInterface::_onConnectStatus(), connect is error! ip: {0}:{1}, err: {2}", state.connectIP, state.connectPort, state.error));
107+
Dbg.ERROR_MSG(string.Format("NetworkInterface::_onConnectionState(), connect is error! ip: {0}:{1}, err: {2}", state.connectIP, state.connectPort, state.error));
108108
}
109109

110-
Event.fireAll("onConnectStatus", new object[] { success });
110+
Event.fireAll("onConnectionState", new object[] { success });
111111

112112
if (state.connectCB != null)
113113
state.connectCB(state.connectIP, state.connectPort, success, state.userData);
@@ -125,12 +125,12 @@ private static void connectCB(IAsyncResult ar)
125125
// Complete the connection.
126126
state.socket.EndConnect(ar);
127127

128-
Event.fireIn("_onConnectStatus", new object[] { state });
128+
Event.fireIn("_onConnectionState", new object[] { state });
129129
}
130130
catch (Exception e)
131131
{
132132
state.error = e.ToString();
133-
Event.fireIn("_onConnectStatus", new object[] { state });
133+
Event.fireIn("_onConnectionState", new object[] { state });
134134
}
135135
}
136136

@@ -164,7 +164,7 @@ private void _asyncConnectCB(IAsyncResult ar)
164164

165165
// Call EndInvoke to retrieve the results.
166166
caller.EndInvoke(ar);
167-
Event.fireIn("_onConnectStatus", new object[] { state });
167+
Event.fireIn("_onConnectionState", new object[] { state });
168168
}
169169

170170
public void connectTo(string ip, int port, ConnectCallback callback, object userData)
@@ -196,7 +196,7 @@ public void connectTo(string ip, int port, ConnectCallback callback, object user
196196
Dbg.DEBUG_MSG("connect to " + ip + ":" + port + " ...");
197197

198198
// 先注册一个事件回调,该事件在当前线程触发
199-
Event.registerIn("_onConnectStatus", this, "_onConnectStatus");
199+
Event.registerIn("_onConnectionState", this, "_onConnectionState");
200200

201201
var v = new AsyncConnectMethod(this._asyncConnect);
202202
v.BeginInvoke(state, new AsyncCallback(this._asyncConnectCB), state);

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ Usage
3535
{
3636
void Start ()
3737
{
38-
KBEngine.Event.registerOut("onConnectStatus", this, "onConnectStatus");
38+
KBEngine.Event.registerOut("onConnectionState", this, "onConnectionState");
3939
}
4040

41-
public void onConnectStatus(bool success)
41+
public void onConnectionState(bool success)
4242
{
4343
// KBE-plugins event fired
4444
}
@@ -176,7 +176,7 @@ KBE-Plugin fire-out events(KBE => Unity):
176176
Event-datas:
177177
No datas.
178178

179-
onReLoginBaseapp
179+
onReloginBaseapp
180180
Description:
181181
Relogin to baseapp.
182182

@@ -207,15 +207,15 @@ KBE-Plugin fire-out events(KBE => Unity):
207207
uint16: retcode
208208
http://kbengine.org/docs/configuration/server_errors.html
209209

210-
onReLoginBaseappFailed
210+
onReloginBaseappFailed
211211
Description:
212212
Relogin baseapp failed.
213213

214214
Event-datas:
215215
uint16: retcode
216216
http://kbengine.org/docs/configuration/server_errors.html
217217

218-
onReLoginBaseappSuccessfully
218+
onReloginBaseappSuccessfully
219219
Description:
220220
Relogin baseapp success.
221221

@@ -249,14 +249,14 @@ KBE-Plugin fire-out events(KBE => Unity):
249249
string: key
250250

251251
Network events:
252-
onConnectStatus
252+
onConnectionState
253253
Description:
254254
Status of connection server.
255255

256256
Event-datas:
257257
bool: success or fail
258258

259-
onDisableConnect
259+
onDisconnected
260260
Description:
261261
Status of connection server.
262262

@@ -293,7 +293,7 @@ KBE-Plugin fire-in events(Unity => KBE):
293293
Data will be recorded into the KBE account database, you can access the datas through the script layer.
294294
If you use third-party account system, datas will be submitted to the third-party system.
295295

296-
reLoginBaseapp
296+
reloginBaseapp
297297
Description:
298298
Relogin to baseapp.
299299

0 commit comments

Comments
 (0)