Ejemplo n.º 1
0
    //  _////////////////////////////////////////////////_    _____  Joyple  _____    JCE   _____
    public static void JceUrgentNoticePT(AmUser User)
    {
        Ag.LogStartWithStr(2, "   JceUrgentNoticePT  >>      Started   .........  . . . . . . ");
        WebClient webClient = new WebClient();

        webClient.QueryString.Add("game_code", "113");
        webClient.QueryString.Add("client_secret", "5423b620768434b2a928e2cc62af2785");

        string result;

        if (!JCE.WebDownloadString(webClient, JCE.NoticeUrl + "urgent-notice/info", out result))
        {
            return;
        }
        JSONNode jnObj = JSON.Parse(result);

        ("   JceUrgentNoticePT  >>  Received :::   " + result).HtLog();

        if (AgUtil.IsNullJson(jnObj ["result"] ["info"]))
        {
            return;
        }

        JSONNode imgNtc = jnObj ["result"] ["info"];

        Ag.LogString(" JceUrgentNoticePT ::  Count  " + imgNtc.Count);
        JceTextNotice img = new JceTextNotice(jnObj ["timestamp"]);

        img.ParseFrom(imgNtc);
        if (img.platform == 0 || img.platform == AgStt.JoyplePlatformID)
        {
            Joycity.UrgentNotice = img;
        }
    }
Ejemplo n.º 2
0
    public NodeActions(AmUser myAmUser)
    {
        MySocket = new NodeSocket(myAmUser.WAS.KkoID);

        MyUser = myAmUser;

        Ag.LogIntenseWord("NodeActions ::  Creating   >>>>>>>     " + MySocket.mName + "      <<<<<<<   ");

        MySocket.dlgtConnect += () => {
            MySocket.ActionUser();
        };

        MySocket.dlgtJoinAsVisitor += () => {
            if (AmHost.HasValue)
            {
                Ag.LogString(MySocket.mName + "_____  AmHost.HasValue    _____   " + AmHost.Value + " will be set as                 false   ");
            }
            AmHost = false;
        };

        MySocket.dlgtReverseHostVstr += () => {
            Ag.LogIntenseWord(MySocket.mName + "   MySocket.dlgtReverseHostVstr += () =>  From " + AmHost);
            AmHost = !AmHost;
        };

        MakeConnect();
    }
    string MessageItem(AmUser muser, string id)
    {
        string MessageItem = "";

        for (int i = 0; i < muser.arrItem.Count; i++)
        {
            if (muser.arrItem [i].WAS.itemTypeID == id)
            {
                MessageItem = muser.arrItem [i].WAS.msg;
            }
        }
        return(MessageItem);
    }
Ejemplo n.º 4
0
 //  ////////////////////////////////////////////////     Game Support Function
 public void CopyTextureFrom(AmUser pFrom)
 {
     mShirt.CopyFrom(pFrom.mShirt);
     mPants.CopyFrom(pFrom.mPants);
     mShoes.CopyFrom(pFrom.mShoes);
     mSocks.CopyFrom(pFrom.mSocks);
     mGlove.CopyFrom(pFrom.mGlove);
     mGlShirt.CopyFrom(pFrom.mGlShirt);
     mGlPants.CopyFrom(pFrom.mGlPants);
     mGlShoes.CopyFrom(pFrom.mGlShoes);
     mGlSocks.CopyFrom(pFrom.mGlSocks);
     mGlGlove.CopyFrom(pFrom.mGlGlove);
 }
Ejemplo n.º 5
0
    public void ActionRefuse(AmUser pMe)
    {
        Ag.LogStartWithStr(2, mName + "  ActionRefuse    Emit  ...  \t\t\t\t <<<   Action :: Join >>>");

        Dictionary <string, string> dRef = new Dictionary <string, string> ();

        dRef ["invite_from_user_id"] = CurEnemy.id;
        dRef ["invite_to_user_id"]   = pMe.WAS.KkoID;
        dRef ["invite_channel_id"]   = CurEnemy.channel_id;

        MySocket.Emit("INVITEREFUSE", dRef);
        Ag.LogIntense(1, false);
    }
Ejemplo n.º 6
0
    public bool ParseExchange(JSONNode pData, AmUser pEnemy)
    {
        Ag.LogStartWithStr(3, "NodeGameObject  ::  Parse Exchange   ");
        pEnemy = EnAmUser = new AmUser();

        Ag.LogString(" >>>   User   <<<     " + pData ["User"].ToString());

        JSONNode user = JSON.Parse(pData ["User"].ToString().RecoverFromDodgeStr(" ` ", true));

        EnAmUser.WAS.KkoID     = user ["KkoID"];
        EnAmUser.WAS.KkoNick   = user ["KkoNick"];
        EnAmUser.KkoNickEncode = user ["KNickEncode"];
        Ag.LogString("   >>>   " + EnAmUser.WAS.KkoID + EnAmUser.WAS.KkoNick);

        Ag.LogString(" >>>   Item   <<<     " + pData ["arrItemWas"]);
        JSONNode arrItm = JSON.Parse(pData ["arrItemWas"].ToString().RecoverFromDodgeStr(" ` ", true));

        for (int k = 0; k < arrItm.Count; k++)
        {
            Ag.LogString(arrItm [k].ToString());
            try {
                AmItem itm = new AmItem();
                itm.ParseFrom(arrItm [k]);
                itm.ShowMyself();
                EnAmUser.arrItem.Add(itm);
            } catch {
                Ag.LogString("                 ::  >>>    Item Parse   !!!!!     E R R O R    !!!!! ", pWichtig: true);
            }
        }
        Ag.LogNewLine(2);

        Ag.LogString(" >>>   Uniform   <<<     " + pData ["arrUniform"]);
        arrItm = JSON.Parse(pData ["arrUniform"].ToString().RecoverFromDodgeStr(" ` ", true));
        for (int k = 0; k < arrItm.Count; k++)
        {
            Ag.LogString(arrItm [k].ToString());
            AmUniform nUni = new AmUniform();
            EnAmUser.arrUniform.Add(nUni);
            try {
                nUni.Parse(arrItm [k]);
                nUni.WasParseColorStringToKickKeepObj();
            } catch {
                Ag.LogString("                 ::  >>>    ParseColorInfo   !!!!!     E R R O R    !!!!! ", pWichtig: true);
            }
        }
        Ag.LogString("NodeGameObject  ::  Parse Exchange           >>>>>      >>>>>    ");
        Ag.LogIntense(5, false);
        return(true);
    }
