Exemple #1
0
        public void ShareCode()
        {
            int    entryFee  = PlayerPrefs.GetInt(LudoTags.ENTRY_FEE);
            string tableCode = TableCode.text;
            string s         = "Join me on BetLudo table '" + tableCode + "' of Rs." + entryFee + ". Download Link 'http://betludo.com/game/ludo.apk'.";

            GameConstantData.shareText(s);
        }
        public void ShareAction()
        {
            ///string msg = "Enter this code to earn mony " + PlayerPrefs.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 = PlayerPrefs.GetString(GetPlayerDetailsTags.PLAYER_NAME) + " invited you to play Dreamz Club Ludo. Please enter referral code " + PlayerPrefs.GetString(GetPlayerDetailsTags.REFREL_CODE) + " and get free " + PlayerPrefs.GetString(Tags.REFERRAL_COIN_FOR_OLD_PLAYER) + " Rs worth of coins. Please download the game from: " + PlayerPrefs.GetString(Tags.APP_DOWNLOAD_URL);

            GameConstantData.shareText(msg);
        }
        private IEnumerator ServerRequest(WWW www)
        {
            yield return(www);

            if (www.error == null)
            {
                string response = www.text;
                Debug.Log("response " + response);
                try
                {
                    JSONNode node = JSON.Parse(response);
                    loading.SetActive(false);
                    if (node != null)
                    {
                        string result = node["status"];
                        if (result.Equals("OK"))
                        {
                            NoFriendFound.SetActive(false);
                            JSONNode FrndList = node["data"];
                            Debug.Log("count " + FrndList.Count);
                            for (int i = 0; i < FrndList.Count; i++)
                            {
                                JSONNode   data     = FrndList[i];
                                string     FrndName = data["name"];
                                string     MyID     = data["id"];
                                string     myImage  = data["image"];
                                GameObject newCell  = Instantiate(cell);
                                newCell.transform.SetParent(container.transform);
                                newCell.transform.localScale = new Vector3(1, 1, 1);
                                //    newCell.GetComponent<FacebookFriendCell>().UpdateCell(MyID, FrndName, myImage, false);
                            }
                        }
                        else
                        {
                            NoFriendFound.SetActive(true);
                            GameConstantData.showToast(transform, node["message"]);
                        }
                    }
                    else
                    {
                        NoFriendFound.SetActive(true);
                    }
                }
                catch (System.Exception ex)
                {
                    Debug.Log(ex.Message);
                }
            }
            else
            {
                NoFriendFound.SetActive(true);
                loading.SetActive(false);
            }
        }
 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 PeopleAction()
        {
            string msg = PlayerPrefs.GetString(GetPlayerDetailsTags.PLAYER_NAME) + " is invite you to play Dreamz Club Ludo. Please download the game from: " + PlayerPrefs.GetString(Tags.APP_DOWNLOAD_URL);

            GameConstantData.shareText(msg);



            /*
             *
             * for (int i = 0; i < container.transform.childCount; i++) {
             *  Destroy (container.transform.GetChild (i).gameObject);
             * }
             *
             * peoplepanel.SetActive (true);
             * WWWForm form = new WWWForm ();
             * form.AddField ("TAG", "ALLUSER");
             * form.AddField ("id", PlayerPrefs.GetString (GetPlayerDetailsTags.PLAYER_ID));
             * WWW w = new WWW (Tags.URL, form);
             * StartCoroutine (ServerRequest (w));
             * loading.SetActive (true);*/
            //		if (PlayerPrefs.GetString (GetPlayerDetailsTags.PLAYER_FBID).Length != 0) {
            //			peoplepanel.SetActive (true);
            //			peoplepanel.GetComponent<InviteFacebookFriends> ().ShowPanel ();
            //			if (GameConstantData.MyFriendsList.Count > 0) {
            //				NoFriendFound.SetActive (false);
            //			}
            //			foreach (FacebookFrndDetails frndList in GameConstantData.MyFriendsList) {
            //				string name = frndList.name;
            //				string fbID = frndList.fbID;
            //				string fbImage = frndList.imageUrl;
            //				//print (" Name " + name + " fb id " + fbID + " fb image " + fbImage);
            //
            //				GameObject newCell = Instantiate (cell);
            //				newCell.transform.SetParent (container.transform);
            //				newCell.transform.localScale = new Vector3 (1, 1, 1);
            //				newCell.GetComponent<FacebookFriendCell> ().UpdateCell (fbID, name, fbImage, false);
            //
            //			}
            //		} else {
            //
            //			 ("Please login with facebook? to share friend");
            //
            //		}
        }
 void searchTable()
 {
     if (PlayerPrefs.GetInt(LudoTags.ENTRY_FEE) <= int.Parse(PlayerPrefs.GetString(GetPlayerDetailsTags.PLAYER_COIN)))
     {
         Debug.Log("Search Game Room");
         Dictionary <string, object> dic = new Dictionary <string, object>();
         dic.Add(LudoTags.GAME_TYPE, PlayerPrefs.GetInt(LudoTags.GAME_TYPE));
         dic.Add(LudoTags.ENTRY_FEE, PlayerPrefs.GetInt(LudoTags.ENTRY_FEE));
         dic.Add(LudoTags.ROOM_TYPE, PlayerPrefs.GetInt(LudoTags.ROOM_TYPE));
         dic.Add(LudoTags.USER_LIMIT, PlayerPrefs.GetInt(LudoTags.USER_LIMIT));
         dic.Add(LudoTags.GOTI_LIMIT, PlayerPrefs.GetInt(LudoTags.GOTI_LIMIT));
         dic.Add(Tags.DOMAIN, Tags.URL);
         WarpClient.GetInstance().JoinRoomWithProperties(dic);
     }
     else
     {
         GameConstantData.showToast("You do not have sufficient coin.");
     }
 }
 public void createTable()
 {
     if (PlayerPrefs.GetInt(LudoTags.ENTRY_FEE) <= int.Parse(PlayerPrefs.GetString(GetPlayerDetailsTags.PLAYER_COIN)))
     {
         Debug.Log("Create Game Room");
         Dictionary <string, object> dic = new Dictionary <string, object>();
         dic.Add(LudoTags.GAME_TYPE, PlayerPrefs.GetInt(LudoTags.GAME_TYPE));
         dic.Add(LudoTags.ENTRY_FEE, PlayerPrefs.GetInt(LudoTags.ENTRY_FEE));
         dic.Add(LudoTags.ROOM_TYPE, PlayerPrefs.GetInt(LudoTags.ROOM_TYPE));
         dic.Add(LudoTags.USER_LIMIT, PlayerPrefs.GetInt(LudoTags.USER_LIMIT));
         dic.Add(LudoTags.GOTI_LIMIT, PlayerPrefs.GetInt(LudoTags.GOTI_LIMIT));
         dic.Add(Tags.DOMAIN, Tags.URL);
         WarpClient.GetInstance().CreateRoom("New Room", "ludo", PlayerPrefs.GetInt(LudoTags.USER_LIMIT), dic);
     }
     else
     {
         GameConstantData.showToast("You do not have sufficient coin.");
     }
 }
