public void ButtonSelectRoomClickListener(UIGameSamRoomItem uiItem)
    {
        AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioButtonClick);

        MAccountInfo account = Database.Instance.Account();

        if (moneyType == MoneyType.GOLD)
        {
            if (uiItem.data.Item3 > account.Gold)
            {
                NotifyController.Instance.Open("Số dư của bạn không đủ để vào phòng", NotifyController.TypeNotify.Error);
                return;
            }
        }
        else
        {
            if (uiItem.data.Item3 > account.Coin)
            {
                NotifyController.Instance.Open("Số dư của bạn không đủ để vào phòng", NotifyController.TypeNotify.Error);
                return;
            }
        }
        UILayerController.Instance.ShowLoading();
        _server.HubCallPlayNow(uiItem.data.Item1, _config.GetMoneyType(moneyType));
    }
Esempio n. 2
0
    public void Init()
    {
        UILayerController.Instance.ShowLoading();
        uiSelect.gameObject.SetActive(false);
        _assetBundleConfig = AssetbundlesManager.Instance.assetSetting.GetItemByGameId(_GAMEID);
        _soundSetting      = AudioAssistant.Instance.GetSettingSound(_GAMEID, true);

        moneyType             = (int)MoneyType.GOLD;
        _server               = SignalRController.Instance.CreateServer <VuaBaoSignalRServer>((int)_GAMEID);
        _server.OnSRSEvent    = OnSRSEvent;
        _server.OnSRSHubEvent = OnSRSHubEvent;
        _server.SRSInit(_URL, _HUBNAME);

        this.roomIdSelected = 1;

        lastResult = null;

        this.isAuto = false;
        btAuto.SetupAll(false);
        vkBtBets[roomIdSelected - 1].VKInteractable = false;

        this.accountInfo = Database.Instance.Account();
        ChangeSound();
        ChangeTypeMoney();

        slotMachine.ClearUI();

        List <int> id = new List <int>()
        {
            1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
        };

        slotMachine.InitLineSelected(id);
    }
Esempio n. 3
0
    public void Init(SRSSamConfig config, AssetBundleSettingItem assetBundleConfig, SamSignalRServer server, SRSSamGameSession session, int moneyType, bool isSolo)
    {
        _sam           = new SRSSam();
        _sam.session   = session;
        _sam.moneyType = moneyType;

        ClearUI();

        _config            = config;
        _assetBundleConfig = assetBundleConfig;
        _settingSound      = AudioAssistant.Instance.GetSettingSound(_config.gameId);
        _account           = Database.Instance.Account();

        _server                   = server;
        _server.OnSRSEvent        = OnSRSEvent;
        _server.OnSRSHubEvent     = OnSRSHubEvent;
        _server.OnSRSHubCallEvent = OnSRSHubCallEvent;

        gUiCoints.ForEach(a => a.SetActive(_sam.moneyType == MoneyType.COIN));
        gUiGolds.ForEach(a => a.SetActive(_sam.moneyType == MoneyType.GOLD));

        gUiSamNormals.ForEach(a => a.SetActive(!isSolo));
        gUiSamSolos.ForEach(a => a.SetActive(isSolo));

        LoadRoomInfo();
        LoadUserFirst(isSolo);
    }
