public void ShareAction()
        {
            ///string msg = "Enter this code to earn mony " + SecurePlayerPrefs.GetString (GetPlayerDetailsTags.REFREL_CODE);
            ///
            /// Sumit Kumar invited you to play Ludo Money. Please enter referral code 0975345and get free 50 Rs worth of coins. Please download the game from:
            string msg = UserController.getInstance.Name + " invited you to play Ludo Money-First ever real money ludo game.Enter referral code '" + SecurePlayerPrefs.GetString(GetPlayerDetailsTags.REFREL_CODE) + "' & get coin worth Rs." + SecurePlayerPrefs.GetString(Tags.REFERRAL_COIN_FOR_OLD_PLAYER) + ". Download Now: " + SecurePlayerPrefs.GetString(Tags.APP_DOWNLOAD_URL);

            GameConstantData.shareText(msg);
        }
        //public void InviteFaceookFrnd ()
        //{

        //	string fbid = SecurePlayerPrefs.GetString (GetPlayerDetailsTags.PLAYER_FBID);
        //	if (fbid.Length > 1) {

        //		//print ("AddFriendAction working " + fbid);
        //		FB.Mobile.AppInvite (
        //			new Uri ("https://fb.me/" + fbid),
        //			new Uri ("https://play.google.com/store/apps/details?id=com.twist.Timepass"),
        //			delegate(IAppInviteResult result) {
        //				// Debug.Log (result.RawResult);
        //			}
        //		);
        //	}
        //}

        public void ShareCode()
        {
            int    entryFee  = GameConstantData.entryFee;
            string tableCode = TableCode.GetComponent <Text>().text;
            //// Debug.Log ("Entry fee "+entryFee);
            //Your friend "name" have invited you to play Ludo in a private room on Ludo Money. Please enter this code "code" to join your friend.
            //string s = "table joining fee " + entryFee + " Table code " + tableCode
            string s = "Your friend " + UserController.getInstance.Name + " have invited you to play Ludo in Rs." + GameConstantData.entryFee + " private room on Ludo Money. Please enter this code " + tableCode + " to join your friend at " + SecurePlayerPrefs.GetString(Tags.APP_DOWNLOAD_URL);

            GameConstantData.shareText(s);
        }
示例#3
0
 public void PlayNow()
 {
     //print ("coin is " + coin);
     if (coin > 0)
     {
         GameConstantData.entryFee = coin;
         SceneManager.LoadSceneAsync("GameScene");
     }
     else
     {
         GameConstantData.showToast(transform, "First select the coin to start game.");
     }
 }
 public void play()
 {
     if (coin > 0)
     {
         Debug.Log("USe Coin " + UserController.getInstance.Coin);
         if (coin <= float.Parse(UserController.getInstance.Coin))
         {
             GameConstantData.entryFee = coin;
             SceneManager.LoadSceneAsync("GameScene");
         }
         else
         {
             GameConstantData.showToast(transform, "You do not have sufficient coin.");
         }
     }
     else
     {
         GameConstantData.showToast(transform, "Please select bet amount.");
     }
 }
示例#5
0
        public void ShareAction()
        {
            string msg = "your friend invited you to play Ludo First ever real chip ludo game. Download Now: " + SecurePlayerPrefs.GetString(Tags.APP_DOWNLOAD_URL);

            GameConstantData.shareText(msg);
        }
