Example #1
0
    void RPC_ReturnSicboSlot(int _mySlot)
    {
        Logger.E("rpc return sicbo slot");
        int mySlot = _mySlot;

        if (mySlot >= 0)
        {
            SortingStockPlayers(mySlot);
            PhotonUtility.SetPlayerProperties(PhotonNetwork.player, PhotonEnums.Player.SlotIndex, mySlot);
        }


        if (!PhotonNetwork.isMasterClient)
        {
            photonView.RPC(PhotonEnums.RPC.RequestSicboSync, PhotonTargets.Others);
            Invoke("AssignPlayer", 4f);
        }
        else
        {
            AssignPlayer();
        }

        if (PhotonNetwork.isMasterClient)
        {
            StartCoroutine(_PreparingRound());
        }
    }
Example #2
0
 public void AutoBuyIn()
 {
     SetMinMax();
     PlayerUtility.BuyInFromBankAccount(maxBuy);
     PhotonUtility.SetPlayerProperties(PhotonNetwork.player, PhotonEnums.Player.Money, maxBuy);
     _PokerGameManager.instance.unsortedPlayers[0].AutoBuyIn(maxBuy);
 }
Example #3
0
 void RPC_ForceSyncBotMoney(long _money)
 {
     if (uiPlayerPoker.myPlayer != null)
     {
         PhotonUtility.SetPlayerProperties(uiPlayerPoker.myPlayer, PhotonEnums.Player.Money, _money);
         uiPlayerPoker.SyncMoney();
     }
 }
Example #4
0
    void RPC_RequestSicboSlot(PhotonMessageInfo info)
    {
        Logger.E("rpc_request sicbo slot");
        SyncSlots();
        int _available_slot = GetAvailableRoomSlotIndex();

        PhotonUtility.SetPlayerProperties(info.sender, PhotonEnums.Player.SlotIndex, _available_slot);
        photonView.RPC(PhotonEnums.RPC.ReturnSicboSlot, info.sender, _available_slot);
    }
Example #5
0
    public void Initiate(int _slotIndex, bool _isMine)
    {
        slotIndex = _slotIndex;
        isMine    = _isMine;
        strBets   = string.Empty;

        ExitGames.Client.Photon.Hashtable properties = photonPlayer.CustomProperties;
        displayName = (string)properties[PhotonEnums.Player.Name];
        coinOwned   = (long)properties[PhotonEnums.Player.Money];
        //textDisplayName.text = displayName;
        textCoinValue.text = coinOwned.toShortCurrency();
        PhotonUtility.SetPlayerProperties(photonPlayer, PhotonEnums.Player.Money, coinOwned);
    }
Example #6
0
 private void UpdateMoneyProperties(JSicboPlayer[] players)
 {
     for (int i = 0; i < players.Length; i++)
     {
         for (int j = 0; j < unsortedPlayers.Length; j++)
         {
             if (unsortedPlayers[j].photonPlayer != null)
             {
                 Logger.E("nn: " + unsortedPlayers[j].photonPlayer.NickName);
                 if (unsortedPlayers[j].photonPlayer.NickName == players[i].player_id.ToString())
                 {
                     Logger.E("Player id: " + players[i].player_id);
                     PhotonUtility.SetPlayerProperties(unsortedPlayers[j].photonPlayer, PhotonEnums.Player.Money, long.Parse(players[i].coin_after));
                 }
             }
         }
     }
 }
Example #7
0
    IEnumerator _UpdateMyUIPlayer(long chips)
    {
        yield return(_WFSUtility.wfs1);

        long prevMoney = myMoney - chips;

        trPanelMoney.SetAsLastSibling();

        float originalX = trPanelMoney.sizeDelta.x;
        float originalY = trPanelMoney.sizeDelta.y;

        trPanelMoney.sizeDelta = new Vector2(originalX + 500f, originalY);
        LeanTween.scale(trPanelMoney.gameObject, new Vector3(1.2f, 1.2f, 1.2f), 0.25f).setEaseOutBounce();
        long currentMoney = prevMoney;
        long counter      = 10;

        if (GlobalVariables.bIsCoins)
        {
            currentMoney *= 1000;
            chips        *= 1000;
        }
        long betPer = chips / counter;

        while (counter != 0)
        {
            currentMoney   += betPer;
            txtMyMoney.text = currentMoney.ToString("N0");

            counter--;
            yield return(_WFSUtility.wfs003);
        }
        LeanTween.scale(trPanelMoney.gameObject, Vector3.one, 0.25f).setEaseOutBounce();
        trPanelMoney.sizeDelta = new Vector2(originalX, originalY);
        trPanelMoney.SetSiblingIndex(1);
        if (myMoney <= 0)
        {
            myMoney = 0;
        }

        txtMyMoney.text = myMoney.toFlexibleCurrency();

        PhotonUtility.SetPlayerProperties(myPlayer, PhotonEnums.Player.Money, myMoney);
    }