Ejemplo n.º 7
0
    void SetFinalScores()
    {
        AmGameLogic myGame = Ag.NodeObj.myGameLogic, enGame = Ag.NodeObj.enGameLogic;
        AmUser      myslf = Ag.mySelf, enemy = Ag.NodeObj.EnemyUser;

        // Ag.NodeObj.myGameLogic.CurAccumTotal;
        MyFinalScore = (int)myGame.GetTotalScore(Ag.mySelf.GetApplyIDofItem("CeremonyDefault"));            // 내 점수
        EnFinalScore = (int)enGame.GetTotalScore(Ag.NodeObj.EnemyUser.GetApplyIDofItem("CeremonyDefault")); // 상대 점수

        // Week Score
        Ag.LogString("MyCeremonyDefault   " + Ag.mySelf.GetApplyIDofItem("CeremonyDefault") + " EnCeremonyDefault   " + Ag.myEnem.GetApplyIDofItem("CeremonyDefault"));


        Ag.LogString("MyFinalScore   " + MyFinalScore + " EnFinalScore   " + EnFinalScore);

        Ag.LogString("myWeekScr   " + myWeekScr + " enWeekScr   " + enWeekScr);
        // 차감되는 패자 포인트
        TotalLoserPoint = Ag.mgDidWin ?
                          myGame.GetLoserTotalScore(Ag.NodeObj.EnemyLeague, MyFinalScore, (int)enWeekScr) :
                          enGame.GetLoserTotalScore(Ag.mySelf.WAS.League, EnFinalScore, (int)myWeekScr);
        TotalWinerPoint = Ag.mgDidWin ? MyFinalScore : EnFinalScore;

        // Deck Apply   5000, 2500 ==> 5500, 2200
        FinalWinPoDeck = Ag.mgDidWin ? myGame.ApplyDeckIncrease(TotalWinerPoint, myslf.WAS.DeckItem, myslf.DeckItemEA) :
                         enGame.ApplyDeckIncrease(TotalWinerPoint, enemy.WAS.DeckItem, enemy.DeckItemEA);
        FinalLosPoDeck = Ag.mgDidWin ? enGame.ApplyDeckLosingScore(TotalLoserPoint, enemy.WAS.DeckItem, enemy.DeckItemEA) :
                         myGame.ApplyDeckLosingScore(TotalLoserPoint, myslf.WAS.DeckItem, myslf.DeckItemEA);

        Ag.LogString("TotalLoserPoint   " + TotalLoserPoint + " TotalWinerPoint   " + TotalWinerPoint);
        // 차감되는 패자 포인트  (Week Score Applied)
        if (Ag.mgDidWin)
        {
            MyScoreAfterGame    = (int)(myWeekScr + FinalWinPoDeck);      // TotalWinerPoint); // winner
            EnemyScoreAfterGame = (int)(enWeekScr - (int)FinalLosPoDeck); // (int)TotalLoserPoint);
        }
        else
        {
            EnemyScoreAfterGame = (int)(enWeekScr + FinalWinPoDeck);      // TotalWinerPoint); // winner
            MyScoreAfterGame    = (int)(myWeekScr - (int)FinalLosPoDeck); // (int)TotalLoserPoint);
        }
        Ag.LogString("FinalWinPoDeck   " + FinalWinPoDeck + " FinalLosPoDeck   " + FinalLosPoDeck);
        // 4 score animation
        effMyTotalScore   = (int)myWeekScr;
        effEnemTotalScore = (int)enWeekScr;
        Ag.LogString("effMyTotalScore   " + effMyTotalScore + " effEnemTotalScore   " + effEnemTotalScore);

        Ag.LogString("MyScoreAfterGame   " + MyScoreAfterGame + " EnemyScoreAfterGame   " + EnemyScoreAfterGame);
    }
Ejemplo n.º 8
0
    public static void InitialWASJobs(AmUser user)
    {
        WasUserInfo bObj = new WasUserInfo()
        {
            User = user, flag = 1
        };

        bObj.messageAction = (int pInt2) => {
            WasItemPrice cObj = new WasItemPrice()
            {
                User = user, DiscountOnly = false
            };
            cObj.messageAction = (int pInt3) => {
            };
        };
    }
Ejemplo n.º 9
0
    public static void JceImageNotice(AmUser User)
    {
        Ag.LogStartWithStr(2, "   JceImageNotice  >>      Started   .........  . . . . . . ");
        WebClient webClient = new WebClient();

        webClient.QueryString.Add("game_code", "113");
        webClient.QueryString.Add("client_secret", "5423b620768434b2a928e2cc62af2785");

        //NoticeUrl = "http://dev-sys.m.joycity.com/";
        //string result = webClient.DownloadString (JCE.NoticeUrl + "image-notice/list");

        Joycity.arrImageNoti.Clear();

        string result;

        if (!JCE.WebDownloadString(webClient, JCE.NoticeUrl + "image-notice/list", out result))
        {
            return;
        }

        ("   JceImageNotice  >>  Received :::   " + result).HtLog();
        JSONNode jnObj = JSON.Parse(result);

        if (jnObj ["status"].AsInt == 1)
        {
            JSONNode imgNtc = jnObj ["result"] ["imageNotice"];
            Ag.LogString(" JceImageNotice ::  Count  " + imgNtc.Count);
            for (int k = 0; k < imgNtc.Count; k++)
            {
                JceImgNotice img = new JceImgNotice(jnObj ["timestamp"]);
                img.ParseFrom(imgNtc [k]);
                if (img.platform == 0 || img.platform == AgStt.JoyplePlatformID)
                {
                    Joycity.arrImageNoti.Add(img);
                }
            }
        }
        else
        {
            Ag.LogIntenseWord("Joyple Login Failed ....      Error      ....    ");
        }
        return;
    }
Ejemplo n.º 10
0
 public static string AddCodeKeyKKOID(this string pS, AmUser usr, int code, bool withComma = true)
 {
     if (usr == null)
     {
         Ag.LogString(" AddCodeKeyKKOID ::  User is Null   ! ! ! ! ! ! ! ! ! ! !  ", pWichtig: true);
     }
     pS = pS.AddKeyValue("serviceCode", code);
     if (Ag.mGuest)
     {
         pS = pS.AddKeyValue("userType", 0);
     }
     else
     {
         pS = pS.AddKeyValue("userType", 1);
     }
     pS = pS.AddKeyValue("userID", usr.WAS.KkoID);
     pS = pS.AddKeyValue("deviceUUID", usr.DeviceID);
     //pS = pS.AddKeyValue ("formatVersion", 1);
     return(pS.AddKeyValue("key", usr.WAS.WasKey, withComma));
 }
