Example #1
0
 public StackOfInt(WasRank rank)
 { // weekScore, totalScore, bestScore, contWinNum, winNum, lossNum, winNumWeek, lossNumWeek, lastWeekRank, thisWeekRank;
     Push3Int(rank.weekScore, rank.totalScore, rank.bestScore);
     Push3Int(rank.contWinNum, rank.winNum, rank.lossNum);
     Push3Int(rank.winNumWeek, rank.lossNumWeek, rank.lastWeekRank);
     PushAnInt(rank.thisWeekRank);
 }
Example #2
0
    public WasRank ParseRank()
    {
        WasRank rO = new WasRank()
        {
            weekScore   = PopHeadInt(), totalScore = PopHeadInt(), bestScore = PopHeadInt(),
            contWinNum  = PopHeadInt(), winNum = PopHeadInt(), lossNum = PopHeadInt(), winNumWeek = PopHeadInt(),
            lossNumWeek = PopHeadInt(), lastWeekRank = PopHeadInt(), thisWeekRank = PopHeadInt()
        };

        return(rO);
    }
Example #3
0
 bool IsInTheWasFriends(AmFriend pFrnd)
 {
     for (int k = 0; k < Ag.mySelf.arrFriendRank.Count; k++)
     {
         WasRank rObj = Ag.mySelf.arrFriendRank [k];
         if (pFrnd.UserID == rObj.userID)
         {
             return(true);
         }
     }
     return(false);
 }
Example #4
0
 //    "id":"90973535271650928","teamName":"batgi","kkoNick":"김정수","gameStatus":"ONLINE","league":"PRO_5","strIntArr":"5_5_0_","channel_id":"",
 //    "profileURL":"http://th-p.talk.kakao.co.kr/th/talkp/wkeHiXE0v9/zeO2E90FY2qYqgH159OWdk/cv6w1h_110x110_c.jpg",
 //    "rankIntStr":"0_0_0_0_0_0_0_0_0_0_",
 //    "server_id":"1","socket_id":"5V8oimk5rTGcDscV1pvk","channel_server_id":"","channel_user_no":""
 public bool ParseIntArr()
 {
     try {
         Ag.LogString(" NodeUser :: ParseIntArr ::  >>>     " + strIntArr);
         StackOfInt sInt = new StackOfInt(strIntArr);
         sInt.GetValue(out winNum, out losNum, out country);
         StackOfInt rInt = new StackOfInt(rankIntStr);
         rankObj = rInt.ParseRank();
     } catch {
         Ag.LogIntenseWord(" E R R O R   in  Parsing  ParseIntArr .. Country, Rank .. ");
         return(false);
     }
     return(true);
 }
    public override void SendAction()
    {
        Ag.LogString("WasFriendRank :: SendAction ...   Started ...  ");
        SendStr = "";
        SendStr = SendStr.AddCodeKeyKKOID(User, 150);
        SendStr = SendStr.AddKeyValue("formatVersion", 1);

        string frdArrStr = "";

        for (int j = 0; j < arrFriendIDs.Count; j++)
        {
            string frdStr = "";
            frdStr     = frdStr.AddKeyValue("userID", arrFriendIDs [j], false);
            frdStr     = frdStr.AddParen();
            frdArrStr += frdStr;
            if (j != arrFriendIDs.Count - 1)
            {
                frdArrStr += ",";
            }
        }
        frdArrStr = frdArrStr.AddSqreBrakt();

        SendStr = SendStr.AddArray("arrFriendID", frdArrStr, false);

        SendStr = SendStr.AddParen();

        postAction += () => {
            Ag.LogString("WasFriendRank :: postAction " + Result.result);
            // :[{"userID":"AppsTest0101","weekScore":0,"bestScore":0,"contWinNum":0,"winNumWeek":0,"lossNumWeek":0,"winNum":0,"lossNum":0},

            //JsonData arrJsO = JData ["arrFriendRank"];
            JSONNode arrJsO = NdObj ["arrFriendRank"];

            Ag.LogString("   Friend Count    " + arrJsO.Count);
            for (int j = 0; j < arrJsO.Count; j++)
            {
                WasRank anObj = new WasRank();  // JsonMapper.ToObject<WasRank> (arrJsO [j].ToJson ());
                anObj.Parse(arrJsO [j]);
                User.arrFriendRank.Add(anObj);
            }
            messageAction(Result.result);
            Ag.LogString("WasFriendRank :: postAction >>>  ");
        };

        SendAndRciv();
    }