Exemple #8
0
        public void CreateTableAction()
        {
            if (coin > 0)
            {
                if (coin <= int.Parse(PlayerPrefs.GetString(GetPlayerDetailsTags.PLAYER_COIN)))
                {
                    PlayerPrefs.SetInt(LudoTags.ENTRY_FEE, coin);
                    if (PlayerPrefs.GetInt(LudoTags.ROOM_TYPE) == LudoTags.PRIVATE)
                    {
                        PlayerPrefs.SetString(GameTags.PRIVATE_TABLE_TYPE, GameTags.CREATE_TABLE);
                    }

                    // SceneManager.LoadSceneAsync("GameScene");
                }
                else
                {
                    GameConstantData.showToast("You do not have sufficient coin.");
                }
            }
            else
            {
                GameConstantData.showToast("first select the coin to start game?");
            }
        }
        private IEnumerator ServerRequestRedeem(WWW www)
        {
            yield return(www);

            if (www.error == null)
            {
                loading.SetActive(false);
                string response = www.text;
                try{
                    Debug.Log("Responce " + response);
                    JSONNode node = JSON.Parse(response);
                    loading.SetActive(false);
                    if (node != null)
                    {
                        string   status = node["status"];
                        JSONNode data   = node["data"];
                        //Debug.Log ("Data1 " + data1);
                        Debug.Log("Data " + data.ToString());
                        Debug.Log("status " + status);
                        if (status.Equals("OK"))
                        {
                            if (data.Count <= 0)
                            {
                                NoRecord.SetActive(true);
                            }
                            else
                            {
                                NoRecord.SetActive(false);
                            }
                            for (int i = 0; i < data.Count; i++)
                            {
                                string   status_type = "";
                                JSONNode userHis     = data[i];
                                string   amount      = userHis["amount"];
                                string   date        = userHis["date"];
                                string   status_str  = userHis["status"];
                                if (status_str.Equals("1"))
                                {
                                    status_type = "success";
                                }
                                else
                                {
                                    status_type = "Failed";
                                }
                                GameObject newCell = Instantiate(redeem_cell);
                                newCell.transform.SetParent(container.transform);
                                newCell.transform.localScale = new Vector3(1, 1, 1);
                                // newCell.GetComponent<RedeemCell>().UpdateCell(amount, date, status_type);
                            }
                        }
                        else
                        {
                            //print ("failed?");
                            NoRecord.SetActive(true);
                            GameConstantData.showToast(transform, node["message"]);
                        }
                    }
                }
                catch (System.Exception ex)
                {
                    Debug.Log(ex.Message);
                }
            }
            else
            {
                loading.SetActive(false);
            }
        }