Ejemplo n.º 11
0
    public static void JceNotiMessage(AmUser user, string pUrl)
    { // logout, alarmOn, alarmOff
        Ag.LogStartWithStr(2, "   JceNotiLogMessage  >>      Started   .........  . . . . . . " + pUrl);
        WebClient webClient = new WebClient();

        webClient.QueryString.Add("uid", Ag.mySelf.WAS.KkoID);
        webClient.QueryString.Add("gcode", "113");
        webClient.QueryString.Add("token", JCE.GetToken());
        string result;
        string pushUrl = AgStt.PushURI + "/token/" + pUrl + ".json";

        if (!JCE.WebDownloadString(webClient, pushUrl, out result))
        {
            return;
        }

        ("   JceNotiLogMessage  >>  Received :::   " + result).HtLog();
        //JSONNode jnObj = JSON.Parse (result);
        return;
    }
Ejemplo n.º 12
0
    public static void GuestLogin(AmUser user)
    {
        StNet.GuestUserType0Tried = false;
        WasLogin aObj = new WasLogin()
        {
            User = user, osVer = "1.1"
        };

        aObj.messageAction = (int pInt) => {
            Ag.LogIntenseWord(" Result :: " + pInt);
            if (pInt == 0)   // OK..
            {
                InitialWASJobs(user);
            }
            if (pInt == -1)
            {
                GuestUserType1Login(user);
            }
        };
    }
Ejemplo n.º 13
0
    //  _////////////////////////////////////////////////_    _____   카드 전체를 업데이트 할 때    _____   Update   _____
    public static void UpdateAllCards(AmUser usr)
    {
        int           tNum       = usr.arrCard.Count;
        List <AmCard> upCards    = usr.GetUpdateCards();
        int           cardCounts = upCards.Count;
        //for (int kk = 0; kk < tNum; kk++) {
//        while (cardCounts > 0) {
//
//                WasCardUpdate aObj = new WasCardUpdate () { User = usr, arrSendCard = cardArr };
//                aObj.messageAction = (int pInt) => {
//                    switch (pInt) { // 0:성공, -1:캐쉬 부족, 1:잘못된 단위
//                    case 0:
//                        Ag.LogString (" result : Success ");
//                        return;
//                    }
//                };
//                cardArr = new List<AmCard> ();
//            }
//        }
    }
Ejemplo n.º 14
0
    public static void GuestUserType1Login(AmUser user)
    {
        StNet.GuestUserType0Tried = true;
        WasLogin aObj = new WasLogin()
        {
            User = user, osVer = "1.1"
        };

        aObj.messageAction = (int bInt) => {
            Ag.LogIntenseWord(" Result :: " + bInt);
            if (bInt == 0)
            {
                InitialWASJobs(user);
            }
            else
            {
                Ag.LogIntenseWord(" Login Error   Guest Case    .... Critical  ");
            }
        };
    }
Ejemplo n.º 15
0
    public static void JceNotiTokenSetting(AmUser user)
    {
        Ag.LogStartWithStr(2, "   JceNotiTokenSetting  >>      Started   .........  . . . . . . ");
        WebClient webClient = new WebClient();

        webClient.QueryString.Add("uid", Ag.mySelf.WAS.KkoID);  //"88865833564111728");
        webClient.QueryString.Add("gcode", "113");
        #if UNITY_IPHONE
        RemoteNotificationType arrNotiType = NotificationServices.enabledRemoteNotificationTypes;
        Ag.LogString(" Device Model ::  " + SystemInfo.deviceModel);
//        if (SystemInfo.deviceModel.Substring (0, 4) == "iPad")
//            webClient.QueryString.Add ("device", "3");
//        else
        webClient.QueryString.Add("device", "2");
        #endif
        #if UNITY_ANDROID
        webClient.QueryString.Add("device", "1");
        #endif

        string tken = JCE.GetToken();

        AgStt.PushURI.HtLog();

        if (tken == "ERROR")
        {
            Ag.LogIntenseWord("   Notification Token  Error    ");
            return;
        }

        webClient.QueryString.Add("token", JCE.GetToken());
        string result;
        string pushUrl = AgStt.PushURI + "/token/setting.json";
        if (!JCE.WebDownloadString(webClient, pushUrl, out result))
        {
            return;
        }
        ("   JceNotiTokenSetting  >>  Received :::   " + result).HtLog();
        //JSONNode jnObj = JSON.Parse (result);
        return;
    }
Ejemplo n.º 16
0
    public void xx4Debug_MakeMyCardsGradeS(AmUser pUser)
    {
        int  kickOdr = 1;
        bool keep    = false;

        for (int k = 0; k < arrCard.Count; k++)
        {
            AmCard curCd = arrCard [k];
            curCd.WAS.grade = "S";
            curCd.WAS.InitDirectionAndSkill();

            if (curCd.WAS.isKicker)
            {
                curCd.WAS.kickOrder = kickOdr < 6 ? kickOdr++ : -1;
            }
            else
            {
                curCd.WAS.kickOrder = keep ? -1 : 0;
                if (keep)
                {
                    curCd.WAS.kickOrder = -1;
                }
                else
                {
                    curCd.WAS.kickOrder = 0;
                    keep = true;
                }
            }
        }

//        WasCardUpdate aObj = new WasCardUpdate () { User = pUser };
//        aObj.messageAction = (int pInt) => {
//            switch (pInt) { // 0:성공, -1:캐쉬 부족, 1:잘못된 단위
//            case 0:
//                Ag.LogString (" result : Success ");
//                return;
//            }
//        };
//
    }
    /// <summary>
    /// GameStart
    /// </summary>
    ///
    ///
    //int mFriendmode = 1; //friend Mode
    void SendWasGamestart(AmUser MyCard, AmUser Enemcard)
    {  // 1 : retry, 2 : no
        if (Ag.SingleTry > 0)
        {
            return;
        }

        int contwinEnFlag = Ag.mSingleMode ? 1 :
                            (Ag.NodeObj.EnemyUser.ContWinStarted ? 1 : 2);

        if (Enemcard.WAS.KkoID == "BOT")
        {
            Ag.mFriendMode = 0;
        }

        WasGameStart aObj = new WasGameStart()
        {
            User            = Ag.mySelf, enemyID = Enemcard.WAS.KkoID, friendGame = Ag.mFriendMode,
            contWinMyFlag   = (Ag.mySelf.ContWinCoolTimeRemainPercent() > 0) ? 1 : 2,
            contWinEnemFlag = contwinEnFlag,
            arrCardId       = Ag.mySelf.GetMainCardIDs(), arrayEnemyId = Enemcard.GetMainCardIDs()
        };

        aObj.messageAction = (int pInt) => {
            switch (pInt)   // 0:성공, -1:캐쉬 부족, 1:잘못된 단위
            {
            case 0:
                Ag.LogString(" result : Success ");
                break;

            default:
                EnemyLeftflag = true;
                //Ag.NodeObj.LeaveMyself ();
                break;
            }
        };
    }