Esempio n. 4
0
    public void Init(SRSXocXocConfig config, AssetBundleSettingItem assetBundleConfig, XocXocSignalRServer server, SRSXocXoc xocXocData)
    {
        ClearUI();

        _config            = config;
        _xocxoc            = xocXocData;
        _assetBundleConfig = assetBundleConfig;
        _settingSound      = AudioAssistant.Instance.GetSettingSound(_config.gameId);

        _account = Database.Instance.Account();

        _server               = server;
        _server.OnSRSEvent    = OnSRSEvent;
        _server.OnSRSHubEvent = OnSRSHubEvent;

        transSystemChip.gameObject.SetActive(_xocxoc.session.RoomType == XocXocRoom.Fifty);
        uiPlayerMaster.gameObject.SetActive(_xocxoc.session.RoomType != XocXocRoom.Fifty);

        gUiCoints.ForEach(a => a.SetActive(_xocxoc.moneyType == MoneyType.COIN));
        gUiGolds.ForEach(a => a.SetActive(_xocxoc.moneyType == MoneyType.GOLD));

        SetNotify("");
        LoadMoneyType();
        LoadMyData();
        LoadRoomData();
        LoadRoomUser();
        LoadGate();
        FirstLoadPlayer();
        LoadHistory();
        LoadButtonMaster();

        ChangeChip(uiChips[0]);

        UpdateGame();
    }
    public override void Reload()
    {
        base.Reload();
        WebServiceController.Instance.OnWebServiceResponse += OnWebServiceResponse;

        MAccountInfo account = Database.Instance.Account();

        // Info Left
        txtNameUser.text     = account.DisplayName;
        txtDateJoinGame.text = account.Time;

        // Info Right
        SetGold(account.Gold);
        SetCoin(account.Coin);

        txtNameAcount.text = account.Username.Substring(0, account.Username.Length - 4) + "xxxx";
        txtIdAcount.text   = account.AccountID.ToString();

        string phoneNumber = "";

        switch (Database.Instance.Account().State)
        {
        case -1:     phoneNumber = "Đăng ký lại"; break;

        case  0:     phoneNumber = "Chưa đăng ký"; break;

        case  1:     phoneNumber = account.GetTel(); break;

        case  2:     phoneNumber = "Chờ xác nhận"; break;
        }

        txtPhoneNumber.text = phoneNumber;

        if (!Database.Instance.Account().IsRegisterPhone())
        {
            txtActiveSecurityLogin.text = "";
            txtBtActiveSecurity.text    = "Tắt";
            imgBt.sprite = listSpriteBtSecurity[1];
        }
        else if (Database.Instance.Account().IsOTP)
        {
            txtActiveSecurityLogin.text = "Đã đăng kí";
            txtBtActiveSecurity.text    = "Tắt";
            imgBt.sprite = listSpriteBtSecurity[1];
        }
        else
        {
            txtActiveSecurityLogin.text = "Chưa đăng kí";
            txtBtActiveSecurity.text    = "Bật";
            imgBt.sprite = listSpriteBtSecurity[0];
        }

        SetAvatar(Database.Instance.Account().AvatarID);
    }
    public void Init(SRSSlot20LineConfig config, Slot20lineSignalRServer server, SRSSlot20LineAccount account, AssetBundleSettingItem assetBundleConfig, int roomId, int mType)
    {
        _config = config;

        ClearUI();

        _server               = server;
        _server.OnSRSEvent    = OnSRSEvent;
        _server.OnSRSHubEvent = OnSRSHubEvent;

        _assetBundleConfig = assetBundleConfig;
        _settingSound      = AudioAssistant.Instance.GetSettingSound(_config.gameId);

        this.accountSpin = account;
        this.accountInfo = Database.Instance.Account();

        this.roomBetId    = roomId;
        this.moneyType    = mType;
        this.roomBetValue = accountSpin.RoomBetValue(roomBetId);

        txtRomBet.SetNumber(roomBetValue);

        SetNotifyFree();
        SetLineSelected(account.GetLineData());

        // event
        OnEventUpdate();

        // update jackpot
        if (_server.jackpots.ContainsKey(roomBetId.ToString()))
        {
            jackpot = _server.jackpots[roomBetId.ToString()];
            UpdateJackpot();
        }

        // Set data
        imgIconMoney.sprite = sprIconMoney[moneyType == MoneyType.GOLD ? 0 : 1];
        vkTxtMyMoney.SetNumber(accountInfo.GetCurrentBalance(moneyType));

        // finish bonus
        if (account.BonusId > 0)
        {
            _server.HubCallFinishBonusGame(moneyType, account.BonusId);
        }
    }
    public void ButtonChoiNhanhClickListener()
    {
        AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioButtonClick);

        UIGameSamRoomItem roomItem = null;
        MAccountInfo      account  = Database.Instance.Account();

        for (int i = 0; i < uiRoomItems.Count; i++)
        {
            if (moneyType == MoneyType.GOLD)
            {
                if (uiRoomItems[i].data.Item3 < account.Gold)
                {
                    roomItem = uiRoomItems[i];
                }
                else
                {
                    break;
                }
            }
            else
            {
                if (uiRoomItems[i].data.Item3 < account.Coin)
                {
                    roomItem = uiRoomItems[i];
                }
                else
                {
                    break;
                }
            }
        }

        if (roomItem != null)
        {
            UILayerController.Instance.ShowLoading();
            _server.HubCallPlayNow(roomItem.data.Item1, _config.GetMoneyType(moneyType));
        }
        else
        {
            NotifyController.Instance.Open("Số dư của bạn không đủ để vào phòng", NotifyController.TypeNotify.Error);
        }
    }
Esempio n. 8
0
    public void Init()
    {
        ClearUI();
        UILayerController.Instance.ShowLoading();
        _taixiu            = new SRSTaiXiu();
        _assetBundleConfig = AssetbundlesManager.Instance.assetSetting.GetItemByGameId(_GAMEID);
        _soundSetting      = AudioAssistant.Instance.GetSettingSound(_GAMEID);

        _taixiu.MoneyType     = MoneyType.GOLD;
        _server               = SignalRController.Instance.CreateServer <TaiXiuSignalRServer>((int)_GAMEID);
        _server.OnSRSEvent    = OnSRSEvent;
        _server.OnSRSHubEvent = OnSRSHubEvent;
        _server.SRSInit(_URL, _HUBNAME);

        this._account = Database.Instance.Account();

        ChangeSound();
        ShowMoneyType();
        UpdateMoneyType();
        UpdateGameInfo();
    }