Example #6
0
 public NodeUser()
 {
     rankObj    = new WasRank();
     gameStatus = "ONLINE"; // "MATCHING"
 }
    public override void Start()  // Imsi
    {
        //Purchase = PurchaseType.Nstore;

        Ag.LogIntenseWord(" MenuManager    Started ..... ");
        //mGameMatchOk = false;
        Ag.SingleTry    = 0;
        Ag.CurrentScene = "MENU";

        //-----------Popup Cash Item
        int ran = AgUtil.RandomInclude(1, 999);

        //if (Ag.mySelf.MinutesAfterRegist > 1440 && ran % 5 < 5) // 100 % @ 411


        Ag.ContGameNum = 0;
        mBackDepthFlag = false;
        MailItemInit();
        InitInAppPurchaseIOSnADR();
        mFriendId = "";
        Ag.mySelf.SetCostumeToCard();
        //FriendRank ();
        mwas                   = new WasCard();
        mCard                  = new AmCard();
        mRankFriend            = new WasRank();
        BarObj                 = new List <GameObject> ();
        mTimeLooseAtStartPoint = 0f;
        Ag.LogIntenseWord(" MenuManager :: Start  .. Game Init ()  ");
        LoadMenuResources();
        SettingLocal();

        // '킥오프' 주황색 버튼
        BtnKickOff.MakeAbility(true);
//        BtnKickOff.SetObjectsWithAlt ( FindMyChild (dicMenuList ["Ui_kickoff"], "Panel_bottom/bundle_rightbtn/btn1_ready2", false), null,
//            FindMyChild (dicMenuList ["Ui_kickoff"], "Panel_bottom/bundle_rightbtn/btn1_ready", true));


        if (Ag.mGuest)
        {
            Ag.mySelf.WAS.profileURL = "";
            Ag.mySelf.WAS.KkoNick    = "No name";
            Ag.mySelf.KkoNickEncode  = "No name";
        }
        else
        {
            Ag.mySelf.WAS.profileURL  = StcPlatform.ProfileURL;
            Ag.mySelf.WAS.KkoNick     = StcPlatform.PltmNick;
            Ag.mySelf.KkoNickEncode   = WWW.EscapeURL(StcPlatform.PltmNick);
            Ag.mySelf.TeamNameEncoded = WWW.EscapeURL(Ag.mySelf.WAS.TeamName);
        }

        if (PreviewLabs.PlayerPrefs.GetBool("DidTutorial"))
        {
            AgStt.mgGameTutorial = false;
        }
        else
        {
            AgStt.mgGameTutorial = true;
        }

        #if UNITY_EDITOR
        PreviewLabs.PlayerPrefs.SetBool("DidTutorial", true);
        AgStt.mgGameTutorial = false;
        #endif

        //GitIgnoreThis.GitIgnoreTutorial ();

        addsendmessageTutorPanel();

        Ag.LogIntenseWord(" MenuManager :: Start  .. for  ");

        for (int i = 0; i < KakaoFriends.Instance.appFriends.Count; i++)
        {
            if (i == KakaoFriends.Instance.appFriends.Count - 1)
            {
                mFriendId += KakaoFriends.Instance.appFriends [i].userid;
            }
            else
            {
                mFriendId += KakaoFriends.Instance.appFriends [i].userid + ",";
            }
            Debug.Log(mFriendId);
        }

        Kick_OffInit();
        PriceSetting();
        SetNodeDelegate();



        Ag.LogIntenseWord(" MenuManager :: Start  .. Sale Item  ");

        SaleItemSetting();
        //pushSetting ();

        Ag.mViewCard.CardLeagueSpritename(Ag.mySelf.WAS.League);

        Ag.LogIntenseWord(" MenuManager :: Start  .. spriteName  " + Ag.mySelf.WAS.League + Ag.mViewCard.LeagueSpriteNameS);
        dicMenuList ["Lobby_division"].GetComponent <UISprite> ().spriteName    = Ag.mViewCard.LeagueSpriteNameS;
        dicMenuList ["Ui_team_division"].GetComponent <UISprite> ().spriteName  = Ag.mViewCard.LeagueSpriteNameS;
        dicMenuList ["MY_Label_division"].GetComponent <UISprite> ().spriteName = Ag.mViewCard.LeagueSpriteNameS;


        //   Debug.Log (GiftRewardCode()+"   gift");

        #if UNITY_ANDROID
        var skus = new string[] {
            "com.prime31.testproduct",
            "android.test.purchased",
            "com.prime31.managedproduct",
            "com.prime31.testsubscription"
        };
        GoogleIAB.queryInventory(skus);
        #endif

        Ag.mySelf.ApplyCurrentDeck();
        Ag.LogIntenseWord(" MenuManager :: Start  .. End ....   ");
        //ShowDeckEffLabel ();

        InitFriendRank();

        if (Ag.mGameStartAlready)
        {
            Btn_Fun_MatchRequire();
            PopupAfterGameEnd();
            if (Ag.mBlueItemFlag)
            {
                StartCoroutine(btn_auto_label_Priceoff());
            }
        }
        else
        {
            if (Ag.mySelf.MinutesAfterRegist > 60 && ran % 20 == 3) // 5% ...  // ran % 5 < 5) // 100 % @ 411
            {
                PopupAfterUserCash();
            }
            BannerEventAction();
//            if (!PreviewLabs.PlayerPrefs.GetBool ("FirstCharge_check")) {
//                dicMenuList ["Ui_popup"].SetActive (true);
//                dicMenuList ["first_purchase"].SetActive (true);
//            }
        }
    }