Ejemplo n.º 18
0
    public static void JceNotiSendMessage(AmUser user, string pMsg, string title = "This is Title", string image = "http://blog.ccbcmd.edu/connection/files/2012/09/No-Smoking-Sign-K-2685.gif")
    {
        Ag.LogStartWithStr(2, "   JceNotiSendMessage  >>      Started   .........  . . . . . . " + pMsg);
        WebClient webClient = new WebClient();

        webClient.QueryString.Add("uid", Ag.mySelf.WAS.KkoID);
        webClient.QueryString.Add("gcode", "113");
        webClient.QueryString.Add("msg", pMsg);
        //#if UNITY_ANDROID
        webClient.QueryString.Add("img", image);
        webClient.QueryString.Add("title", title);
        //#endif
        string result;
        string pushUrl = AgStt.PushURI + "/msg/insert.json";

        if (!JCE.WebDownloadString(webClient, pushUrl, out result))
        {
            return;
        }

        ("   JceNotiSendMessage  >>  Received :::   " + result).HtLog();
        //JSONNode jnObj = JSON.Parse (result);
        return;
    }
Ejemplo n.º 19
0
    public AmUser ParseFrom(JSONNode pJData)
    {
        AmUser rUsr = new AmUser(true, "NodeEnemyAmUserParse");

        "NodeRltd :: NodeAmUser :: ParseFrom  ".HtLog();
        try {
            rUsr.WAS.KkoID       = pJData ["KkoID"];   //.ToString ().RemoveQuotationMark ();
            rUsr.WAS.KkoNick     = pJData ["KkoNick"]; //.ToString ().RemoveQuotationMark ();
            rUsr.KkoNickEncode   = pJData ["KNickEncode"];
            rUsr.TeamNameEncoded = pJData ["TeamNameEncoded"];
            rUsr.WAS.League      = pJData ["League"];

            //Ag.NetExcpt.GamingEnemyID = rUsr.WAS.KkoID;
        } catch {
            Ag.LogString(" NodeRltd :: ParseFrom ::  >>>    KkoID   KkoNick  !!!!!     E R R O R    !!!!! ", pWichtig: true);
        }
        if (rUsr.KkoNickEncode == "%E0%B8%B8")
        {
            Ag.LogIntenseWord("   >>>  KkoNick   <<<   " + rUsr.KkoNickEncode);
            rUsr.KkoNickEncode = "..";
        }

        try {
            string contWinTryNot = pJData ["contWin"];
            rUsr.ContWinStarted = contWinTryNot == "TRY";
            Ag.LogString(" NodeRltd ::  " + rUsr.ContWinStarted.ShowBool(" ContWin ", " Try", " Not"));
        } catch {
            Ag.LogString(" NodeRltd :: ParseFrom ::  >>>    ContWin TRY  NOT");
        }
        Ag.LogString(" NodeRltd :: ParseFrom ::  >>>    KkoID : " + rUsr.WAS.KkoID + "   KkoNick : " + rUsr.WAS.KkoNick + "  !!!!! ");

        JSONNode itemArr = pJData ["arrItemWas"];

        ("    NodeRltd :: NodeAmUser :: ParseFrom >>          Item Array Parsing ____________" + itemArr.Count + "_____________ ").HtLog();
        for (int k = 0; k < itemArr.Count; k++)
        {
            try {
                AmItem itm = new AmItem();
                itm.ParseEnemyFrom(itemArr [k]);
                //itm.WAS = JsonMapper.ToObject<WasItem> (itemArr [k].ToJson ());
                itm.ShowMyself();
                rUsr.arrItem.Add(itm);
            } catch {
                Ag.LogString(" NodeRltd :: ParseFrom ::  >>>    Item Parse   !!!!!     E R R O R    !!!!! ", pWichtig: true);
            }
        }

        JSONNode uniformArr = pJData ["arrWasUniform"];

        Ag.LogStartWithStr(1, "    NodeRltd :: NodeAmUser :: ParseFrom >>          Uniform Array Parsing ____________" + uniformArr.Count + "_____________ ");
        for (int k = 0; k < uniformArr.Count; k++)
        {
            AmUniform nUni = new AmUniform();
            rUsr.arrUniform.Add(nUni);
            try {
                nUni.Parse(uniformArr [k]);
                nUni.WasParseColorStringToKickKeepObj();
            } catch {
                Ag.LogString(" NodeRltd :: ParseFrom ::  >>>    ParseColorInfo   !!!!!     E R R O R    !!!!! ", pWichtig: true);
            }
        }

        JSONNode cardArr = pJData ["arrCard"];

        Ag.LogStartWithStr(1, "    NodeRltd :: NodeAmUser :: ParseFrom >>          Card Array Parsing ____________" + cardArr.Count + "_____________ ");
        //cardArr.ToJson ().ToString ().HtLog ();
        for (int k = 0; k < cardArr.Count; k++)
        {
            try {
                AmCard nCard = new AmCard();
                nCard.WAS.WasCardParse(cardArr [k]);
                nCard.ScouterParse();
                rUsr.arrCard.Add(nCard);
            } catch {
                Ag.LogString(" NodeRltd :: ParseFrom ::  >>>    Card Parsing Failure    !!!!!     E R R O R    !!!!! ", pWichtig: true);
            }
        }
//        JSONNode cstmdArr = pJData ["arrCostume"];  // Should be deprecate ....
//        ("    NodeRltd :: NodeAmUser :: ParseFrom >>        Costume Array Parsing ____________" + cstmdArr.Count + "_____________ ").HtLog ();
//        for (int k = 0; k < cstmdArr.Count; k++) {
//            arrCostume.Add (new AmCostume (cstmdArr [k]));
//        }

        JSONNode cstmWasArr = pJData ["arrCostumeWas"];

        ("    NodeRltd :: NodeAmUser :: ParseFrom >>        Costume Was Array Parsing ____________" + cstmWasArr.Count + "_____________ ").HtLog();
        for (int k = 0; k < cstmWasArr.Count; k++)
        {
            AmCostume nObj = new AmCostume();
            nObj.WAS.ParseFrom(cstmWasArr [k]);
            rUsr.arrCostume.Add(nObj);
        }

        rUsr.ApplyCurrentDeck();
        //rUsr.ApplyDeckItemBeforeGame ();

        return(rUsr);
    }
