Example #1
0
    public void SetGradeLevelWithNewDirection(string pGrade, int pLevel)
    {
        WAS.grade = pGrade;
        WAS.level = pLevel;

        WAS.InitDirectionAndSkill();
    }
Example #2
0
    public void SetBotScouter()
    {
        if (!WAS.isKicker)
        {
            ScoutObj = new Scouter("3_4_11_13_14_22_15_16_11_12_18_21");
            return;
        }

        ScoutObj = new Scouter();
        for (int k = 1; k <= 4; k++)
        {
            int wid = WAS.GetWidthOfDirection(k);
            int s   = wid * 5 / AgUtil.RandomInclude(50, 98);
            int f   = wid * 4 / AgUtil.RandomInclude(40, 78);
            s = s.GetSmaller(AgUtil.RandomInclude(3, 15));
            f = f.GetSmaller(AgUtil.RandomInclude(3, 15));
            //(k + "    wid " + wid + "   s / f " + s + ", " + f).HtLog ();
            ScoutObj.SetValue(k, s, f);
        }
        ScoutObj.GetString().HtLog();
    }
Example #3
0
    //  _////////////////////////////////////////////////_    _____   Send   _____   Receive   _____
    public void SendAndRciv()
    {
        //Ag.NetExcpt.WASActionTime = DateTime.Now;

        IsOK = null;
        Ag.LogString(" {{ " + TpStr + " }} :  SendAndRciv () >>> SEND ing >>    " + SendStr);
        try {
            RetryN++;

            RcvdStr = WAS.SendWASvrMessage(SendStr, Encript);
            Result  = new WasResult();
            Ag.LogString(" {{ " + TpStr + " }}    Received  () :: " + RcvdStr);
            if (RcvdStr == "CATCH")
            {
                IsOK          = false;
                Result.result = -99;
                return;
            }

            IsOK  = true;
            NdObj = JSON.Parse(RcvdStr);

            Result.result = -1;                                   // Default
            try {
                Result.serviceCode = NdObj ["serviceCode"].AsInt; // JData ["serviceCode"];
                Result.result      = NdObj ["result"].AsInt;      // (int)JData ["result"];  //  OK => 0 ...

                if (Result.result == 501)
                {
                    Ag.NetExcpt.WasLoginDuplicate = true;
                }
                else
                {
                    Ag.NetExcpt.WasLoginDuplicate = false;
                }

                Ag.LogString(" {{ " + TpStr + " }}          Result : " + Result.result + "        serviceCode : " + Result.serviceCode);
            } catch {
                Ag.LogIntenseWord(" {{ " + TpStr + " }} SendAndRciv () >>>  No result, serviceCode  !!   ");
            }
            try {
                if ((Result.result == 0 || Result.result == 4) && NdObj ["cash1"].AsBool)
                {
                    User.mCash1 = Ag.mySelf.mCash1 = NdObj ["cash1"].AsInt;
                    User.mCash2 = Ag.mySelf.mCash2 = NdObj ["cash2"].AsInt;
                    User.mGold  = Ag.mySelf.mGold = NdObj ["gold"].AsInt;
                    User.ShowCurrentCash();   // Log ..
                }
            } catch {
                Ag.LogString(" {{ " + TpStr + " }}  Result : " + Result.result + " serviceCode : " + Result.serviceCode + "   has  No Cash Info ...  OK ");
                //" No Cash Info ...  OK  ".HtLog ();
            }

            try {
                Ag.TimeNow       = long.Parse(NdObj ["serverTimeStampToUTC"]) / 1000;
                Ag.DTNowTickMark = DateTime.Now;
                Ag.LogString("   ServerTime :: " + Ag.UnixTimeStampToDateTime(Ag.TimeNow));
                //Ag.LogString ("   Parsing Time :: >>>    " + Ag.TimeNow);
            } catch {
                Ag.LogDouble(" {{ " + TpStr + " }}   ::   has  No Time Info ...  OK ");
            }

            if (postAction != null)
            {
                postAction();
            }
            //Ag.LogString (" {{ " + TpStr + " }} SendAndRciv () :: " + RcvdStr);
            Ag.LogNewLine(3);
        } catch {
            Ag.LogNewLine(5);
            Ag.LogString(" {{ " + TpStr + " }} SendAndRciv () >>>   Catch  !!!!!!!!   ");
            Ag.LogNewLine(5);
            CatchAction();
        }
    }