Example #8
0
    /// <summary>
    /// 현재 게임 플레이중 표기
    /// </summary>
    IEnumerator  FriendUpdate()
    {
        FriendListUpdate = true;
        mRankFriend      = new WasRank();
        //Ag.LogString ("FriendUpdate");

        while (FriendListUpdate)
        {
            //while (!Ag.GameStt.IsGameMatched) {
            Ag.NodeObj.FriendsInfo(mFriendId);   // "90060594732486160,90060594732486160,90060594732486160"
            yield return(new WaitForSeconds(3));

            UIDraggablePanel2 DragPanel;
            UIGrid            Grid;
            //GmMailPrefab = (GameObject)Resources.Load ("prefab_General/Pref_GmMailList");
            //DeleteMailList ();
            yield return(new WaitForSeconds(3));

            SetFriendsListObject();

            foreach (Transform child in mRscrcMan.FindChild(dicMenuList ["Ui_kickoff"], "LPanel_friend/scroll_friend/grid", true).transform)
            {
                child.transform.FindChild("Checkbox_onoff/Background").GetComponent <UISprite> ().spriteName = "img_friendoff";
                child.GetComponent <FriendList> ().LogOn = false;
                for (int j = 0; j < arrFriendObj.Count; j++)
                {
                    if (child.name == j.ToString())
                    {
                        Material PlayerPic;
                        PlayerPic = Instantiate(Resources.Load("Materials/KakaoPic")) as Material;
                        FriendList scr    = child.GetComponent <FriendList> ();
                        AmFriend   curObj = arrFriendObj [j];
                        child.transform.FindChild("Label_name").GetComponent <UILabel> ().text = curObj.Nick;
                        GetRankList(curObj.UserID);
                        scr.KakaoID    = curObj.UserID;
                        scr.FriendNick = curObj.Nick;
                        if (mRankFriend.league.Substring(0, 3) == "PRO")    //_5" || mRankFriend.league == "PRO_4" || mRankFriend.league == "PRO_3" || mRankFriend.league == "PRO_2" || mRankFriend.league == "PRO_1") {
                        {
                            Ag.mViewCard.CardLeagueSpritename(mRankFriend.league);
                            int lgNum = mRankFriend.league.GetContinuousInteger();
                            child.transform.FindChild("division/div1").gameObject.GetComponent <UISprite> ().spriteName = "icon_div" + lgNum + "s";
                            //child.transform.FindChild ("division/div1").gameObject.GetComponent<UISprite> ().spriteName = Ag.mViewCard.LeagueSpriteNameS;
                        }
                        else
                        {
                            child.transform.FindChild("division/div1").gameObject.GetComponent <UISprite> ().spriteName = "icon_div5s";
                        }
                        child.transform.FindChild("face").gameObject.GetComponent <UITexture> ().material = PlayerPic;
                        child.transform.FindChild("btn_versuscall").gameObject.GetComponent <UIButtonMessage> ().target       = child.gameObject;
                        child.transform.FindChild("btn_versuscall").gameObject.GetComponent <UIButtonMessage> ().functionName = "versuscall";
                        child.transform.FindChild("Checkbox_onoff/Background").GetComponent <UISprite> ().spriteName          = "img_friendoff";
                        child.transform.FindChild("btn_nowplay").transform.gameObject.SetActive(false);
                        //child.transform.FindChild ("btn_versuscall").transform.gameObject.SetActive (false);
                        scr.PlayerNum = j;
                        scr.LogOn     = false;
                        child.name    = j.ToString();
                        if (curObj.IsOnNode)
                        {
                            Debug.Log(Ag.NodeObj.MatchOKwith(curObj.UserID).HasValue + "KKONICKNAME      " + curObj.Nick);
                            if (Ag.NodeObj.MatchOKwith(curObj.UserID).Value == true)
                            {
                                child.transform.FindChild("Checkbox_onoff/Background").GetComponent <UISprite> ().spriteName = "img_friendon";
                                child.transform.FindChild("btn_versuscall").transform.gameObject.SetActive(true);
                                child.transform.FindChild("btn_nowplay").transform.gameObject.SetActive(false);
                            }
                            else
                            {
                                child.transform.FindChild("Checkbox_onoff/Background").GetComponent <UISprite> ().spriteName = "img_friendplay";
                                child.transform.FindChild("btn_versuscall").transform.gameObject.SetActive(false);
                                child.transform.FindChild("btn_nowplay").transform.gameObject.SetActive(true);
                            }
                            scr.LogOn = true;
                        }
                        else
                        {
                            scr.LogOn = false;
                            child.transform.FindChild("btn_versuscall").transform.gameObject.SetActive(true);
                            child.transform.FindChild("btn_nowplay").transform.gameObject.SetActive(false);
                        }

                        if (PreviewLabs.PlayerPrefs.GetBool("viewUserpic"))
                        {
                            for (int i = 0; i < KakaoFriends.Instance.appFriends.Count; i++)
                            {
                                if (child.GetComponent <FriendList> ().KakaoID == KakaoFriends.Instance.appFriends [i].userid)
                                {
                                    child.transform.FindChild("face").gameObject.GetComponent <UITexture> ().material.mainTexture = dicTex [i];
                                }
                            }
                        }
                    }
                }
            }
        }
    }