Esempio n. 9
0
    public void Init()
    {
        _baucua           = new SRSBauCua();
        _baucua.moneyType = MoneyType.GOLD;

        ClearUI();

        UILayerController.Instance.ShowLoading();

        _account           = Database.Instance.Account();
        _assetBundleConfig = AssetbundlesManager.Instance.assetSetting.GetItemByGameId(_GAMEID);
        _soundSetting      = AudioAssistant.Instance.GetSettingSound(_GAMEID);

        _server               = SignalRController.Instance.CreateServer <BauCuaSignalRServer>((int)_GAMEID);
        _server.OnSRSEvent    = OnSRSEvent;
        _server.OnSRSHubEvent = OnSRSHubEvent;

        _server.SRSInit(_URL, _HUBNAME);

        ChangeSound();
        ChangeTypeMoney();
        ChangeChip(uiChips[0]);
    }
Esempio n. 10
0
    public void Init()
    {
        this.roomIdSelected = 1;
        this.moneyType      = MoneyType.GOLD;

        ClearUI();

        UILayerController.Instance.ShowLoading();

        _account           = Database.Instance.Account();
        _assetBundleConfig = AssetbundlesManager.Instance.assetSetting.GetItemByGameId(_GAMEID);
        _soundSetting      = AudioAssistant.Instance.GetSettingSound(_GAMEID);

        _server               = SignalRController.Instance.CreateServer <HighLowSignalRServer>((int)_GAMEID);
        _server.OnSRSEvent    = OnSRSEvent;
        _server.OnSRSHubEvent = OnSRSHubEvent;

        _server.SRSInit(_URL, _HUBNAME);

        ChangeSound();
        ChangeTypeMoney();
        vkTxtJackpot.UpdateNumber(0);
    }
Esempio n. 11
0
    public void Init()
    {
        UILayerController.Instance.ShowLoading();
        _assetBundleConfig = AssetbundlesManager.Instance.assetSetting.GetItemByGameId(_GAMEID);
        _soundSetting      = AudioAssistant.Instance.GetSettingSound(_GAMEID);

        moneyType             = (int)MoneyType.GOLD;
        _server               = SignalRController.Instance.CreateServer <MiniPokerSignalRServer>((int)_GAMEID);
        _server.OnSRSEvent    = OnSRSEvent;
        _server.OnSRSHubEvent = OnSRSHubEvent;
        _server.SRSInit(_URL, _HUBNAME);

        this.accountInfo    = Database.Instance.Account();
        this.roomIdSelected = 1;
        vkBtBets[roomIdSelected - 1].VKInteractable = false;

        ChangeSound();
        ChangeTypeMoney();
        toggleAuto.isOn = false;
        toggleFast.isOn = false;
        ButtonFastSpinClickListener();

        var rnd           = new System.Random();
        var randomNumbers = Enumerable.Range(1, 49).OrderBy(x => rnd.Next()).Take(5).ToList();

        VKDebug.LogColorRed(randomNumbers.Count);
        for (int i = 0; i < randomNumbers.Count; i++)
        {
            VKDebug.LogColorRed(randomNumbers[i]);
        }

        for (int i = 0; i < lines.Count; i++)
        {
            lines[i].LoadCard(randomNumbers[i]);
        }
    }
Esempio n. 12
0
 public void ClearData()
 {
     this.currentGame = GameId.NONE;
     this.typeLogin   = LoginType.None;
     this.mAccount    = null;
 }
Esempio n. 13
0
 public void SetAccountInfo(MAccountInfo mAccount)
 {
     this.mAccount = mAccount;
 }
Esempio n. 14
0
    public override void Reload()
    {
        base.Reload();
        WebServiceController.Instance.OnWebServiceResponse += OnWebServiceResponse;

        inputFieldPhoneNew.text    = "";
        inputFieldOTPPhoneNew.text = "";
        txtPhoneOld.text           = "";

        MAccountInfo accountInfo = Database.Instance.Account();

        switch (accountInfo.State)
        {
        case 0:
        {
            objPhoneUpdateFisrt.SetActive(true);

            objPhoneUpdated.SetActive(false);
            objWaitActive.SetActive(false);
            objWaitReactive.SetActive(false);

            break;
        }

        case 1:
        {
            objPhoneUpdated.SetActive(true);

            objPhoneUpdateFisrt.SetActive(false);
            objWaitActive.SetActive(false);
            objWaitReactive.SetActive(false);

            txtPhoneOld.text = accountInfo.GetTel();
            break;
        }

        case -1:
        {
            objWaitReactive.SetActive(true);

            objPhoneUpdated.SetActive(false);
            objPhoneUpdateFisrt.SetActive(false);
            objWaitActive.SetActive(false);

            phoneNumberRA.text = accountInfo.GetTel();
            break;
        }

        case 2:
        {
            objWaitActive.SetActive(true);

            objPhoneUpdated.SetActive(false);
            objPhoneUpdateFisrt.SetActive(false);
            objWaitReactive.SetActive(false);

            phoneNumber.text = accountInfo.GetTel();
            break;
        }
        }

        isRequestActiveSecurity = accountInfo.IsOTP;

        ChangeSecuritySucceed();
        objPanelOTPSecurity.SetActive(false);
    }