void ProcessAfterRecharge(bool isDone, WWW response, IDictionary json)
    {
        if (isDone && json.Contains("code"))
        {
            if (json.Contains("code") && json["code"].ToString() == "1")
            {
                serial.value   = "";
                cardCode.value = "";
            }
            else
            {
                if (string.IsNullOrEmpty(json["message"].ToString()))
                {
                    NotificationView.ShowMessage("Có lỗi trong quá trình nạp thẻ. Bạn vui lòng thử lại!");
                }
                else
                {
                    NotificationView.ShowMessage(json["message"].ToString());
                }
                WaitingView.Hide();
            }
        }
        else
        {
            NotificationView.ShowMessage("Thông tin thẻ nạp không hợp lệ!");
            WaitingView.Hide();
        }


        flag = false;
        //WaitingView.Hide();
    }
Esempio n. 2
0
    System.Collections.IEnumerator TimeoutToDestroy()
    {
        yield return(new WaitForSeconds(timeout));

        NotificationView.ShowMessage("Không có phản hồi từ máy chủ. Vui lòng kiểm tra chất lượng mạng");
        this.Close();
    }
 void OnClickButtonGold(GameObject go)
 {
     //GameManager.PlayGoldOrChip = Fields.StatusPlayer.GOLD;
     //OnDrawListChannel();
     //SetIcon();
     NotificationView.ShowMessage("Chức năng đang được xây dựng, vui lòng quay lại sau", 3f);
 }