Ejemplo n.º 20
0
    void ResGameMsg(IMessage theData)
    {
        //   {"name":"RES_GAMEMSG","args":[{"status":"FAIL","code":"ERR_NOOPPONENT"}]
        TimerStop();
        Ag.LogStartWithStr(2, mName + "  ResGameMsg    Rcvd  ...  " + IsGameHost.Value.ShowBool("I am ", "Host", "Vstr") + "\t\t\t\t >>>   Re Action   <<<");
        JSONNode argsJ = GetArguments(theData, mName);

        try {
            gameMsgCode = argsJ ["code"];
        } catch {
            Ag.LogString(mName + "  ResGameMsg ::  No code ");
        }

        if (NoOpponentProcess(gameMsgCode))
        {
            return;
        }

        JSONNode gData   = argsJ ["data"];// JsonMapper.ToObject (argsJ ["data"]);
        string   msgType = gData ["msgType"];

        gData = gData ["content"];

        string dodgeStr = gData.ToString().DodgeBackSlashQuoMark();

        (" ResGameMsg ::   dodgeStr  ::: " + dodgeStr).HtLog();
        dodgeStr = dodgeStr.Substring(1, dodgeStr.Length - 2);
        gData    = JSON.Parse(dodgeStr);
        (" ResGameMsg ::   gData ::: " + gData.ToString()).HtLog();

        Ag.LogString(mName + "  msgType    >>>>>  " + msgType + "  <<<<<   ");
        NodeGameBase theObj = null;

        switch (msgType)
        {
        case "GameStartMsg":
            GameStartMsg.Enem = true;
            return;

        case "SceneLoadComplete":
            SceneLoadComplete.Enem = true;
            return;

        case "RematchApply":
            ReMatchSent.Enem = true;
            return;

        case "RematchRefuse":
            ReMatchRefuseSend.Enem = true;
            return;

        case "AmUser":
            gData = JSON.Parse(dodgeStr.RecoverFromDodgeStr("@#@"));
            Ag.LogString(" ResGameMsg :: " + gData.ToString());

            EnemyUser = new AmUser(true, "DodgeDeviceID");
            EnemyUser = (new NodeAmUser()).ParseFrom(gData);
            "  NodeSocket :: ResGameMsg ::     case  ''AmUser''    >>>>>     Parsing Ended .....  ".HtLog();
            //AgStt.IsGaming = EnemyUser.Parsed = true;
            //AgStt.IsGaming = true;


            Ag.GameStt.EnemyInfoExchangeParsed(" AmUser ");


            if (!IsGameHost.Value)
            {
                ExchangeInfo();
            }
            //EnemyUser.ShowMyself ();
            return;

        case "PREPARE":
            AgStt.EnemyNodePrepareObj = new NodeGamePrepare();
            AgStt.MyNodePrepareObj    = new NodeGamePrepare();
            AgStt.EnemyNodePrepareObj.Parse(gData);
            AgStt.EnemyNodePrepareObj.ShowMyself();
            if (!IsGameHost.Value)
            {
                if (AgStt.EnemyNodePrepareObj.sessionKey != null && AgStt.EnemyNodePrepareObj.sessionKey.Length > 5)
                {
                    sessionKey = MyUser.WAS.GameSessionKey = AgStt.EnemyNodePrepareObj.sessionKey;
                }
                ActionGamePrepare(AgStt.MyNodePrepareObj);
            }
            return;

        case "TURN_RSLT":
            Ag.LogString(mName + "  Parsing   NodeGameTurnRslt   Object   ");
            theObj = new NodeGameTurnRslt();
            ((NodeGameTurnRslt)theObj).Parse(gData);
            //theObj = JsonMapper.ToObject<NodeGameTurnRslt> (gData.ToJson ());

            if (!IsGameHost.Value) // 받는 부분
            {
                sessionKey = ((NodeGameTurnRslt)theObj).sessionKey;
            }

            Ag.LogString(mName + "  Parsing Data" + theObj.ToString());
            Ag.LogString(mName + "  Parsing   NodeGameTurnRslt   Object   ... End   ");
            break;

        case "HOST_SEND":
            Ag.LogString(mName + "  Parsing   Game Void   Received    ... End   ");
            Ag.LogIntense(2, false);
            //theObj = JsonMapper.ToObject<NodeGameHostSend> (gData.ToJson ());
            return;//break;

        case "REVERSE":
            Ag.LogString(mName + "  ResGameMsg         REVERSE ... End ");
            dlgtReverseHostVstr();
            return;

        case "GOLDENBALL":
            Ag.LogString(mName + "  ResGameMsg         GOLDENBALL   " + gData ["BallKind"].ToString());
            Ag.LogString(mName + "  ResGameMsg         GOLDENBALL ... End ");
            return;
        }

        Ag.LogString(mName + "  ResGameMsg         Rcvd ... End ");
        arrGameRcvd.Add(theObj);

        dlgtGameGotResult();

        Ag.LogIntense(2, false);
    }
Ejemplo n.º 21
0
 public static string AddCodeKey(this string pS, AmUser usr, int code, bool withComma = true)
 {
     pS = pS.AddKeyValue("serviceCode", code);
     return(pS.AddKeyValue("key", usr.WAS.WasKey, withComma));
 }
    public void GameReport(AmUser WinnerUser, AmUser LoserUser, int WinPoint, int LoserPoint)
    {
        string winID, losID, myID = Ag.mGuest ? Ag.mySelf.DeviceID : Ag.mySelf.WAS.KkoID;

        myWeekScr = Ag.mySelf.myRank.WAS.weekScore;
        enWeekScr = Ag.NodeObj.MySocket.CurEnemy.rankObj.weekScore;

        if (Ag.SingleTry > 0)
        {
            Ag.NodeObj.MyUser.myRank.WAS.contWinNum = 0;
            Wincheck();
            WasCardUniformCostume aaObj = new WasCardUniformCostume()
            {
                User = Ag.mySelf, code = 240
            };
            aaObj.messageAction = (int pInt) => {
                switch (pInt)   // 0:성공
                {
                case 0:
                    Wincheck();
                    Ag.SingleTry = 0;
                    return;
                }
            };
            return;
        }

        if (Ag.mgDidWin)
        {
            if (Ag.mFriendMode != 1)
            {
                Ag.mySelf.CoolTimeChooseOneMoreGameWin();
            }
            winID = myID;
            losID = LoserUser.WAS.KkoID;
        }
        else
        {
            winID = WinnerUser.WAS.KkoID;
            losID = myID;
        }

        WasGameReport aObj = new WasGameReport()
        {
            User  = Ag.mySelf, winnerID = winID, loserID = losID,
            winPo = (int)TotalWinerPoint, losPo = (int)TotalLoserPoint
        };


        aObj.messageAction = (int pInt) => {
            switch (pInt)   // 0:성공, -1:캐쉬 부족, 1:잘못된 단위
            {
            case 0:
                if (mNetworkError)
                {
                    WincheckNetworkError();
                    mRscrcMan.FindChild(dicGameSceneMenuList ["popup"], "rematch_accept/btngrid/btn_rematch", false);
                }
                else
                {
                    Wincheck();
                }
                myCard.WAS.ResetWidthAndSkill();
                GameSceneCardUpdate();
                aObj = null;
                Ag.LogString(" result : Success ");
                return;
            }
        };
    }
