Esempio n. 1
0
    public void HandlePlayerBet(object[] data)
    {
        string playerId = data[0].ToString();
        List <SRSXocXocBetGateResponse> gateSuccess = JsonConvert.DeserializeObject <List <SRSXocXocBetGateResponse> >(BestHTTP.JSON.Json.Encode(data[1]));
        double balance = double.Parse(data[2].ToString());

        UIXocXocPlayer uiPlayer = uiPlayers.FirstOrDefault(a => a.IsPlayer(playerId));

        if (uiPlayer != null)
        {
            uiPlayer.UpdatePlayer(balance);
        }

        AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioNemCoin);
        foreach (var item in gateSuccess)
        {
            var uiGate = uiGates.FirstOrDefault(a => a.gateType == (XocXocGate)item.gate);
            if (uiGate != null)
            {
                Dictionary <int, int> fakeChips = ConvertTotalMoneyToChip(item.amount);
                PlayerAutoBet(fakeChips, uiGate, uiPlayer != null ? uiPlayer.transform : transOtherPlayer);

                uiGate.ShowBetAll(item.gateTotal);
            }
            if (uiPlayer != null)
            {
                uiPlayer.PlayerGateBet((XocXocGate)item.gate, item.amount);
            }
        }
    }
Esempio n. 2
0
    public void ButtonPlayerClickListener(UIXocXocPlayer uiPlayer)
    {
        if (_xocxoc.IsDealer())
        {
            return;
        }

        if (uiPlayer._player == null)
        {
            AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioButtonClick);
            _server.HubCallSit(uiPlayer.position);
        }
    }