Esempio n. 4
0
    public void DoJoinLobby(GameObject go)
    {
        if (CommonTLMN.ValidateChipToBetting(lobby.betting, lobby.config.GAME_TYPE_TLMN) == false)
        {
            int rule = lobby.config.GAME_TYPE_TLMN == LobbyTLMN.GameConfig.GameTypeLTMN.XEP_HANG ? CommonTLMN.RULE_XEP_HANG_CHIP_COMPARE_BETTING : CommonTLMN.RULE_DEM_LA_CHIP_COMPARE_BETTING;
            Common.MessageRecharge("Số tiền của bạn phải lớn hơn hoặc bằng " + rule + " lần tiền cược.");
            return;
        }

        GetComponent <CUIHandle>().StopImpact(2f);

        if (lobby.numberUserInRoom == lobby.maxNumberPlayer)
        {
            NotificationView.ShowMessage("Bàn chơi đã đầy. Xin vui lòng tìm bàn chơi khác.", 2f);
            return;
        }

        Debug.Log("DoJoinLobby zone,room,lobby: " + lobby.zoneId + "," + lobby.roomId + "," + lobby.gameId);
        GameManager.Instance.selectedLobby = lobby;

        if (lobby.isPassword)
        {
            NotificationView.ShowDialog("Nhập mật khẩu để truy cập bàn chơi.", ProcessInputPassword);
        }
        else
        {
            ProcessInputPassword("");
        }
    }
    void ProcessAfterChangeInformation(bool isDone, WWW textResponse, IDictionary json)
    {
        isChangedInformation = false;
        if (isDone)
        {
            NotificationView.ShowMessage(json["message"].ToString(), 3f);
            if (json["code"].ToString() == "1")
            {
                Hashtable user = (Hashtable)json["user"];
                panelShowGeneral.SetActive(true);
                panelEditGeneral.SetActive(false);
                string gender = user["gender"].ToString().Equals("male") ? "Nam" : "Nữ";
                lbSex.text = gender;

                string[] arr      = user["birthday"].ToString().Split(":".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                DateTime birthday = new DateTime(int.Parse(arr[0]), int.Parse(arr[1]), int.Parse(arr[2]));

                lbBrithday.text = Utility.Convert.TimeToString(birthday);
                lbAddress.text  = user["address"].ToString();
                GameManager.Instance.mInfo.firstName  = user["first_name"].ToString();
                GameManager.Instance.mInfo.lastName   = user["last_name"].ToString();
                GameManager.Instance.mInfo.middleName = user["middle_name"].ToString();
                GameManager.Instance.mInfo.gender     = lbSex.text;
                GameManager.Instance.mInfo.brithday   = birthday;
                GameManager.Instance.mInfo.address    = lbAddress.text;

                lbFullname.text = GameManager.Instance.mInfo.FullName;
            }
        }
        WaitingView.Instance.Close();
    }
Esempio n. 6
0
    void OnLogin(LoginResponse response)
    {
        if (response.Successful)
        {
            ServerWeb.StartThread(ServerWeb.URL_REQUEST_USER, new object[] { "username", GameManager.Instance.mInfo.username }, delegate(bool isDone, WWW res, IDictionary json) {
            });
            GameManager.Instance.mInfo.password = lablePassword.value;
            GameManager.Server.DoJoinRoom(GameManager.Instance.hallRoom.zoneId, GameManager.Instance.hallRoom.roomId);

#if UNITY_WEBPLAYER
            if (!hasAccessToken)
            {
                Application.ExternalEval("ajaxLoginUnity(\"" + lableUsername.text + "\", \"" + lablePassword.text + "\");");
            }
#endif
        }
        else
        {
            IsClickButtonLogin = false;
            string message = "Thông tin đăng nhập không hợp lệ. Yêu cầu nhập lại thông tin truy cập.";
            if (response.EsObject.variableExists("reason"))
            {
                message = response.EsObject.getString("reason");
            }
            NotificationView.ShowMessage(message);
        }
    }
    void OnClickSaveSecurity(GameObject go)
    {
        User user = GameManager.Instance.mInfo;

        if (user.email == null)
        {
            if (!Utility.Input.IsEmail(txtEmail.value))
            {
                NotificationView.ShowMessage("Email không đúng định dạng. Đề nghị nhập lại.\nVí dụ: [email protected]");
                return;
            }
        }
        if (user.cmtnd == null)
        {
            if (!Utility.Input.IsCMTND(txtCMTND.value))
            {
                NotificationView.ShowMessage("Số chứng minh thư không có thật.\nSố chứng minh thư là số có 9 chữ số.");
                return;
            }
        }
        if (user.phone == null)
        {
            if (!Utility.Input.IsPhone(txtPhone.value))
            {
                NotificationView.ShowMessage("Số điện thoại không có thật.\nSố điện thoại đúng định dạng là số có 10-11 chữ số.");
                return;
            }
        }
        if (!isChangeSecurityInfor)
        {
            _ChangeSecurityInfor();
            isChangeSecurityInfor = true;
        }
    }
Esempio n. 8
0
    /// <summary>
    /// Gửi request kick người chơi
    /// </summary>
    void DoRequestKickPlayer(GameObject go)
    {
        if (GameModelChan.CurrentState >= GameModelChan.EGameState.dealClient)
        {
            NotificationView.ShowMessage("Bạn không thể đuổi người chơi khác trong khi ván bài đang diễn ra.");
            return;
        }

        UIContainerAnonymous anony = go.GetComponent <UIContainerAnonymous>();

        if (anony != null)
        {
            NotificationView.ShowConfirm("Xác nhận.", "Bạn có chắc rằng muốn đuổi người chơi " + ((EPlayerController)anony.intermediary).username + "\n\nRa khỏi bàn chơi không ?",
                                         delegate()
            {
                GameManager.Server.DoRequestPluginGame(Utility.SetEsObject(Fields.GAMEPLAY.PLAY, new object[] {
                    Fields.ACTION, "kickPlayer",
                    Fields.PLAYER.USERNAME, ((EPlayerController)anony.intermediary).username
                }));
            }, null);
        }
        else
        {
            Debug.LogError("Không tìm được người chơi");
        }
    }
Esempio n. 9
0
    public void DoJoinLobby(GameObject go)
    {
        if (Common.ValidateChipToBetting(lobby.betting, GameManager.PlayGoldOrChip) == false)
        {
            int rule = Common.RULE_CHIP_COMPARE_BETTING;
            Common.MessageRecharge("Số tiền của bạn phải lớn hơn hoặc bằng " + rule + " lần tiền cược.");
            return;
        }

        GetComponent <CUIHandle>().StopImpact(2f);

        if (lobby.numberUserInRoom == lobby.maxNumberPlayer)
        {
            NotificationView.ShowMessage("Bàn chơi đã đầy. Xin vui lòng tìm bàn chơi khác.", 2f);
            return;
        }
        GameManager.Instance.selectedLobby = lobby;

        if (lobby.isPassword)
        {
            NotificationView.ShowDialog("Nhập mật khẩu để truy cập bàn chơi", ProcessInputPassword);
        }
        else
        {
            ProcessInputPassword("");
        }
    }
Esempio n. 10
0
    public void OnClickButtonInvite(GameObject targetObject)
    {
        List <string> lstStr = new List <string>();

        listUserOnline.ForEach(u =>
        {
            if (u.value)
            {
                lstStr.Add(u.mUser.username);
            }
        });

        if (lstStr.Count > 0)
        {
            GameManager.Server.DoRequestPluginGame(Utility.SetEsObject("invitePlayGame", new object[] {
                "invitedUsers", lstStr.ToArray(),
                "zoneId", GameManager.Instance.selectedChannel.zoneId,
                "roomId", GameManager.Instance.selectedChannel.roomId
            }));
            for (int i = 0; i < tableInvite.transform.childCount; i++)
            {
                tableInvite.transform.GetChild(i).GetComponent <UIToggle>().value = false;
            }
            NotificationView.ShowMessage("Đã gửi lời mời thành công", 3f);
        }
        else
        {
            NotificationView.ShowMessage("Bạn chưa chọn một người chơi nào để mời ", 3f);
        }
    }
Esempio n. 11
0
    void OnClickSendFeedBack(GameObject go)
    {
        if (isFeedBackClicked)
        {
            return;
        }

        if (!Utility.Input.IsStringValid(txtContent.value, 10, 999999))
        {
            NotificationView.ShowMessage("Nội dung bạn gửi quá ngắn.\n\nHãy nhập một lời góp ý trên 10 ký tự", 3f);
            return;
        }

        ServerWeb.StartThread(ServerWeb.URL_SEND_FEEDBACK,
                              new object[] { "game_id", (int)GameManager.GAME, "user_id", GameManager.Instance.mInfo.id, "title", txtTitle.value, "content", txtContent.value },
                              CallBackResponse);
        if (CBSendLog.value == true)
        {
            //LogViewer.SaveLogToFile();//for test
            LogViewer.SendLogToServer();
            CBSendLog.value = false;
            //Debug.LogWarning("Đã gửi debug_log");
        }
        isFeedBackClicked = true;
    }
Esempio n. 12
0
    void OnClickCreate(GameObject go)
    {
        int numBetting = 0;

        for (int i = 0; i < betting.Length; i++)
        {
            if (betting[i] == null)
            {
                continue;
            }

            if (betting[i].value == true && ((ChannelPhom)GameManager.Instance.selectedChannel).bettingValues[i] == ChannelPhom.CHANNEL_BILLIONAIRE_BETTING_OTHER_VALUE)
            {
                numBetting = Convert.ToInt32(txtBetting.value) * 10000;
                break;
            }
            else if (betting[i].value)
            {
                numBetting = ((ChannelPhom)GameManager.Instance.selectedChannel).bettingValues[i];
            }
        }
        if (GameManager.Instance.mInfo.chip < numBetting * CommonPhom.RULE_CHIP_COMPARE_BETTING || numBetting < 0)
        {
            NotificationView.ShowMessage("Mức tiền cược phải nhỏ hơn " + CommonPhom.RULE_CHIP_COMPARE_BETTING + " lần số chip của bạn, hoặc mức cược đang nhỏ hơn 0", 3f);
        }
        else
        {
            WaitingView.Show("Đang tạo bàn");
            DoCreateGame(numBetting);
        }
    }
Esempio n. 13
0
    protected virtual void OnGenericError(GenericErrorResponse e)
    {
        Debug.LogError("GenericErrorResponse: " + e.ErrorType);
        switch (e.ErrorType)
        {
        case ErrorType.ActionRequiresLogin:
            DoLogOut();
            NotificationView.ShowMessage("Phiên đăng nhập hết hạn, mời bạn đăng nhập lại.", 5f);
            break;

        case ErrorType.UserBanned:
            NotificationView.ShowMessage("Tài khoản của bạn đã bị ban, không thể vào phòng.", 5f);
            break;

        case ErrorType.FailedToJoinGameRoom:
            NotificationView.ShowMessage("Không thể vào phòng game.", 5f);
            break;

        case ErrorType.UserNameExists:
            NotificationView.ShowMessage("Gặp lỗi bất thường khi thực hiện đăng nhập, mã lỗi: -1", 5f);
            break;

        case ErrorType.UserNotJoinedToRoom:
            // NotificationView.ShowMessage("", 5f);
            break;

        default:
            break;
        }
    }
Esempio n. 14
0
    void OnClickEvent(GameObject targetObject)
    {
#if UNITY_ANDROID || UNITY_IPHONE || UNITY_EDITOR
        EventView.Create();
#else
        NotificationView.ShowMessage("Bạn có thể xem thêm nhiều tin tức sự kiện tại trang chủ https://chieuvuong.com");
#endif
    }
Esempio n. 15
0
    void OnClickMarket(GameObject targetObject)
    {
#if UNITY_ANDROID || UNITY_IPHONE || UNITY_EDITOR
        MarketView.Create();
#else
        NotificationView.ShowMessage("Phiên bản window không hỗ trợ tính năng này");
#endif
    }
Esempio n. 16
0
 public override void DoRequestKickPlayer(GameObject go)
 {
     if (GameModelChan.CurrentState >= GameModelChan.EGameState.dealClient)
     {
         NotificationView.ShowMessage("Bạn không thể đuổi người chơi khác trong khi ván bài đang diễn ra.");
         return;
     }
     base.DoRequestKickPlayer(go);
 }
Esempio n. 17
0
    void EnterLogin()
    {
        btLogin.StopImpact(1f);

        if (!string.IsNullOrEmpty(GameManager.Setting.IsMustUpdate))
        {
            Common.MustUpdateGame();
            return;
        }

        if (!Common.IsRelease)
        {
            string testUsername = "******";
            string testPassword = "******";

#if UNITY_STANDALONE_WIN
            testUsername = "******";
#elif UNITY_ANDROID
            testUsername = "******";
#else
            testUsername = "******";
#endif
            if (Application.isEditor)
            {
                testUsername = "******";
                testPassword = "******";
            }

            if (string.IsNullOrEmpty(lableUsername.value) && string.IsNullOrEmpty(lablePassword.value))
            {
                lableUsername.value = testUsername;
                lablePassword.value = testPassword;
            }
        }

        if (string.IsNullOrEmpty(lableUsername.value))
        {
            NotificationView.ShowMessage("Tên truy cập không được phép để trống");
            return;
        }
        if (string.IsNullOrEmpty(lablePassword.value))
        {
            NotificationView.ShowMessage("Mật khẩu không được phép để trống.");
            return;
        }

        IsClickButtonLogin = true;
        GameManager.Instance.userNameLogin = lableUsername.value;
        GameManager.Instance.passwordLogin = lablePassword.value;
        GameManager.Server.DoLogin();

        if (!Common.IsRelease)
        {
            StoreGame.SaveString(StoreGame.EType.SAVE_SERVER, CServer.HOST_NAME);
        }
    }
Esempio n. 18
0
 void CallBackResponse(bool isDone, WWW response, IDictionary json)
 {
     if (isDone && json["code"].ToString() == "1")
     {
         isFeedBackClicked = false;
         NotificationView.ShowMessage("Chúng tôi đã nhận được phản hồi của bạn.", 3f);
         txtTitle.value   = "";
         txtContent.value = "";
     }
 }
Esempio n. 19
0
 internal void OnShowPreViewBetting(Electrotank.Electroserver5.Api.EsObject eso)
 {
     if (!eso.variableExists("bettings"))
     {
         NotificationView.ShowMessage("Chưa có lịch sử chơi gà ngoài", 3f);
         return;
     }
     ShowPanelPreview();
     panelPreview.ShowPreview(eso);
 }
Esempio n. 20
0
    void OnClickCreate(GameObject go)
    {
        int numBetting     = 0;
        int numTimePlaying = 0;

        for (int i = 0; i < timePlay.Length; i++)
        {
            if (timePlay[i].value)
            {
                numTimePlaying = channelSelected.timePlay[i];
            }
        }
        for (int i = 0; i < betting.Length; i++)
        {
            if (betting[i] == null)
            {
                continue;
            }

            if (betting[i].value == true && channelSelected.bettingValues[i] == ChannelChan.CHANNEL_BILLIONAIRE_BETTING_OTHER_VALUE)
            {
                numBetting = Convert.ToInt32(txtBetting.value) * 10000;
                break;
            }
            else if (betting[i].value)
            {
                numBetting = channelSelected.bettingValues[i];
            }
        }
        int total = numBetting * Common.RULE_CHIP_COMPARE_BETTING;// đang là kiểu int nên số quá to sẽ bị < 0

        if (GameManager.PlayGoldOrChip == "chip")
        {
            if (GameManager.Instance.mInfo.chip < total || total < 0)
            {
                NotificationView.ShowMessage("Mức tiền cược phải nhỏ hơn " + Common.RULE_CHIP_COMPARE_BETTING + " lần số chip của bạn, hoặc mức tiền cược đang nhỏ hơn 0", 3f);
            }
            else
            {
                DoCreateGame(numBetting, numTimePlaying);
            }
        }
        else if (GameManager.PlayGoldOrChip == "gold")
        {
            if (GameManager.Instance.mInfo.gold < total || total < 0)
            {
                NotificationView.ShowMessage("Mức tiền cược phải nhỏ hơn " + Common.RULE_CHIP_COMPARE_BETTING + " lần số gold của bạn, hoặc mức tiền cược đang nhỏ hơn 0", 3f);
            }
            else
            {
                DoCreateGame(numBetting, numTimePlaying);
            }
        }
    }
    void ProcessAfterChangeSecurityInformation(bool isDone, WWW textResponse, IDictionary json)
    {
        isChangeSecurityInfor = false;
        if (isDone)
        {
            if (json["code"].ToString() == "1")
            {
                string message = "";
                if (json["code_email"].ToString() == "-1")
                {
                    message += "\n Email đã có trong hệ thống";
                }
                if (json["code_cmt"].ToString() == "-1")
                {
                    message += "\n CMT đã có trong hệ thống";
                }
                if (json["code_mobile"].ToString() == "-1")
                {
                    message += "\n Số điện thoại đã có trong hệ thống";
                }

                if (json["code_email"].ToString() == "-1" && json["code_cmt"].ToString() == "-1" && json["code_mobile"].ToString() == "-1")
                {
                    message += "\nThay đổi thông tin không thành công";
                }
                else
                {
                    message += "\n" + json["message"].ToString();


                    Hashtable user = (Hashtable)json["user"];
                    panelShowSecurity.SetActive(true);
                    panelEditSecurity.SetActive(false);
                    if (user["email"] != null)
                    {
                        GameManager.Instance.mInfo.email = user["email"].ToString();
                    }
                    if (user["identity_card_number"] != null)
                    {
                        GameManager.Instance.mInfo.cmtnd = user["identity_card_number"].ToString();
                    }
                    if (user["mobile"] != null)
                    {
                        GameManager.Instance.mInfo.phone = user["mobile"].ToString();
                    }
                    lbEmail.text = GameManager.Instance.mInfo.email;
                    lbCMTND.text = GameManager.Instance.mInfo.cmtnd;
                    lbPhone.text = GameManager.Instance.mInfo.phone;
                    checkSecurityInformation();
                }
                NotificationView.ShowMessage(message, 3f);
            }
        }
    }
Esempio n. 22
0
 void OnClickListenerJoinBet(GameObject targetObject)
 {
     if (GameModelChan.CurrentState > GameModelChan.EGameState.dealClient)
     {
         GameManager.Server.DoRequestGameAction("getIndividualCards");
     }
     else
     {
         NotificationView.ShowMessage("Ván bài chưa bắt đầu", 3f);
     }
 }
Esempio n. 23
0
 void OnProcessPluginMessage(string command, string action, EsObject paremeters)
 {
     if (command == "error")
     {
         int id = paremeters.getInteger("error");
         if (id == 5)
         {
             NotificationView.ShowMessage("Vui lòng chờ ván bài cũ của bạn kết thúc.\n\nTrước khi tạo bàn mới.");
         }
     }
 }
Esempio n. 24
0
 public static void MessageRecharge(string message)
 {
     if (GameManager.Setting.Platform.EnableRecharge)
     {
         NotificationView.ShowConfirm("Thông báo", message + "\n\nẤn \"Đồng ý\" để chuyển đến trang nạp tiền", delegate() { RechargeView.Create(); }, null);
     }
     else
     {
         NotificationView.ShowMessage(message);
     }
 }
Esempio n. 25
0
 void OnRegister(GameObject obj)
 {
     if (!cbPolicy.value)
     {
         NotificationView.ShowMessage("Bạn phải đồng ý với điều khoản!");
         return;
     }
     WaitingView.Show("Đăng đăng ký");
     GameManager.Server.DoRequestPlugin(Utility.SetEsObject(Fields.REQUEST.COMMAND_REGISTERTOURNAMENT,
                                                            new object[] { "id", tournamentInfo.tournamentId }));
 }
Esempio n. 26
0
    void OnClickButtonForgot(GameObject go)
    {
        btSend.StopImpact(2f);

        if (!Utility.Input.IsEmail(txtEmail.value))
        {
            NotificationView.ShowMessage("Đề nghị nhập một email hợp lệ !", 3f);
            return;
        }

        _Send();
    }
Esempio n. 27
0
    /// <summary>
    /// Hiện prompt chọn album ảnh từ native
    /// </summary>
    public void PromptPictureFromAlbum(DelegateChooseImageDone whenDone)
    {
        onChooseImageDone = whenDone;

#if UNITY_ANDROID
        EtceteraAndroid.promptForPictureFromAlbum(512, 512, "esimoAvatar.jpg");
#elif UNITY_IPHONE
        EtceteraBinding.promptForPhoto(0.25f, PhotoPromptType.Album);
#else
        NotificationView.ShowMessage("Hiện chỉ hỗ trợ đổi ảnh trên mobile", 2f);
#endif
    }
Esempio n. 28
0
 void InitCountDownTime()
 {
     vp_Timer.In(tournamentInfo.remainStartTime, delegate()
     {
         if (!this.tournamentInfo.isRegister)
         {
             NotificationView.ShowMessage("Đã hết thời gian đăng ký");
             NGUITools.SetActive(btnRegister.gameObject, false);
         }
     }, m_Timer
                 );
 }
Esempio n. 29
0
 void OnProcessPulginResponse(string command, string action, EsObject eso)
 {
     if (command == "checkUser")
     {
         if (eso.getBoolean("exist") == false)
         {
             NotificationView.ShowMessage("Người chơi không tồn tại.", 5f);
             return;
         }
         FindFriend(transform.GetComponentInChildren <PrefabMessageTabbarControllerView>().txtFindOtherFriend.value, eso.getInteger("avatar"));
     }
 }
 private void ProcessAfterChangeAvatar(bool isDone, WWW response, IDictionary json)
 {
     if (isDone)
     {
         NotificationView.ShowMessage(json["message"].ToString(), 3f);
         //if (json["code"].ToString() == "1")
         //{
         //    txtOldPass.text = "";
         //    txtNewPass.text = "";
         //    txtRenewPass.text = "";
         //}
     }
 }