// public void onReloginBaseappTimer() // { // if (ui_state == 0) // { // KBEDebug.LogError("disconnect! (你已掉线!)"); // return; // } // KBEngineApp.app.reloginBaseapp(); // if (startRelogin) // Invoke("onReloginBaseappTimer", 3.0f); // } public void onLoginFailed(UInt16 failedcode) { if (failedcode == 20) { KBEDebug.LogError("login is failed(登陆失败), err=" + KBEngineApp.app.serverErr(failedcode) + ", " + System.Text.Encoding.ASCII.GetString(KBEngineApp.app.serverdatas())); } else { KBEDebug.LogError("login is failed(登陆失败), err=" + KBEngineApp.app.serverErr(failedcode)); } }
public void onConnectionState(bool success) { if (!success) { KBEDebug.LogError("connect(" + KBEngineApp.app.getInitArgs().ip + ":" + KBEngineApp.app.getInitArgs().port + ") is error! (连接错误)"); } else { KBEDebug.Log("connect successfully, please wait...(连接成功,请等候...)"); } ServerEvents.Instance.onConnectionState(success); }
// public void onConnectionState(bool success) // { // if (!success) // { // KBEDebug.LogError("connect(" + KBEngineApp.app.getInitArgs().ip + ":" + KBEngineApp.app.getInitArgs().port + ") is error! (连接错误)"); // GameNetwork.Instance.IfConnectToServer = false; // Debug.LogError("玩家断开连接"); // } // else // { // KBEDebug.Log("connect successfully, please wait...(连接成功,请等候...)"); // GameNetwork.Instance.IfConnectToServer = true; // Debug.LogError("玩家已连接"); // } // } public void onDisconnected() { KBEDebug.LogError("disconnect! will try to reconnect...(你已掉线,尝试重连中!)"); // startRelogin = true; // Invoke("onReloginBaseappTimer", 1.0f); }