Ejemplo n.º 23
0
    public override void Start()
    {
        Ag.LogIntenseWord(" Test.cs :: Start ");
        myGUI = new AmUI();
        myGUI.SetColumns(3, 18);
        ndGUI.SetColumns(2, 18);

        mTimeLooseAtStartPoint = 0.5f;
        base.Start();
        // Test ID Setting ....    WAS, Node     related ......    etc...
        Ag.mySelf = myUser = new AmUser();

        // Kakao Login case
        myUser.WAS.KkoID = "88214690633939999"; //"00000690633939993";//(CAMERA)  // "88214690633939999";  // <FakeKKO>  88299368562514961 <Legend Card>

//        Ag.mGuest = true;
//        myUser.DeviceID = "MOONTEST0000";


        myUser.WAS.TeamName = "TeamName22"; // 01604eb9f3657ae65bb9d8382b36d4c7 <Rolco DID>  //  "90973535271650928";//(CAMERA)
        myUser.WAS.KkoNick  = "Nick2424";
        myUser.WAS.Country  = 11;

        user2 = new AmUser();

        user2.DeviceID = user2.DeviceID + "Alt";

        user2.WAS.KkoID    = "91278098233517152"; //"90060594732486160"; //"88894476708738001";//"APPS_TEST_ID_0002";  90060594732486160  88306087115705857  90060594732486160 <KimDR>
        user2.WAS.TeamName = "Teamamama";         // 88214690633939121<Rolco>  91278098233517152 <Moon iPAD>  88712330645978192 <Moon> 88159078716546208 <Cho>
        user2.WAS.KkoNick  = "Nickkkkk";
        user2.WAS.Country  = 22;

        Ag.LogString("//  _////////////////////////////////////////////////_    _____  Test  _____   Test Started   _____");



        Ag.LogString("   abc_34 >>> " + "abc_34".GetContinuousInteger());
        Ag.LogString("   Pro_5 >>> " + "Pro_5".GetContinuousInteger());
        Ag.LogString("   empty >>> " + "".GetContinuousInteger());

        MtCompact aCom = new MtCompact(60);

        aCom.AddNum(10);
        aCom.AddNum(5);
        aCom.AddNum(8);
        aCom.AddNum(9);
        aCom.AddNum(31);

        aCom.AddNum(29);
        aCom.AddNum(48);
        aCom.AddNum(59);
        aCom.AddNum(9);
        aCom.AddNum(59);

        for (int k = 0; k < 10; k++)
        {
            Ag.LogString("  nth >> " + k + "    val >> " + aCom.GetNth(k));
        }

        aCom.ParseSelf();


        Ag.LogString(" time span check " + DateTime.Now + " is now " + (DateTime.Now - TimeSpan.FromHours(24)));


        #if UNITY_IPHONE
        AgStt.mIAP.TheUser = myUser;

        NotificationServices.RegisterForRemoteNotificationTypes(RemoteNotificationType.Alert | RemoteNotificationType.Badge | RemoteNotificationType.Sound);
//        Ag.LogIntenseWord ("NotificationServices.RegisterForRemoteNotificationTypes  ");


        //        Ag.LogString ("  string Null Check " + string.IsNullOrEmpty (null));   // IsNullOrEmpty  string ...
        //        Ag.LogString ("  string Null Check " + string.IsNullOrEmpty (""));  true
        //        Ag.LogString ("  string Null Check " + string.IsNullOrEmpty (" ")); false

        Ag.LogString("//  _////////////////////////////////////////////////_    _____  Test  _____   Time & Date   _____");
        DateTime dtNow = DateTime.Now;
        Ag.LogString(" theNow.ToLongTimeString () " + dtNow.ToLongTimeString());
        Ag.LogString(" 1398369347000 theNow.ToFileTime () " + dtNow.ToFileTime());
        Ag.LogString(" theNow.ToFileTimeUtc () " + dtNow.ToFileTimeUtc());

        long lgNow = dtNow.ToFileTimeUtc();
        Ag.LogString(" Recover >>> " + DateTime.FromFileTimeUtc(lgNow).ToString());


        (" dtNow   " + dtNow.ToString()).HtLog();
        dtNow = dtNow.AddSeconds(1234567);
        (" dtNow   " + dtNow.ToString()).HtLog();
        (" 10,000 sec :: " + UtTimestamp.ToDateTime(100000).ToString()).HtLog();
        int iNow = UtTimestamp.ToTimestamp(DateTime.Now);
        (" UtTimestamp.ToTimestamp  : Now  ==> " + iNow).HtLog();
        (" Back to Not :: " + UtTimestamp.ToDateTime(iNow).ToString()).HtLog();

        DateTime after10min = UtTimestamp.ToDateTime(iNow + 600);

        Ag.LogString(" After 10 Min ::  " + after10min.Minute.ToString() + " : " + after10min.Second.ToString());


        //  _////////////////////////////////////////////////_    _____  Test  _____    Score   _____
        GameLogic();

        //  _////////////////////////////////////////////////_    _____  Test  _____    Encript   _____
        // TestEncript();

        //  _////////////////////////////////////////////////_    _____  Test  _____    Deck System   _____
        Ag.LogString("//  _////////////////////////////////////////////////_    _____  Test  _____    Deck System   Case 1 >> _____");

        AmGameLogic aGLogic = new AmGameLogic("", "");
        Ag.LogString("  Score " + 5000 + "  1 * 7% " + aGLogic.ApplyDeckIncrease(5000f, new int[] { 0, 1, 0 }, 1));
        Ag.LogString("  Score " + 5000 + "  2 * 7% " + aGLogic.ApplyDeckIncrease(5000f, new int[] { 1, 1, 0 }, 2));
        Ag.LogString("  Score " + 5000 + "  3 * 7% " + aGLogic.ApplyDeckIncrease(5000f, new int[] { 1, 1, 1 }, 3));

        Ag.LogString("  Score " + 5000 + "  1 * 10% " + aGLogic.ApplyDeckLosingScore(5000f, new int[] { 2, 7, 3 }, 2));
        Ag.LogString("  Score " + 5000 + "  2 * 10% " + aGLogic.ApplyDeckLosingScore(5000f, new int[] { 7, 7, 3 }, 2));
        Ag.LogString("  Score " + 5000 + "  3 * 10% " + aGLogic.ApplyDeckLosingScore(5000f, new int[] { 7, 7, 7 }, 2));



        //  _////////////////////////////////////////////////_    _____  Test  _____    Meta Programming   _____
        Ag.LogDouble("  Meta Programming >>>  " + char.Parse("3") + " " + char.Parse("4") + char.Parse("K"));
//        char ch3 = char.Parse ("3"), ch4 = char.Parse ("4");
//        (ch3 > ch4).ToString ().HtLog ();
//        (ch3 < ch4).ToString ().HtLog ();
//        (" 0 : to Byte " + Convert.ToByte ("0").ToString () + " -> char -> byte : " + Convert.ToByte (char.Parse ("0"))).HtLog ();
//        (" 1 : to Byte " + Convert.ToByte ("1").ToString () + " -> char -> byte : " + Convert.ToByte (char.Parse ("1"))).HtLog ();
//        (" 9 : to Byte " + Convert.ToByte ("9").ToString () + " -> char -> byte : " + Convert.ToByte (char.Parse ("9"))).HtLog ();
//        ("00345 parse :: " + int.Parse ("000345")).HtLog ();
//
//        ("GetContinuousInteger  Test >>   abcde345dkdk  ::  " + "abcde345dkdk".GetContinuousInteger ()).HtLog ();
//        ("GetContinuousInteger  Test >>   abcde00345dkdk34399  ::  " + "abcde00345dkdk34399".GetContinuousInteger ()).HtLog ();
//        ("GetContinuousInteger  Test >>   abcde002345dkdk34399  ::  " + "abcde002345dkdk34399".GetContinuousInteger ()).HtLog ();
//        ("GetContinuousInteger  Test >>   abcdewlwlwl  ::  " + "abcdewlwlwl".GetContinuousInteger ()).HtLog ();

        //  _////////////////////////////////////////////////_    _____  Test  _____    Game Win / Lose   _____
//        bool goal = AgUtilGame.DidKickerWinThisTurn(5, 3, 0, 0);
//        Ag.LogString ("   goal  >>>   " + goal);
//        goal = AgUtilGame.DidKickerWinThisTurn(5, 3, 1, 2);
//        Ag.LogString ("   goal  >>>   " + goal);

        //  _////////////////////////////////////////////////_    _____  Test  _____    ??   _____
//
//
//        string str = "1~`aA+_';\"지금";
//
//        Encoding unicode = Encoding.Unicode;
//        Encoding utf8 = Encoding.UTF8;
//
//        byte[] unicodeBytes = unicode.GetBytes(str);
//
//        byte[] utf8Bytes = Encoding.Convert( unicode,
//            utf8,
//            unicodeBytes );
//
//        //Console.WriteLine( "UTF Bytes:" );
//        StringBuilder sb = new StringBuilder();
//        foreach( byte b in utf8Bytes ) {
//            sb.Append( b ).Append(" : ");
//        }
//
//
//        Ag.LogIntenseWord ("   UTF 16 :: " + sb.ToString());
//
        Ag.LogString("  Jail Break Result >>>>>  Fb.JailBreakIOS : " + Fb.JailBreakIOS);
        #endif
        timerObj.WaitTimeFor(0, 0, 8);


        #if UNITY_EDITOR
        " #if UNITY_EDITOR ".HtLog();
        #endif

        //  _////////////////////////////////////////////////_    _____  Test  _____    T e s t   _____
        // # 참고... String 이 너무 짧아 crash 되는 소스. iOS try 문에서 잡아줌. ...
        //NotificationServices.enabledRemoteNotificationTypes.ToString ().HtLog ();



//        Ag.LogStartWithStr (3, "  Card  WAS   SetDirection ()  ");
//        AmCard tCrd = new AmCard ();
//        tCrd.WAS.grade = "S";
//        tCrd.WAS.isKicker = true;
//        tCrd.WAS.SetDirection ();
//        tCrd.WAS.ShowMySelf ();

        //Ag.SingleTry = 1;

        string hanTest = WWW.UnEscapeURL("%EC%9E%AC%EA%B2%BD%EA%B8%B0%EC%88%98%EB%9D%BD%20%EC%8B%9C%EA%B0%84%EC%B4%88%EA%B3%BC");

        hanTest = "%E0%B8%B8%32";
        if (hanTest == "%E0%B8%B8")
        {
            Ag.LogIntenseWord("  if (hanTest  ");
        }

        WWW.EscapeURL("ุ").HtLog();
        hanTest = WWW.UnEscapeURL(null);

        string errhanTest = WWW.UnEscapeURL(WWW.EscapeURL("종국이 총각 김치"));   // Error

        Ag.LogStartWithStr(3, "  0.ToFixedWidth (jarisu++).HtLog();" + hanTest + errhanTest);

        int jarisu = 0;
        0.ToFixedWidth (jarisu++).HtLog();

        //  AgUtil.ToJson  int 어레이를 Json 으로.
        ("  AgUtil.ToJson  Test ::   " + AgUtil.IntArrToJson("AgUtil.ToJson", new int[] {
            3, 4, 5
        })).HtLog();
        ("  AgUtil.ToJson  Empty ::   " + AgUtil.IntArrToJson("AgUtil.ToJson  >> ", new int[] { })).HtLog();
        Ag.LogNewLine(1);

        // Null Parsing
        string   strNullInclude = " {\"WasKey\":null}";
        JSONNode aNde           = JSON.Parse(strNullInclude);
        string   strNullParsed  = aNde ["WasKey"];
        Ag.LogString("  if (aNde['WasKey'] == null)   is true   " + aNde ["WasKey"] + aNde ["WasKey"].ToString());
        if (AgUtil.IsNullJson(aNde ["WasKey"]))
        {
            Ag.LogString("  OK   print this line ......     AgUtil.IsNullJson    Success  ...... ");
        }
        ("  this is null parse to Int test >>>  " + aNde ["Nooo"].AsInt).HtLog();
        ("  this is null parsing  >>>>  " + aNde ["WasKey"]).HtLog();                                            // null
        ("  this is null parsed String  >>>>  " + strNullParsed + "  Length : " + strNullParsed.Length).HtLog(); // null4 .. ??


        // Simple JSON Test
        ATestClass aObb  = new ATestClass();
        string     jsStr = JsonMapper.ToJson(aObb); // LitJson 으로 인코딩.. int 355
        ("  object ==> JsonMapper.ToJson  ==>   jsStr :: >>   " + jsStr).HtLog();
        JSONNode jsLitSim = JSON.Parse(jsStr);
        ("       Parsed  as  >>>>      " + jsLitSim.ToString()).HtLog();
        ("  If no info JSON Parsing ::  This will Crash ???   " + jsLitSim ["Empty"].AsBool.ToString() + " <<  AsBool == false ...   ").HtLog();
        ("  If no info JSON Parsing ::  This will Crash ???   " + jsLitSim ["Empty"].AsInt.ToString() + " <<  AsInt == false ...   ").HtLog();
        ("        Just[\"sB\"] :  " + jsLitSim ["sB"] + "        Add  ToString() : " + jsLitSim ["sB"].ToString()).HtLog();
        //public string nameOfYourVariable = MemberInfoGetting.GetMemberName(() => MyVariable);
        Ag.LogNewLine(1);

        // Print Name of variables ....   Reflection  ???
        int    nameOfInt          = 35;
        string nameOfYourVariable = AgUtil.GetN(() => nameOfInt);
        ("   nameOfYourVariable  >>  Test ::  Key : " + nameOfYourVariable + "  Value : " + nameOfInt).HtLog();
        Ag.LogNewLine(1);

        // Null test ...
        ("  {  }   Test IsJsonNull  >> All True ?? >>  " + " { } ".IsJsonNull() + " {} ".IsJsonNull() + "null".IsJsonNull() + "{ }".IsJsonNull()).HtLog();
        ("  {  }   Test IsJsonNull  >> All True ?? >>  " + " { _ } ".IsJsonNull() + "  }{  ".IsJsonNull()).HtLog();



        Ag.LogIntense(5, false);
    }