Example #8
0
    public void ResetProperties()
    {
        StopCoroutine("MyTurnStart");

        UI_allin(false);

        panelPreAction.SetActive(false);
        panelState.gameObject.SetActive(false);
        panelBet.SetActive(false);
        panelTxtRankHand.SetActive(false);
        if (imgHandRank != null)
        {
            imgHandRank.gameObject.SetActive(false);
        }

        forceFold  = false;
        isFolded   = false;
        alreadyBet = false;

        chipsBet = 0;
        totalBet = 0;

        if (isMine || isBot)
        {
            if (myPlayer != null)
            {
                PhotonUtility.SetPlayerProperties(myPlayer, PhotonEnums.Player.TotalBet, totalBet);
            }
        }

        txtRole.text     = "";
        panelState.color = Color.white;
        txtBet.text      = "";
        txtHandRank.text = "";

        objCD.SetActive(false);
        DeactiveChips();

        ClearPreAction();

        hero.Revert();
        //avater3D.ChangeSkinColor(Color.white);
    }
Example #9
0
    public void AssignPlayer()
    {
        int slot_index = PhotonUtility.GetPlayerProperties <int> (PhotonNetwork.player, PhotonEnums.Player.SlotIndex);

        if (slot_index == -1)
        {
            PhotonUtility.SetPlayerProperties(PhotonNetwork.player, PhotonEnums.Player.SlotIndex, GetAvailableRoomSlotIndex());
            return;
        }

        //Check whether the game is already started
        ExitGames.Client.Photon.Hashtable playerProperties = PhotonNetwork.player.CustomProperties;
        playerProperties[PhotonEnums.Player.ContentURL] = PlayerData.costume_id;
        playerProperties[PhotonEnums.Player.PlayerID]   = PlayerData.id;
        playerProperties[PhotonEnums.Player.IsBot]      = false;
        playerProperties[PhotonEnums.Player.Name]       = PlayerData.display_name;
        playerProperties[PhotonEnums.Player.Gender]     = 0;
        playerProperties[PhotonEnums.Player.PictureURL] = string.Empty;
        PhotonNetwork.player.SetCustomProperties(playerProperties);

        objPlayers[slot_index].photonView.TransferOwnership(PhotonNetwork.player);
        objPlayers[slot_index].Initiate();
    }
Example #10
0
    public void ResetNextRound()
    {
        chipsBet = 0;

        if (isMine || isBot)
        {
            if (myPlayer != null)
            {
                PhotonUtility.SetPlayerProperties(myPlayer, PhotonEnums.Player.ChipsBet, chipsBet);
            }
        }

        alreadyBet       = false;
        txtRole.text     = "";
        panelState.color = Color.white;

        ClearPreAction();

        if (!isFolded)
        {
            panelState.gameObject.SetActive(false);
        }
    }
Example #11
0
 public void AutoBuyIn(long valMoney)
 {
     myMoney         = valMoney;
     txtMyMoney.text = myMoney.toFlexibleCurrency();
     PhotonUtility.SetPlayerProperties(myPlayer, PhotonEnums.Player.Money, myMoney);
 }
Example #12
0
 public void SetSicboBets(string strBets)
 {
     PhotonUtility.SetPlayerProperties(uiPlayer.photonPlayer, PhotonEnums.Player.Money, PlayerData.owned_coin);
     Logger.E("parasite strBets length: " + strBets.Length);
     PhotonUtility.SetPlayerProperties(uiPlayer.photonPlayer, PhotonEnums.Player.SICBO_BETS, strBets);
 }