private void ClickBtCreateName() { AudioAssistant.Instance.Shot(StringHelper.SOUND_GATE_BT); if (!UILayerController.Instance.IsCurrentLayer(layerKey)) { return; } if (string.IsNullOrEmpty(inputFieldName.text)) { LPopup.OpenPopupTop("Thông báo", "Bạn chưa nhập 'Tên nhân vật'"); return; } if (inputFieldName.text.Length < 3 || inputFieldName.text.Length > 20) { LPopup.OpenPopupTop("Thông báo", "'Tên nhân vật' phải từ 6 đến 20 kí tự!"); return; } UILayerController.Instance.ShowLoading(false); SendRequest.SendUpdateNameRequest(inputFieldName.text); }
private void ClickBtLogin() { var name = inputFieldNameAccount.text; var pass = inputFielPassword.text; if (!UILayerController.Instance.IsCurrentLayer(layerKey)) { return; } if (string.IsNullOrEmpty(name)) { LPopup.OpenPopupTop("Thông báo", "Bạn chưa nhập 'Tên đăng nhập'"); return; } if (string.IsNullOrEmpty(pass)) { LPopup.OpenPopupTop("Thông báo", "Bạn chưa nhập 'Mật khẩu'"); return; } UILayerController.Instance.ShowLoading(); // Save data temp Database.Instance.accountTemp = name; Database.Instance.passTemp = pass; lobbyController.RequestLogin(name, pass); AudioAssistant.Instance.Shot(StringHelper.SOUND_GATE_BT); }
public void OnWebServiceResponse(WebServiceCode.Code code, WebServiceStatus.Status status, string data) { switch (code) { case WebServiceCode.Code.ForgetPass: UILayerController.Instance.HideLoading(); if (status == WebServiceStatus.Status.OK) { int codeReturn = int.Parse(data); if (codeReturn != 1) { var error = Helper.GetStringError(codeReturn); LPopup.OpenPopupTop("Thông báo", error); } else { LPopup.OpenPopupTop("Thông báo", "Gửi yêu cầu thành công"); Close(); } } else { LPopup.OpenPopupTop("Thông báo", "Lỗi kết nối. Hãy thử lại!"); } break; } }
public override void OnWebServiceResponse(WebServiceCode.Code code, WebServiceStatus.Status status, string data) { switch (code) { case WebServiceCode.Code.GetVipPoint: if (status == WebServiceStatus.Status.OK) { Debug.Log(data); VipPoint vp = JsonConvert.DeserializeObject <VipPoint>(data); if (vp.Code == 0) { isGetData = true; ShowContent(vp); } else { LPopup.OpenPopupTop("Thông báo", "Đã xảy ra lỗi. Hãy thử lại!"); } } else { LPopup.OpenPopupTop("Thông báo", "Đã xảy ra lỗi. Hãy thử lại!"); } break; } }
public void RunFishingAndroid() { if (CheckAppInstallation()) { AndroidJavaClass up = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); AndroidJavaObject ca = up.GetStatic <AndroidJavaObject>("currentActivity"); AndroidJavaObject packageManager = ca.Call <AndroidJavaObject>("getPackageManager"); AndroidJavaObject launchIntent = packageManager.Call <AndroidJavaObject>("getLaunchIntentForPackage", bundleID); launchIntent.Call <AndroidJavaObject>("putExtra", "message", this.token); ca.Call("startActivity", launchIntent); up.Dispose(); ca.Dispose(); packageManager.Dispose(); launchIntent.Dispose(); } else { LPopup.OpenPopupTop("Thông báo", "Hãy tải App bắn cá để chơi game!", (value) => { if (value) { Application.OpenURL("https://id.loc.red/apps/"); } }, true); } }
private void OpenGame() { if (Database.Instance.islogin) { UILayerController.Instance.ShowLoading(); StartCoroutine(ISendRequestOther("1", "https://api.loc.red//Account/GetTokenAuthen", null, 0, (responseData) => { StartCoroutine(ISendRequestOther("1", "https://api.loc.red//Account/GetFishAccount", null, 0, (res) => { UILayerController.Instance.HideLoading(); fishAccount = JsonConvert.DeserializeObject <FAccountResponse>(res); if (fishAccount != null) { OpenApp(responseData); } else { LPopup.OpenPopupTop("Thông báo", "Đã xảy ra lỗi vui lòng thử lại!"); } })); })); } else { NotifyController.Instance.Open("Bạn cần phải đăng nhập để chơi game!", NotifyController.TypeNotify.Error); } }
public void ButtonSpinClickListener() { if (freeTurn > 0) { AudioAssistant.Instance.PlaySoundGame(_GAMEID, _SCLICK); } else { AudioAssistant.Instance.PlaySoundGame(_GAMEID, _SFAIL); } if (freeTurn <= 0) { LPopup.OpenPopupTop("Thông báo!", "Bạn đã hết lượt quay"); return; } if (gCapcha.activeSelf) { SendRequest.SendLuckySpin(urlApi, mCaptchaData.Token, inpCapcha.text); } else { SendRequest.SendLuckySpin(urlApi, "", ""); } gCapcha.SetActive(false); btSpin.interactable = false; }
private void ClickBtSendRong() { AudioAssistant.Instance.Shot(StringHelper.SOUND_GATE_BT); var quantityString = inputFieldQuantitySendRong.text; long quanity = 0; try { quanity = long.Parse(quantityString); } catch { LPopup.OpenPopupTop("Thống báo!", "Sai định dạng"); return; } if (quanity < 10000) { LPopup.OpenPopupTop("Thống báo!", "Phải lớn hơn 10000"); return; } UILayerController.Instance.ShowLoading(); tempGoldSendRong = quanity; tempGoldGetRong = 0; SendRequest.SendUpdateLockGold("", quanity, 1); }
public void OnWebServiceResponse(WebServiceCode.Code code, WebServiceStatus.Status status, string data) { switch (code) { case WebServiceCode.Code.ChangePassSecurity: if (Helper.CheckStatucSucess(status)) { UILayerController.Instance.HideLoading(); var opCode = int.Parse(data); if (Helper.CheckResponseSuccess(opCode)) { ChangePassSucceed(); } } inputFielOTP.text = ""; break; case WebServiceCode.Code.ReceiveOTP: if (Helper.CheckStatucSucess(status)) { UILayerController.Instance.HideLoading(); var opCode = int.Parse(data); if (Helper.CheckResponseSuccess(opCode)) { LPopup.OpenPopupTop("Thông báo", "Kiểm tra điện thoại của bạn để lấy mã OTP"); } } break; } }
private void ChangePassSucceed() { Database.Instance.passTemp = inputFielPass.text; Database.Instance.SavelLocalUser(Database.Instance.accountTemp, Database.Instance.passTemp); LPopup.OpenPopupTop("Thông Báo!", "Thay đổi mật khẩu thành công!"); Close(); }
public void OnWebServiceResponse(WebServiceCode.Code code, WebServiceStatus.Status status, string data) { switch (code) { case WebServiceCode.Code.GenCaptcha: if (status == WebServiceStatus.Status.OK) { captchaData = JsonUtility.FromJson <MCaptchaResponse>(data); StartCoroutine(VKCommon.LoadImageFromBase64(imgCaptcha, captchaData.Data, 0f)); } else { LPopup.OpenPopupTop("Thông báo", "Không lấy được Captcha. Hãy thử lại!"); } break; case WebServiceCode.Code.SendFishingMoney: UILayerController.Instance.HideLoading(); if (status == WebServiceStatus.Status.OK) { FMoneyResponse fSend = JsonConvert.DeserializeObject <FMoneyResponse>(data); if (fSend.code == 1) { Database.Instance.UpdateUserGold(fSend.currentMoney); FishSignIR.Instance.fishAccount.data.currentBalance = fSend.currentMoneyCa; ClickBtClose(); } LPopup.OpenPopupTop("Thông báo", fSend.msg); } else { LPopup.OpenPopupTop("Thông báo", "Lỗi kết nối. Hãy thử lại!"); } break; case WebServiceCode.Code.ReceiveFishingMoney: UILayerController.Instance.HideLoading(); if (status == WebServiceStatus.Status.OK) { FMoneyResponse fSend = JsonConvert.DeserializeObject <FMoneyResponse>(data); if (fSend.code == 1) { Database.Instance.UpdateUserGold(fSend.currentMoney); FishSignIR.Instance.fishAccount.data.currentBalance = fSend.currentMoneyCa; ClickBtClose(); } LPopup.OpenPopupTop("Thông báo", fSend.msg); } else { LPopup.OpenPopupTop("Thông báo", "Lỗi kết nối. Hãy thử lại!"); } break; } }
public override void OnWebServiceResponse(WebServiceCode.Code code, WebServiceStatus.Status status, string data) { switch (code) { case WebServiceCode.Code.GenCaptcha: if (status == WebServiceStatus.Status.OK) { captchaData = JsonUtility.FromJson <MCaptchaResponse>(data); StartCoroutine(VKCommon.LoadImageFromBase64(imageCaptach, captchaData.Data, 0f)); } else { LPopup.OpenPopupTop("Thông báo", "Không lấy được Captcha. Hãy thử lại!"); } break; case WebServiceCode.Code.TopupInfo: if (status == WebServiceStatus.Status.OK) { VKDebug.LogColorRed("TopupInfo", data); listInfoTopup = Newtonsoft.Json.JsonConvert.DeserializeObject <List <CardCheck> >(data); isGetDataInfoSuccess = true; SetLayoutTypeCard(); } break; case WebServiceCode.Code.Topup: { UILayerController.Instance.HideLoading(); if (status == WebServiceStatus.Status.OK) { VKDebug.LogColorRed("Topup", data); var dataReponse = Newtonsoft.Json.JsonConvert.DeserializeObject <TopupResponse>(data); if (dataReponse.ErrorCode <= 0) { LPopup.OpenPopupTop("Thông báo", dataReponse.Message); GetCaptcha(); } else { Database.Instance.UpdateUserGold(dataReponse.Balance); LPopup.OpenPopupTop("Thông báo", "Nạp thẻ thành công!"); } } else { LPopup.OpenPopupTop("Thông báo", "Hãy kiểm tra lại kết nối!"); } break; } } }
private void SendGetOTPSuccess() { isRequestsGetOTPFisrt = false; LPopup.OpenPopupTop("THÔNG BÁO!", "Đã gửi mã OTP về số điện thoại của bạn hãy kiểm tra"); var goldCurrent = Database.Instance.Account().Gold - goldGetOTP; Database.Instance.UpdateUserGold(goldCurrent); }
public void ShowNoticeInfoTransCard(long quantityCard, long quantityRong, int typeCard) { string nameCard = GetNameCard(typeCard); string notice = "Ban có chắc chắn muốn đổi thẻ {0} {1} với giá {2} vàng"; notice = string.Format(notice, nameCard, VKCommon.ConvertStringMoney(quantityCard), VKCommon.ConvertStringMoney(quantityRong)); LPopup.OpenPopupTop("Thống báo", notice, (value) => { RequestDoiThuong(value); }, true); }
private void ClickBtInfo() { if (data.Status == 1) { string info = ""; info += "Mã thẻ: " + data.CardCode + "\n Seri: " + data.CardSerial; LPopup.OpenPopupTop("Thông tin thẻ", info); } }
// Update Phone Fisrt private void ClickBtGetOTPUpdatePhoneFisrt() { if (string.IsNullOrEmpty(inputFieldPhoneUpdateFisrt.text)) { LPopup.OpenPopupTop("Lỗi", "Hãy nhập số điện thoại của bạn để nhận mã OTP"); return; } SendRequest.SendGetOtpFirst(inputFieldPhoneUpdateFisrt.text); AudioAssistant.Instance.Shot(StringHelper.SOUND_GATE_BT); }
public static bool CheckStatucSucess(WebServiceStatus.Status status) { if (status == WebServiceStatus.Status.OK) { return(true); } LPopup.OpenPopupTop("Thông Báo!", "Vui lòng kiểm tra kết nối internet của bạn"); return(false); }
private void DeleteAllMail() { if (listElementMail.Count < 1) { LPopup.OpenPopupTop("Thông Báo", "Hòm Thư Trống!"); return; } UILayerController.Instance.ShowLoading(); SendRequest.DeleteAllMail(); }
private void ClickBtChangePass() { if (!Database.Instance.Account().IsRegisterPhone()) { LPopup.OpenPopupTop("Thông báo", "Cần cập nhập điện thoại để thực hiện chức năng này"); } else { UILayerController.Instance.ShowLayer(UILayerKey.LChangePass, DataResourceLobby.instance.listObjLayer[(int)IndexSourceGate.LCHANGE_PASS]); } AudioAssistant.Instance.Shot(StringHelper.SOUND_GATE_BT); }
public void HandleKickUser(object[] data) { LPopup.OpenPopupTop("Thông báo", "Tài khoản của bạn đã được đăng nhập từ một nơi khác, hãy khởi động lại game để tiếp tục!", (value) => { #if UNITY_WEBGL Application.OpenURL("https://loc777.net"); #else Application.Quit(); #endif }, false); }
private void ClickBtRequestChangepass() { if (string.IsNullOrEmpty(inputFieldPassOld.text) || string.IsNullOrEmpty(inputFielPass.text) || string.IsNullOrEmpty(inputFielOTP.text)) { LPopup.OpenPopupTop("Thông Báo!", "Vui lòng nhập đầy đủ thông tin!"); } UILayerController.Instance.ShowLoading(); SendRequest.SendChangePass(inputFieldPassOld.text, inputFielPass.text, inputFielOTP.text); AudioAssistant.Instance.Shot(StringHelper.SOUND_GATE_BT); }
private void ClickBtSendGiftCode() { AudioAssistant.Instance.Shot(StringHelper.SOUND_GATE_BT); if (string.IsNullOrEmpty(inputFieldCaptcha.text) || string.IsNullOrEmpty(inputFieldGiftCode.text)) { LPopup.OpenPopupTop("Thông báo", "Hãy nhập đủ thông tin"); return; } UILayerController.Instance.ShowLoading(); SendRequest.SendRequestGiftCode(inputFieldGiftCode.text, inputFieldCaptcha.text, captchaData.Token); }
private void ClickBtSendGetPass() { AudioAssistant.Instance.Shot(StringHelper.SOUND_GATE_BT); if (string.IsNullOrEmpty(inputFieldName.text) || string.IsNullOrEmpty(inputFieldPhone.text)) { LPopup.OpenPopupTop("Thông báo", "Hãy nhập đủ thông tin"); return; } UILayerController.Instance.ShowLoading(); SendRequest.SendForgetPass(inputFieldName.text, inputFieldPhone.text); }
private void OnFacebookLogin(int action, IResult result, string data) { if (action == FacebookAction.Login) { if (string.IsNullOrEmpty(result.Error) && !result.Cancelled) { SendRequest.SendSignInFacebookRequest(data); } else { LPopup.OpenPopupTop("Thông báo", "Đăng nhập Facebook thất bại! \n Hãy thử lại"); } } }
private void ClickBtRequestPhoneFisrt() { UILayerController.Instance.ShowLoading(); if (string.IsNullOrEmpty(inputFieldPhoneUpdateFisrt.text)) { LPopup.OpenPopupTop("Thông báo", "Hãy nhập đầy đủ thông tin gồm số điện thoại và mã OTP"); return; } //SendRequest.SendUpdatePhone(inputFieldPhoneUpdateFisrt.text, inputFiedOTPUnUpdateFisrt.text); AudioAssistant.Instance.Shot(StringHelper.SOUND_GATE_BT); isUpdatePhoneFisrt = true; }
public void SetValueReward(RewardVP reward) { if (reward.Code == 1) { LPopup.OpenPopupTop("Thông báo", reward.Msg); BtnPoints[indexReward].interactable = false; Points[indexReward].text = "<color=white>ĐÃ NHẬN QUÀ</color>"; } else { LPopup.OpenPopupTop("Thông báo", "Đã xảy ra lỗi. Hãy thử lại!"); } }
private void ClickBtLoadCard() { if (dropPriceCard.value == 0) { LPopup.OpenPopupTop("Thông báo", "Hãy chọn mệnh giá của thẻ cào!"); return; } VKDebug.LogColorRed(typeCardRequest, "TypeCard"); VKDebug.LogColorRed(quantityRongRequest, "prize Card"); ShowNoticeInfoTransCard(prizeCard, quantityRongRequest, typeCardRequest); AudioAssistant.Instance.Shot(StringHelper.SOUND_GATE_BT); }
private void ClickBtDisableSecurityLogin() { if (!Database.Instance.Account().IsRegisterPhone()) { LPopup.OpenPopupTop("Thông báo", "Đăng kí số điện thoại mới thực hiện được chức năng này"); return; } if (!Database.Instance.Account().IsOTP) { return; } objPanelOTPSecurity.SetActive(true); }
private void ClickBtReactivePhone() { UILayerController.Instance.ShowLoading(); if (string.IsNullOrEmpty(inputFieldPhoneReactive.text)) { LPopup.OpenPopupTop("Thông báo", "Hãy nhập số điện thoại"); return; } SendRequest.SendRegisterPhone(inputFieldPhoneReactive.text); //SendRequest.SendUpdatePhone(inputFieldPhoneUpdateFisrt.text, inputFiedOTPUnUpdateFisrt.text); AudioAssistant.Instance.Shot(StringHelper.SOUND_GATE_BT); }
private void ClickBtRequestDeleteActiveSecurity() { var otp = inputFieldOTP.text; if (otp.Length < 1) { LPopup.OpenPopupTop("Thông báo!", "Nhập OTP bạn nhận được!"); } else { UILayerController.Instance.ShowLoading(); isRequestActiveSecurity = false; SendRequest.SendUpdateRegisterSmsPlus(true, otp); } AudioAssistant.Instance.Shot(StringHelper.SOUND_GATE_BT); }