Ejemplo n.º 24
0
    //  _////////////////////////////////////////////////_    _///////////////////////_    _____  Ag  _____  Static Class  _____
    static Ag()
    {
        LogIntenseWord(" static Ag() ");

        if (mVirServer != null)
        {
            LogIntenseWord(" static Ag() .. Abort ..  ");
            return;
        }
        else
        {
            mVirServer = new AmServer();   // [2012:11:11:MOON] Single Mode...
        }
        Ag.mySelf = new AmUser();
        Ag.myEnem = new AmUser();         //Ag.mFBobj = new AmFacebook();

        //Ag.DeviceUID = SystemInfo.deviceUniqueIdentifier;

        //SystemInfo.deviceModel          SystemInfo.deviceUniqueIdentifier        SystemInfo.operatingSystem        SystemInfo.deviceName

        //  ////////////////////////////////////////////////     Debugging ...
        mIsDebug = true;
        //AgNoShare.GenTempID ();
        mgScrX = Screen.width;
        mgScrY = Screen.height;
        Ag.LogString("Ag::Init  mgScrX: " + mgScrX + ", mgScrY: " + mgScrY);

        //  ////////////////////////////////////////////////     Global Variables : Initial Value Setting

        Ag.mSingleMode   = false;
        mgServerLoggedIn = mGameStartAlready = mNetPackWaiting = false;
        //Ag.mLoginPhase = "LP";
        //Ag.mgLanguage = Application.systemLanguage.ToString ();
        //Ag.mgLanguage = "KOR";
        Ag.mgLanguage = "KOR"; //Ag.mgLanguage.Substring (0, 3);
        if (Ag.mgLanguage != "Chi" && Ag.mgLanguage != "Kor" && Ag.mgLanguage != "Jap" &&
            Ag.mgLanguage != "Spa" && Ag.mgLanguage != "Ger")
        {
            Ag.mgLanguage = "Eng";
        }
        mCountryData = new DataBaseCountry();
        //  ////////////////////////////////////////////////     Deprecate Nominee ss ....
        //  Some variables ...  put here ...

        #if UNITY_IPHONE
        Ag.LogString("IPhone Setting ");



//        if (iPhone.generation == iPhoneGeneration.iPhone4 || iPhone.generation == iPhoneGeneration.iPhone4S || iPhone.generation == iPhoneGeneration.iPhone5) {
//            Ag.mgIsRetina = true;
//            Ag.mgIsIPhone = true;
//        }
//        if (iPhone.generation == iPhoneGeneration.iPhone3GS) {
//            Ag.mgIsRetina = false;
//            Ag.mgIsIPhone = true;
//        }
        #endif

        #if UNITY_ANDROID
        Ag.LogString("Android Setting ");

        //AgUtil.mAppleReviewURL = "https://play.google.com/store/apps/details?id=com.appsgraphy.psykickbattle&feature=search_result#?t=W251bGwsMSwyLDEsImNvbS5hcHBzZ3JhcGh5LnBzeWtpY2tiYXR0bGUiXQ";
        //AgUtil.mAppStoreURL = AgUtil.mAppleReviewURL;
        mgScrX = Screen.height / 2 * 3;
        mgScrY = Screen.height;
        #endif

        if (mgScrX < mgScrY)
        {
            mgScrY = mgScrX;
            mgScrX = Screen.height;
        }
        Ag.LogString("Ag ()   Creation  .....  >>>>>>>>>>>>>>>>>>>>>  >>>>>>>>>>>>  >>>>>>>>   OK   ");

        //GitIgnoreThis.GitIgnoreSetup ();

        Ag.LogNewLine(3);
    }