示例#6
0
        void onRecivedMassage(string sender, string msg)
        {
            // try {

            JSONNode s = JSON.Parse(msg);

            switch (s[ServerTags.TAG])
            {
            case ServerTags.ROOM_INFO:
            {
                JSONNode pl     = s[ServerTags.ROOM_DATA];
                string   player = UserController.getInstance.ID;
                for (int i = 0; i < pl.Count; i++)
                {
                    JSONNode data = pl[i];
                    if (player.Equals(data[ServerTags.PLAYER_ID]))
                    {
                        TakeSeat(data);
                    }
                }
                for (int i = 0; i < pl.Count; i++)
                {
                    JSONNode data = pl[i];
                    if (!player.Equals(data[ServerTags.PLAYER_ID]))
                    {
                        if (!checkUserExist(data[ServerTags.PLAYER_ID]))
                        {
                            GameObject chair = getEmptySeat(int.Parse(data["COLOR"]));
                            if (chair)
                            {
                                chair.SetActive(true);
                                chair.GetComponent <OpponentPlayer> ().empty          = false;
                                chair.GetComponent <OpponentPlayer> ().userName.text  = "" + UppercaseFirst(data[ServerTags.DISPLAY_NAME]);
                                chair.GetComponent <OpponentPlayer> ().total_match    = int.Parse(data[DeviceTags.TOTAL_MATCH]);
                                chair.GetComponent <OpponentPlayer> ().won_match      = int.Parse(data[DeviceTags.WON_MATCH]);
                                chair.GetComponent <OpponentPlayer> ().PlayerImageUrl = "" + data[DeviceTags.PIC];
                                chair.GetComponent <OpponentPlayer> ().DisPlayname    = "" + data[DeviceTags.DISPLAY_NAME];
                                chair.GetComponent <OpponentPlayer> ().Player_ID      = "" + data[ServerTags.PLAYER_ID];
                                chair.GetComponent <OpponentPlayer> ().updateData();
                                chair.GetComponent <OpponentPlayer> ().showGoti();
                                SecurePlayerPrefs.SetString(GetPlayerDetailsTags.OPPONENT_NAME, "" + data[DeviceTags.DISPLAY_NAME]);
                                SecurePlayerPrefs.SetString(GetPlayerDetailsTags.OPPONENT_IMAGE, "" + data[DeviceTags.PIC]);
                            }
                        }
                    }
                }
            }
            break;

            case ServerTags.DRAW_GAME:
            {
                drawGame.SetActive(true);
            }
            break;

            case ServerTags.WINNER_PLAYER:
            {
                string player_name = UserController.getInstance.ID;

                JSONNode node      = s["RESULT"];
                string   Wincoin   = s["VALUE"];
                string   playerId1 = "";
                // Debug.Log ("result is " + node.Count);
                for (int i = 0; i < node.Count; i++)
                {
                    JSONNode node1    = node[i];
                    string   playerId = node1["PLAYER_ID"];
                    playerId1 = playerId;
                    string position     = node1["POSITION"];
                    string DISPLAY_NAME = node1[ServerTags.DISPLAY_NAME];
                    string pic          = node1["PIC"];
                    WinnerPanel.SetActive(true);
                    //print ("playerId " + playerId + " position " + position);
                    if (position.Equals("1"))
                    {
                        if (playerId.Equals(player_name))
                        {
                            WinnerPanel.transform.Find("panel").Find("WinText").gameObject.SetActive(true);
                            WinnerPanel.GetComponent <winnerPanelScript> ().updateName(DISPLAY_NAME, Wincoin, true, pic);
                        }
                        else
                        {
                            WinnerPanel.transform.Find("panel").Find("WinText").gameObject.SetActive(false);
                            WinnerPanel.GetComponent <winnerPanelScript> ().updateName(DISPLAY_NAME, Wincoin, false, pic);
                        }
                    }
                    else
                    {
                        GameObject newCell = Instantiate(cell);
                        newCell.transform.SetParent(Container.transform);
                        newCell.transform.localScale = new Vector3(1, 1, 1);
                        newCell.GetComponent <LooserCell> ().updateLoserCell(DISPLAY_NAME, position);
                    }
                }
                if (player_name.Equals(playerId1))
                {
                    GameDelegate.StartClappingSound();
                    WinnerAnimation.SetActive(true);
                    WinnerAnimation.GetComponent <ParticleSystem> ().Clear();
                    WinnerAnimation.GetComponent <ParticleSystem> ().Play();
                }
            }
            break;

            case ServerTags.GOTI_WIN:
            {
                string player = UserController.getInstance.ID;
                if (!player.Equals(s[ServerTags.PLAYER_ID]))
                {
                    GameDelegate.StartClappingSound();
                    GotiWinAnimation.SetActive(true);
                    GotiWinAnimation.GetComponent <ParticleSystem> ().Clear();
                    GotiWinAnimation.GetComponent <ParticleSystem> ().Play();
                    StartCoroutine(StopGotiAnimation());
                }
            }
            break;

            case ServerTags.START_DEAL:
            {
                //print ("START_DEAL working");

                CreatePrivateTatble.SetActive(false);
                JoinGamePanel.SetActive(false);
                loadingPanel.SetActive(false);
                CurrentPlayer.GetComponent <PlayerScript> ().EnableChatBtn();

                WinnerPanel.SetActive(false);
                WinnerAnimation.SetActive(false);
                WinnerAnimation.GetComponent <ParticleSystem> ().Clear();
            }
            break;

            case ServerTags.ROOM_PRICE:
            {
                try {
                    string player = UserController.getInstance.ID;
                    if (player.Equals(s[ServerTags.PLAYER_ID]))
                    {
                        int fee = int.Parse(s[ServerTags.VALUES]);
                        if (fee > int.Parse(UserController.getInstance.Coin))
                        {
                            CoinValidationPanel.SetActive(true);
                        }
                    }
                } catch (System.Exception ex) {
                    // Debug.Log (ex.Message);
                }
            }
            break;

            case ServerTags.RESET_GOTI:
            {
                for (int i = 1; i < 72; i++)
                {
                    onMoveGoti(i);
                }
            }
            break;

            case ServerTags.TURN_MISS:
            {
                if (int.Parse(s[ServerTags.VALUES]) != 0)
                {
                    string player = UserController.getInstance.ID;
                    if (player.Equals(s[ServerTags.PLAYER_ID]))
                    {
                        string message = s["ROOM_MESSAGE"];
                        GameConstantData.showToast(transform, message);
                        CurrentPlayer.GetComponent <PlayerScript> ().MissTurn(s[ServerTags.PLAYER_ID]);
                    }
                    else
                    {
                        foreach (GameObject chair in OpponentArray)
                        {
                            chair.GetComponent <OpponentPlayer> ().MissTurn(s[ServerTags.PLAYER_ID]);
                        }
                    }
                }
                else
                {
                }
            }
            break;

            default:
                break;
            }
            // } catch (System.Exception ex) {
            //   Debug.Log (ex.Message);
            // }
        }