Ejemplo n.º 25
0
    public void SetSkillPositions(AmCard pCard, bool pDidBuyPotion, bool pEventPotion, bool pMinusPotion, AmUser pUser, int costumeNum)
    {//[2012:11:09:LJK] Random Item Acc Good Perfect  modified
        arrArea = new ArrayList();

        //case 0:     good = 20f; better = .5f;     break;
        //Debug.Log ("Card Good :: SetSkillPositions" + pCard.WAS.skill[0] + "Perfect" + pCard.WAS.skill[1] + "      CardGRADE     " + pCard.WAS.grade);

        int good, prft;

        if (AgStt.mgGameTutorial)
        {
            mGood    = pCard.WAS.skill [0];
            mPerfect = pCard.WAS.skill [1];
        }
        else
        {
            WAS.GetSkillFinalValue(pUser.arrUniform [0].Kick.Shirt.Texture, pUser.arrUniform [0].Kick.Pants.Texture, pUser.arrUniform [0].Kick.Socks.Texture, costumeNum,
                                   out good, out prft, Ag.mgDirection);

            mGood    = good;
            mPerfect = prft;
        }

        //Debug.Log ("mGood :: SetSkillPositions" + mGood + "mPerfect :: SetSkillPositions"+ mPerfect);

        // Potion...
        if (pDidBuyPotion)
        {
            mGood    *= 1.2f;
            mPerfect += 30f;
        } //[2012:11:09:LJK] Random Item Acc Good Perfect  modified
        if (pEventPotion)
        {
            mPerfect += 20f;
        }//[2012:11:09:LJK] Random Item Acc Good Perfect  modified
        float cen, sta;

        if (AgStt.mgGameTutorial)
        {
            cen = 241f;
            sta = cen - mGood * 0.5f;
        }
        else
        {
            cen = 300f;
            sta = cen - mGood * 0.5f;
        }

        //Ag.LogIntenseWord ("   SetSkillPositions  >>>>>    mGood :: " + mGood + "     mPerfect :: " + mPerfect + "  sta : " + sta);
        arrArea.Add(new int[] { 1, (int)sta, (int)(sta + mGood) });
        if (mPerfect > 0) // Regend card has no perfect area ....
        {
            InsertSmallArea(2, (int)(cen - 0.5f * mPerfect), (int)(cen + 0.5f * mPerfect));
        }
    }