public void TestEncript()
    {
        //  _////////////////////////////////////////////////_    _____  Test  _____    Encript   _____
        Ag.LogString("//  _////////////////////////////////////////////////_    _____  Test  _____    Encript   _____");
        UTAES.AESEncrypt128("1~`aA+_';\"지금").HtLog();
        Ag.LogNewLine(3);

        ("1~`aA+_';\"" + WWW.EscapeURL("지금")).HtLog();
        UTAES.AESEncrypt128("1~`aA+_';\"%EA%B0%80").HtLog();   //+ WWW.EscapeURL("가")).HtLog();

        string encrpt = UTAES.AESEncrypt128("This is test string   ");

        encrpt = UTAES.AESDecrypt128(encrpt);
        Ag.LogIntenseWord("  UTAES Encript >> " + encrpt);

        encrpt = UTAES.AESEncrypt128("1~`aA+_';\"%EA%B0%80", true);
        encrpt = UTAES.AESDecrypt128(encrpt, true);
        Ag.LogIntenseWord("  UTAES  private Encript >> " + encrpt);

        encrpt = UTAES.AESEncrypt128("1~`aA+_';\"지금", true);
        encrpt = UTAES.AESDecrypt128(encrpt, true);
        Ag.LogIntenseWord("  UTAES  private Encript >> " + encrpt);

        Ag.LogDouble("  AESEncrypt128    Test              >>>>>>>>>>>>>>>>>>>>>>>   .... >>>>       _____  End   >>>  ");
    }
 public void LogSortNum()
 {
     foreach (UIManagerBase man in arrMan)
     {
         man.LogSortNum();
         Ag.LogNewLine(3);
     }
 }
 public void ShowAdvantage()
 {
     Ag.LogNewLine(2);
     Debug.Log("AmPlayer :: mPosition >> LU : " + mDirectObj.mPosition [0] + " RU : " + mDirectObj.mPosition [1]
               + " LD : " + mDirectObj.mPosition [2] + " RD : " + mDirectObj.mPosition [3]);
     Debug.Log("mDirectObj :: mWidth " + mDirectObj.mWidth [0] + ",  " + mDirectObj.mWidth [1] + ",  "
               + mDirectObj.mWidth [2] + ",  " + mDirectObj.mWidth [3] + "\n");
 }
Beispiel #4
0
 public void ShowMyself()
 {
     if (!Ag.mIsDebug)
     {
         return;
     }
     Ag.LogStartWithStr(3, "AmUser :: ShowMyself >> ");
     Ag.LogString("     Was Info  ::  ID " + WAS.KkoID + "   Nick : " + WAS.KkoNick + "  League : " + WAS.League);
     Ag.LogNewLine(3);
 }
    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);
    }
Beispiel #6
0
    //  ////////////////////////////////////////////////     ////////////////////////     >>>>> Mouse Down Hold Up.... <<<<<
    public virtual void MouseDown(Vector3 pWorldPo, Vector3 pScreenPo)
    {
        if (touchStt.HasValue && touchStt.Value == true)
        {
            MouseUp();
        }
        touchStt = false;
        arrTouch.Clear();

        muiPrvTouchCo   = muiStartCo = muiTouchCo = pWorldPo;
        muiTouchCnt     = 0;
        muiAccumDist    = 0;
        muiSwitchingTar = muiSelectedObj = null;
        Ag.LogNewLine(5);
        Ag.LogString(mName.LogWith("Wagu") + " __________  Mouse Down   ________________   At : " + muiStartCo.LogWith("StartCo") + muiState);
        Ag.LogString(mName.LogWith("Wagu") + " __________  Mouse Down   ");
        Ag.LogNewLine(2);
    }
Beispiel #7
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);
    }
Beispiel #8
0
    //  ////////////////////////////////////////////////     ////////////////////////     >>>>> Initialize.... <<<<<
    public static void Init()
    {
        // [2013:1:3:MOOON] New Started
        Ag.LogLineIntense("Unity :: Ag.cs >>>>>   Init ");



        // Debug, Platform related Settings.
        mIsDebug = true;

        // [2012:11:11:MOON] Single Mode...
        mSingleMode = Ag.mgFBisValid = false;

        // Variables Initiation
        mShowWaitSign = mgServerLoggedIn = mgFBisValid = mgIsGuestMode =
            mgIsThePacketSent2theServer = mgAmIhavingPorsion = mGameStartAlready = mNetPackWaiting = false;
        Ag.mLoginPhase = "LP";

        // Screen Size
        mgScrX = Screen.width; mgScrY = Screen.height;
        if (mgScrX < mgScrY)
        {
            float longer = mgScrY; mgScrY = mgScrX;  mgScrX = longer;
        }
        Ag.LogString("Ag::Init   Screen Size >>>>>   mgScrX: " + mgScrX + ", mgScrY: " + mgScrY);
        Ag.LogNewLine(2);

        // Language
        Ag.mgLanguage = Application.systemLanguage.ToString();
        Ag.mgLanguage = Ag.mgLanguage.Substring(0, 3);
        if (Ag.mgLanguage != "Chi" && Ag.mgLanguage != "Kor" && Ag.mgLanguage != "Jap" &&
            Ag.mgLanguage != "Spa" && Ag.mgLanguage != "Ger")
        {
            Ag.mgLanguage = "Eng";
        }
        Ag.LogString("Ag::Init   Current Language is >>> " + Ag.mgLanguage);

#if UNITY_IPHONE
        Ag.mPlatform = Platform.IOS;
        //Ag.mIAP = new AmIAP();

        if (iPhone.generation == iPhoneGeneration.iPhone4 || iPhone.generation == iPhoneGeneration.iPhone4S)
        {
            Ag.mgIsRetina = true; Ag.mgIsIPhone = true;
        }
        if (iPhone.generation == iPhoneGeneration.iPhone3GS)
        {
            Ag.mgIsRetina = false; Ag.mgIsIPhone = true;
        }
#endif
#if UNITY_ANDROID
        //Ag.mPlatform = Platform.OSX;
        //else
        Ag.mIAP      = new AmIAP();
        Ag.mPlatform = Platform.DRD;
        //Screen.SetResolution((Screen.height/2)*3 ,Screen.height,false);
        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


        Ag.LogIntenseWord("  End of Ag.Init ");
    }
Beispiel #9
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);
    }
Beispiel #10
0
    void SetStateArraySingleMode()
    {
        mStateArr.AddAMember("Begin", 4f);  //ljk 10.31
        mStateArr.AddEntryAction(() => {
            Ag.ContGameNum++;
            mGameOver     = false;
            mNetworkError = false;
            EnemUserCheck = false;
            //TurnNum = 0;  //Ag.NodeObj.TurnNum = mTurnNum;
            Ag.NodeObj.EnemyUser = Ag.myEnem;
            dicGameSceneMenuList ["Panel_item"].SetActive(false);
            arrMyScore    = new List <bool> ();
            arrEnScore    = new List <bool> ();
            arrAllMyScore = new List <bool> ();
            arrAllEnScore = new List <bool> ();
            dicGameSceneMenuList ["EnemyPointLabel"].GetComponent <UILabel> ().text = "0";
            dicGameSceneMenuList ["MyPointLabel"].GetComponent <UILabel> ().text    = "0";
            if (Ag.mGuest)
            {
                dicGameSceneMenuList ["Mynick"].GetComponent <UILabel> ().text = "No name"; // "NONAME";
            }
            else
            {
                dicGameSceneMenuList ["Mynick"].GetComponent <UILabel> ().text = WWW.UnEscapeURL(Ag.mySelf.WAS.TeamName);
            }
            dicGameSceneMenuList ["Enemnick"].GetComponent <UILabel> ().text  = Ag.mVirServer.teamName;
            dicGameSceneMenuList ["MyScore"].GetComponent <UILabel> ().text   = "0";
            dicGameSceneMenuList ["EnemScore"].GetComponent <UILabel> ().text = "0";

            Ag.mViewCard.CardLeagueSpritename(Ag.mySelf.WAS.League);
            dicGameSceneMenuList ["IngameUserDiv"].GetComponent <UISprite> ().spriteName = Ag.mViewCard.LeagueSpriteNameS;


            if (Ag.mSingleMode)
            {
                dicGameSceneMenuList ["IngameEnemDiv"].GetComponent <UISprite> ().spriteName = Ag.mViewCard.LeagueSpriteNameS;
            }
            else
            {
                Ag.mViewCard.CardLeagueSpritename(Ag.NodeObj.EnemyUser.WAS.League);
                dicGameSceneMenuList ["IngameEnemDiv"].GetComponent <UISprite> ().spriteName = Ag.mViewCard.LeagueSpriteNameS;
            }

//            Ag.NodeObj.MySocket.dlgtIleft = IleftGame; // leave;
//            Ag.NodeObj.MySocket.dlgtEnemyLeft = EnemyLeftGame; // enemy Leave;

            if (Ag.NodeObj.AmHost.HasValue)
            {
                Ag.mgIsKick = Ag.NodeObj.AmHost.Value;
            }

            DrinkSkill();
            Ag.mySelf.SetCostumeToCard();
            Ag.NodeObj.EnemyUser.SetCostumeToCard();
        });
        //  ________________________________________________ Add A Member.. Add A Member..
        mStateArr.AddAMember("CountDn", 0.5f);
        mStateArr.AddEntryAction(() => {
            //Ag.LogString ("Game :: CountDn ");
            //Debug.Log ("GamePack" + Ag.mgGamePackReceived);
        });
        mStateArr.AddExitCondition(() => {
            return(true);  //ljk 11 11
        });
        mStateArr.AddExitAction(() => {
            //Debug.Log ("GotoPreGame");
        });
        mStateArr.AddTimeOutProcess(20.0f, () => {
            Ag.LogNewLine(20);
            Ag.LogString("Application.LoadLevel");
            mStateArr.SetStateWithNameOf("HeartBeat");  // [2012:11:12:MOON] Heart Beat       //mAwayMyself = true;
        });
        //  ________________________________________________ Add A Member.. Add A Member..
        mStateArr.AddAMember("PreGame", 3f);
        mStateArr.AddEntryAction(() => {
            Ag.ContGameNum += 1;
            //Debug.Log ("backGreenItemPosition    " + dicGameSceneMenuList["Anim_back_green"].gameObject.transform.localPosition.y);
            dicGameSceneMenuList ["Panel_item"].SetActive(true);
            ItemPowerUpImagechange();
            //Debug.Log ("backGreenItemPosition    " + dicGameSceneMenuList["Anim_back_green"].gameObject.transform.localPosition.y);
            GUI.color = new Color(1f, 1f, 1f, 1f);
            if (Ag.mgIsKick)
            {
                CreateCursor();
            }

            if (Ag.mgIsKick && !AgStt.mgGameTutorial)     //...  Set Player Object
            {
                dicGameSceneMenuList ["MainBar"].SetActive(true);
            }
            else
            {
                DragPosition(true);
                DragPositionF(true);
                dicGameSceneMenuList ["Panel_keeperarrow_Main2"].SetActive(true);
                dicGameSceneMenuList ["Panel_keeperarrow_set"].SetActive(true);
                StartCoroutine(KeeperTimer());
            }
            StartCoroutine(CoruKickerDirBarOff());
            //Debug.Log (mSinglePlayerNum + "------------------------------------------------------------------mSinglePlayer");
        });
        mStateArr.AddExitAction(() => {
            RedbullNum();
        });
        mStateArr.AddAMember("BeforeDirPotion", 1f);
        mStateArr.AddEntryAction(() => {
            SetKickerDir(false);
            if (Ag.mgIsKick)
            {
                RedItemLogic();
            }

            mStage.mIsTouched = mStatusSillBar = false;
            if (mEventItemShowTime)
            {
                StartCoroutine(WaittimeItemShow(2f));
            }
            else
            {
                mEventItemShowTime = false;
            }
            if (!mDidEventPotion && !mDirMinuspotion)
            {
                mStateArr.SetStateWithNameOf("MidPausBiggerGamdDir");
            }
        });
        //  ________________________________________________ Add A Member.. Ljk Mid Direction potion..
        mStateArr.AddAMember("MidPausBiggerGamdDir", 1f);
        mStateArr.AddEntryAction(() => {
            GameObject mDirUPclone;
            if (Ag.mgIsKick)
            {
                if (mDidEventPotion || Ag.mGreenItemFlag)
                {
                    StartCoroutine(ItemeffOn("backeffect_green"));
                    myCard.ExpandDirection();
                    DestoryGuideBar();
                    //DrawGuideLine2 ();
                    DrawGuideLineNew();
                    SoundManager.Instance.Play_Effect_Sound("ApplyRedBull");
                    if (!Ag.mGreenItemFlag)
                    {
                        Ag.mBallEventAlready = mItemflag1 = mDidEventPotion = mDirMinuspotion = false;
                        Setitem("Anim_back_green", false);
                        Setitem("Anim_eff03_green", false);
                    }
                }
                mStartTime = Time.timeSinceLevelLoad;
            }
        });

        mStateArr.AddAMember("GameDir", 2f);
        mStateArr.AddEntryAction(() => {
            mStage.InitCursorMove(mEventDirspeed, 300f);
            mSkillSound = mTempUseInStates = false;
            //Ag.NodeObj.GameVoid ();
            if (Ag.mgIsKick)
            {
                SoundManager.Instance.Play_Effect_Sound("BarMoving_01");
            }
        });
        mStateArr.AddDuringAction(() => {
            if (mStage.mIsTouched && !mTempUseInStates)
            {
                SetPlayerDir2();    //SetStatusBar();
                mTempUseInStates = true;
            }
        });
        mStateArr.AddAMember("MidPaus", 0.3f);
        mStateArr.AddEntryAction(() => {
            mTimer.SetActive(false);
            FindMyChild(dicGameSceneMenuList ["Panel_item"], "btn_scouter", false);
            FindMyChild(dicGameSceneMenuList ["Panel_item"], "progress_scouter", false);
            SetSkillValues();

            if (Ag.mgIsKick)
            {
                Ag.mRound++;
                if (Ag.mgDirection == 0)
                {
                    SetKickerDir(false);
                }
            }
            else
            {
                if (0 < Ag.mgDirection)
                {
                    SoundManager.Instance.Play_Effect_Sound("SelectDirection");
                }
            }
            DragPosition(false);
            DragPositionF(false);
            dicGameSceneMenuList ["Panel_keeperarrow_Main2"].SetActive(false);
            //DragPositionLastSetDir (true);
        });
        mStateArr.AddExitAction(() => {
            mStage.InitCursorMove(0.8f, 300f);
        });  // Save Touch Points [GAM_RLT]
        //  ________________________________________________ Add A Member.. Add A Member..
        mStateArr.AddAMember("MidPausPotion", 1f);
        mStateArr.AddEntryAction(() => {
            if (!Ag.mgIsKick)
            {
                RedItemLogic();
            }
            SkillCursor();
            if (!Ag.mgIsKick)
            {
                //CreateCursor ();
                //SkillCursor ();
                //KeeperUISwipeSetLastDir (Ag.mgDirection);
            }
            if (!Ag.mgIsKick && mIsKeeperSkl != 5)
            {
                //Debug.Log (mIsKeeperSkl + "KeeperDirNum");
                //KeeperSelectedBar (mIsKeeperSkl);
                //mKeeperUIBar [mIsKeeperSkl - 1].animation.Play ("AlphaAni2");
            }
            mStage.mIsTouched = mStatusSillBar = false;
            //mKeeperSelectBar.SetActive (false);
            if (!mDidBuyPotion && !mEventPotion && !mEventminusPotion && !Ag.mBlueItemFlag)
            {
                mStateArr.SetStateWithNameOf("MidPausBiggerPotion");
            }
            else
            {
                if (mDidBuyPotion || Ag.mBlueItemFlag)
                {
                    //Debug.Log ("Drink!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
                    SoundManager.Instance.Play_Effect_Sound("ApplyRedBull");
                    //arrStatusBar[0].animation.Play("");
                    //GameObject.Find ("UI Root/Camera/Anchor/StatusBar/Redbull/Background").gameObject.animation.Play ("pocari");
                }
            }
            //            Debug.Log ("Create Skl BAr");
            //DestoryGuideBar();
            if (!AgStt.mgGameTutorial)
            {
                dicGameSceneMenuList ["MainBar"].SetActive(false);
                dicGameSceneMenuList ["MainSkillBar"].SetActive(true);
                if (myCard.WAS.grade == "S")
                {
                    dicGameSceneMenuList ["MainSkillBar"].SetActive(false);
                    dicGameSceneMenuList ["SGrade_MainSkillBar"].SetActive(true);
                }
            }
            DestoryGuideBar();
            //DrawCreateSklLine (4, 125, 475);

            if (Ag.mgIsKick)
            {
                if (myCard.arrCostumeInCard.Count > 0)
                {
                    if (myCard.arrCostumeInCard [0].WAS.itemTypeId == "KickerShoes01")
                    {
                        CostumeNum = 1;
                    }
                    if (myCard.arrCostumeInCard [0].WAS.itemTypeId == "KickerShoes02")
                    {
                        CostumeNum = 2;
                    }
                    if (myCard.arrCostumeInCard [0].WAS.itemTypeId == "KickerShoes03")
                    {
                        CostumeNum = 3;
                    }
                    if (myCard.arrCostumeInCard [0].WAS.itemTypeId == "KickerShoes04")
                    {
                        CostumeNum = 4;
                    }
                }
                //Debug.Log ("GoodBar :: GetSkillFinalValue "+ myCard.mGood);
                //myCard.WAS.GetSkillFinalValue (Ag.mySelf.arrUniform [0].Kick.Shirt.Texture, Ag.mySelf.arrUniform [0].Kick.Pants.Texture, Ag.mySelf.arrUniform [0].Kick.Socks.Texture, CostumeNum, out myCard.WAS.skill [0], out myCard.WAS.skill [1]);

                dicGameSceneMenuList ["MainSkillBar"].transform.FindChild("bar1").GetComponent <UISprite> ().spriteName   = "skillbar0";
                dicGameSceneMenuList ["MainSkillBar"].transform.FindChild("bar2_1").GetComponent <UISprite> ().spriteName = "skillbar1_1";
                dicGameSceneMenuList ["MainSkillBar"].transform.FindChild("bar2_1").transform.localPosition = new Vector3(((0.3f * 580) - 290), -260, 0);
                dicGameSceneMenuList ["MainSkillBar"].transform.FindChild("bar3").transform.localPosition   = new Vector3(((0.3f * 580) - 290), -260, -0.1f);

                LegendSkillbar();


                //Debug.Log ("GoodBar :: stateArray "+ myCard.mGood);
            }
            else
            {
                if (myCard.arrCostumeInCard.Count > 0)
                {
                    if (myCard.arrCostumeInCard [0].WAS.itemTypeId == "KeeperGloves01")
                    {
                        CostumeNum = 1;
                    }
                    if (myCard.arrCostumeInCard [0].WAS.itemTypeId == "KeeperGloves02")
                    {
                        CostumeNum = 2;
                    }
                    if (myCard.arrCostumeInCard [0].WAS.itemTypeId == "KeeperGloves03")
                    {
                        CostumeNum = 3;
                    }
                    if (myCard.arrCostumeInCard [0].WAS.itemTypeId == "KeeperGloves04")
                    {
                        CostumeNum = 4;
                    }
                }
                //Debug.Log ("GoodBar :: stateArray " + myCard.mGood);
                //myCard.WAS.GetSkillFinalValue (Ag.mySelf.arrUniform [0].Keep.Shirt.Texture, Ag.mySelf.arrUniform [0].Keep.Pants.Texture, Ag.mySelf.arrUniform [0].Keep.Socks.Texture, CostumeNum, out myCard.WAS.skill [0], out myCard.WAS.skill [1]);


                dicGameSceneMenuList ["MainSkillBar"].transform.FindChild("bar1").GetComponent <UISprite> ().spriteName   = "skillbar_keeper0";
                dicGameSceneMenuList ["MainSkillBar"].transform.FindChild("bar2_1").GetComponent <UISprite> ().spriteName = "skillbar_keeper1_1";
                dicGameSceneMenuList ["MainSkillBar"].transform.FindChild("bar2_1").transform.localPosition = new Vector3(((0.3f * 580) - 290), -260, 0);
                dicGameSceneMenuList ["MainSkillBar"].transform.FindChild("bar3").transform.localPosition   = new Vector3(((0.3f * 580) - 290), -260, -0.1f);
                //Debug.Log ("GoodBar :: stateArray " + myCard.mGood);
                LegendSkillbar();
            }
            myCard.SetSkillPositions(myCard, false, false, false, Ag.mySelf, CostumeNum);
            SetSkillBarTextureSize();
        });
        //  ________________________________________________ Add A Member.. Add A Member..
        mStateArr.AddAMember("MidPausBiggerPotion", 1f);
        mStateArr.AddEntryAction(() => {
            mStartTime = Time.timeSinceLevelLoad;
            // Potion apply...
            //GameObject mDirUPclone;
            if (mDidBuyPotion || (Ag.mgIsKick && (mEventPotion || mEventminusPotion)) || Ag.mBlueItemFlag)
            {
                StartCoroutine(ItemeffOn("backeffect_blue"));
                if (mEventPotion || mEventminusPotion)
                {
                    SoundManager.Instance.Play_Effect_Sound("ApplyRedBull");
                }

                DestoryGuideBar();

                myCard.SetSkillPositions(myCard, true, false, false, Ag.mySelf, CostumeNum);
                if (Ag.mgIsKick)
                {
                    //myCard.WAS.GetSkillFinalValue (Ag.mySelf.arrUniform [0].Keep.Shirt.Texture, Ag.mySelf.arrUniform [0].Keep.Pants.Texture, Ag.mySelf.arrUniform [0].Keep.Socks.Texture, CostumeNum, out myCard.WAS.skill [0], out myCard.WAS.skill [1]);
                    dicGameSceneMenuList ["MainSkillBar"].transform.FindChild("bar1").GetComponent <UISprite> ().spriteName   = "skillbar0";
                    dicGameSceneMenuList ["MainSkillBar"].transform.FindChild("bar2_1").GetComponent <UISprite> ().spriteName = "skillbar1_1";
                }
                else
                {
                    //myCard.WAS.GetSkillFinalValue (Ag.mySelf.arrUniform [0].Keep.Shirt.Texture, Ag.mySelf.arrUniform [0].Keep.Pants.Texture, Ag.mySelf.arrUniform [0].Keep.Socks.Texture, CostumeNum, out myCard.WAS.skill [0], out myCard.WAS.skill [1]);

                    dicGameSceneMenuList ["MainSkillBar"].transform.FindChild("bar1").GetComponent <UISprite> ().spriteName   = "skillbar_keeper0";
                    dicGameSceneMenuList ["MainSkillBar"].transform.FindChild("bar2_1").GetComponent <UISprite> ().spriteName = "skillbar_keeper1_1";
                }

                dicGameSceneMenuList ["MainSkillBar"].transform.FindChild("bar2_1").transform.localPosition = new Vector3(((0.3f * 580) - 290), -260, 0);
                dicGameSceneMenuList ["MainSkillBar"].transform.FindChild("bar3").transform.localPosition   = new Vector3(((0.3f * 580) - 290), -260, -0.1f);

                LegendSkillbar();
                SetSkillBarTextureSize();

                //Debug.Log ("GoodBar :: stateArray " + myCard.mGood);

                if (Ag.mgIsKick && (mEventPotion || mEventminusPotion))
                {
                    myCard.SetSkillPositions(myCard, mDidBuyPotion, mEventPotion, mEventminusPotion, Ag.mySelf, CostumeNum);
                }
                if (!Ag.mBlueItemFlag)
                {
                    mDidBuyPotion = false;
                    Setitem("Anim_back_blue", mDidBuyPotion);
                    Setitem("Anim_eff02_blue", mDidBuyPotion);
                }
                //Debug.Log ("Good" + myCard.mGood + "Perfect" + myCard.mPerfect);
            }
            if (Ag.mgIsKick && mItemflag1 && Ag.mBallEventAlready && (mEventPotion || mEventminusPotion))
            {
                if (Ag.mgIsKick)
                {
                    StartCoroutine(mRandomItemoff(0.8f));
                    mEventPotion = mEventminusPotion = mItemflag1 = Ag.mBallEventAlready = false;
                }
            }
        });
        //  ________________________________________________ Add A Member.. Add A Member..
        mStateArr.AddAMember("GameSkl", 2f);
        mStateArr.AddEntryAction(() => {
            Ag.NodeObj.CurMyCard = myCard;
            //Ag.NodeObj.GameVoid ();
            mSkillSound = false;
            if (Ag.mgIsKick)
            {
                KickerScenePlay(false);
                mstatusBar = false;
            }
            SoundManager.Instance.Play_Effect_Sound("BarMoving_01");
            mStage.InitCursorMove(mEventSkillSpeed, 300f);
            mTempUseInStates = false;
        });
        mStateArr.AddDuringAction(() => {
            if (mStage.mIsTouched && !mTempUseInStates)
            {
                StartCoroutine(Skleff(2f, Ag.mgSkill));   //SetStatusBar();
                mTempUseInStates = true;
            }
        });
        //  ________________________________________________ Add A Member.. Add A Member..
        mStateArr.AddAMember("AftPaus", 0.7f);
        mStateArr.AddEntryAction(() => {
//
//            tempDir++;
//            if (tempDir == 6)
//                tempDir = Ag.NodeObj.Direction = Ag.mgDirection = 1;
//            else
//                Ag.NodeObj.Direction = Ag.mgDirection = (byte)tempDir;
////
//            if (Ag.mgIsKick) {
//                Ag.NodeObj.Skill = Ag.mgSkill = 3;
//                Ag.NodeObj.Direction = Ag.mgDirection = 5;
//            } else {
//                Ag.mgEnemDirec = 5;
//                Ag.mgEnemSkill = 2;
//                Ag.NodeObj.Direction = Ag.mgDirection = 3;
//                Ag.NodeObj.Skill = Ag.mgSkill = 2;
//            }


//
//            Ag.LogString ("  My  Send / Rcvd " + Ag.NodeObj.MySocket.arrGameSend.Count + " / " + Ag.NodeObj.MySocket.arrGameRcvd.Count );
//


            mRetryCount = 0;
            mskillflag  = mStatusSillBar = true;
            //Panelka Exception.....
            if (Ag.mgIsKick && Ag.mgDirection == 5 && Ag.mgSkill > 1)
            {
                Ag.mgSkill = 1;
            }
            Ag.mgGamePackReceived = true;  //[2013:07-23:LJK]
            mNetworkWaitAni();

            TurnNum++;
        });
        mStateArr.AddExitCondition(() => {
            return(Ag.mgGamePackReceived);
        });
        mStateArr.AddTimeOutProcess(25.0f, () => {
            Ag.LogNewLine(20);
            Ag.LogString("Application.LoadLevel");
            mStateArr.SetStateWithNameOf("HeartBeat");  // [2012:11:12:MOON] Heart Beat   //  mAwayMyself = true;
        });
        //  ________________________________________________ Add A Member.. Add A Member..

        mStateArr.AddAMember("NetWait", 1f);
        mStateArr.AddEntryAction(() => {
            Ag.LogString("  mRetryCount : " + mRetryCount);
            if (Ag.mgIsKick)
            {
                Ag.mVirServer.Result(myCard);
            }
            else
            {
                Ag.mVirServer.Result(EnemCard);
            }


//            Ag.LogString ("  My  Dir / Skl " + Ag.mgDirection + " / " + Ag.mgSkill + "    Enemy D / S " + Ag.mgEnemDirec + " / " + Ag.mgEnemSkill);

            WasUserInfo uObj = new WasUserInfo()
            {
                User = Ag.mySelf, flag = 0
            };

            Ag.NodeObj.GameTurnBot(TurnNum, EnemCard);


            //SoundManager.Instance.audio.volume = 1f;
            SoundManager.Instance.Play_Effect_Sound("whistle_1");
            //SoundManager.Instance.audio.volume = 1f;
        });
        // Ljk Statemachine Add
        mStateArr.AddAMember("PackWait", 1f);
        mStateArr.AddEntryAction(() => {
            EnemyCharacterEffect();
        });
        //  ________________________________________________ Add A Member.. Add A Member..
        mStateArr.AddAMember("AnimaPlay", 0f);
        mStateArr.AddEntryAction(() => {
            StateAnimaplaySkillAni();
            dicGameSceneMenuList ["Panel_item"].SetActive(false);
            dicGameSceneMenuList ["GoalNet_2"].SetActive(true);
            //KickerDirbaroff();
            //mPanelItem.SetActive (false);
            //CheckTurnNumber ();

            Ag.NodeObj.GameScoreAddNewTurn(new int[] { Ag.NodeObj.MyUser.arrUniform [0].Kick.Shirt.Texture, Ag.NodeObj.MyUser.arrUniform [0].Kick.Pants.Texture,
                                                       Ag.NodeObj.MyUser.arrUniform [0].Kick.Socks.Texture, CostumeNum,
                                                       Ag.NodeObj.EnemyUser.arrUniform [0].Kick.Shirt.Texture, Ag.NodeObj.EnemyUser.arrUniform [0].Kick.Pants.Texture,
                                                       Ag.NodeObj.EnemyUser.arrUniform [0].Kick.Socks.Texture, 1 }); // Mine : Unif/Cstm, Enemy : Unif/Cstm

            //Ag.NodeObj.GameScoreAddNewTurn ();

            int enemD, enemS;
            Ag.NodeObj.GetEnemyDirectSkill(out enemD, out enemS);

            Ag.mgEnemDirec = (byte)enemD;
            Ag.mgEnemSkill = (byte)enemS;



            dicGameSceneMenuList ["MainBar"].SetActive(false);
            dicGameSceneMenuList ["MainSkillBar"].SetActive(false);
            dicGameSceneMenuList ["SGrade_MainSkillBar"].SetActive(false);
            dicGameSceneMenuList ["Panel_keeperarrow_Main2"].SetActive(false);
            dicGameSceneMenuList ["Panel_keeperarrow_set"].SetActive(false);
            dicGameSceneMenuList ["Keeperinfo"].SetActive(false);
            dicGameSceneMenuList ["Kickerinfo"].SetActive(false);



            //Debug.Log ("arrIskick" + Ag.NodeObj.myGameLogic.arrScore.GetLastMember ().isKick + "arrDidwin" + Ag.NodeObj.myGameLogic.arrScore.GetLastMember ().didWin + "Iskick" + Ag.mgIsKick);
            if (Ag.NodeObj.myGameLogic.arrScore.GetLastMember().didWin)
            {
                Ag.mgDidWin = true;
            }
            else
            {
                Ag.mgDidWin = false;
            }
            DestoryGuideBar();
            DragPositionF(false);
            SetKickerDir(false);
            KickerScenePlay(true);
            SoundManager.Instance.Play_Effect_Sound("01_Crowd_ready_loop");

            //SkillSoundAfter ();
            AnimaPlay();
            Add_ScoutValue();
            dicGameSceneMenuList ["Kickerinfo_scouter_bundle"].SetActive(false);
            dicGameSceneMenuList ["Kickerinfo_scouter_discript"].SetActive(false);
            dicGameSceneMenuList ["Kickerinfo_progress_scouter"].transform.FindChild("Label_cash").gameObject.SetActive(true);
            StartCoroutine(AnimaStopCoru());
        });
        mStateArr.AddDuringAction(() => {
            mKeeperPosi.x = mBippos.transform.position.x;
            mKeeperPosi.z = mBippos2.transform.position.z;
        });
        mStateArr.AddExitCondition(() => {
            return(mAnimationStopflag);
        });

        //  ________________________________________________ Add A Member.. Add A Member..
        mStateArr.AddAMember("Ceremony", 2.4f, "Packet");
        mStateArr.AddEntryAction(() => {
            KickerDirbaroff();
            DragPositionLastSetDir(false);
            //--------- Kicker Keepr Selected Ani
            Ag.NodeObj.myGameLogic.GetTotalScore(Ag.mySelf.GetApplyIDofItem("CeremonyDefault"));   // 내 점수
            Ag.NodeObj.enGameLogic.GetTotalScore(Ag.myEnem.GetApplyIDofItem("CeremonyDefault"));   // 상대 점수

            //Ag.NodeObj.GetTotalScore (out mMycurScore, out mEnemyCurScore);
            dicGameSceneMenuList ["MyScore"].GetComponent <UILabel> ().text   = ((int)Ag.NodeObj.myGameLogic.CurAccumTotal).ToString(); //((int)mMycurScore).ToString ();
            dicGameSceneMenuList ["EnemScore"].GetComponent <UILabel> ().text = ((int)Ag.NodeObj.enGameLogic.CurAccumTotal).ToString(); //((int)mEnemyCurScore).ToString ();
            //  ________________________________________________ LJK 2013 08 20 Delete Soon;
            //addKickSpotLight ("Bumped Diffuse");

            UICamEff(false);
            mStatusSillBar = mskillflag = false;
            mEffballflag   = false;
            mgoldenBalleff();

            if (Ag.mgIsKick && mGoldenBallEff /* &&  (mGoldenBall || mBronzeBall || mSilverBall) */)
            {
                if (Ag.mgDidWin)
                {
                    GoldenBallEvent();
                    SoundManager.Instance.Play_Effect_Sound("fixgoldenball");
                }
                else
                {
                    mGoldenAfter = mSilverAfter = mBronzeAfter = mGoldenBallEff = false;
                }
            }

            for (int i = 0; i < 4; i++)
            {
                arrKickerDirBar [i].SetActive(false);  // active = false;
            }
            //moon Ac.ReadUserInfo ();
            mKpTrailL.GetComponent <TrailRenderer> ().enabled = false;
            mKpTrailR.GetComponent <TrailRenderer> ().enabled = false;
            mKickBall.GetComponent <TrailRenderer> ().enabled = false;


            mPreMyWin = (int)Ag.mgSelfWinNo;
            mPreEnWin = (int)Ag.mgEnemWinNo;
            if (Ag.mgDirection == 0)
            {
                mMissNum--;
            }
            if (Ag.mgSkill == 2)
            {
                mPerfectNum++;
            }
            if (Ag.mgSkill == 0)
            {
                mMissNum--;
            }
            if (Ag.mgIsKick)
            {
                if (Ag.mgDidWin)
                {
                    arrMyScore.Add(true);
                    arrAllMyScore.Add(true);
                }
                else
                {
                    arrMyScore.Add(false);
                    arrAllMyScore.Add(false);
                }
            }
            else
            {
                if (Ag.mgDidWin)
                {
                    arrEnScore.Add(false);
                    arrAllEnScore.Add(false);
                }
                else
                {
                    arrAllEnScore.Add(true);
                    arrEnScore.Add(true);
                }
            }
            if (arrEnScore.Count > 5 || arrMyScore.Count > 5)    // Above 5 case... Remove all...
            {
                for (int jk = 0; jk < 5; jk++)
                {
                    arrMyScore.RemoveAt(0);
                    arrEnScore.RemoveAt(0);
                    mMyPointBall [jk].SetActive(false);
                    mEnemyPointBall [jk].SetActive(false);
                }
            }
            dicGameSceneMenuList ["EnemyPointLabel"].GetComponent <UILabel> ().text = FunResultNum(arrAllEnScore).ToString();
            dicGameSceneMenuList ["MyPointLabel"].GetComponent <UILabel> ().text    = FunResultNum(arrAllMyScore).ToString();
            if (Ag.mgIsKick)
            {
                mMyPointBall [arrMyScore.Count - 1].SetActive(true);
                if (Ag.mgDidWin)
                {
                    mMyPointBall [arrMyScore.Count - 1].GetComponent <UISprite> ().spriteName = arrMyScore [arrMyScore.Count - 1] ? "img_success" : "img_fail";
                }
                else
                {
                    mMyPointBall [arrMyScore.Count - 1].GetComponent <UISprite> ().spriteName = arrMyScore [arrMyScore.Count - 1] ? "img_success" : "img_fail";
                }
            }
            else
            {
                mEnemyPointBall [arrEnScore.Count - 1].SetActive(true);
                if (Ag.mgDidWin)
                {
                    mEnemyPointBall [arrEnScore.Count - 1].GetComponent <UISprite> ().spriteName = arrEnScore [arrEnScore.Count - 1] ? "img_success" : "img_fail";
                }
                else
                {
                    mEnemyPointBall [arrEnScore.Count - 1].GetComponent <UISprite> ().spriteName = arrEnScore [arrEnScore.Count - 1] ? "img_success" : "img_fail";
                }
            }
            if (Ag.NodeObj.GameFinish.HasValue)
            {
                if (Ag.NodeObj.GameFinish.Value)
                {
                    mStateArr.SetStateWithNameOf("EndingCeremony");
                }
                else
                {
                    mStateArr.SetStateWithNameOf("EndingCeremony");
                }
                //Ag.mgDidGameFinish = false;
            }
            SoundManager.Instance.Play_Effect_Sound("03_Crowd_goal");
            mPlayerKeeper.transform.position = new Vector3(mKeeperPosi.x, 0, mKeeperPosi.z);
            CerAni();
        });
        mStateArr.AddExitAction(() => {
//            if (Ag.mSingleMode)
//                Ag.SwitchStep ();
//            else
            Ag.mgIsKick = !Ag.mgIsKick; //ljk 11 11;
            mStateArr.SetStateWithNameOf("CountDn");
        });
        //  ________________________________________________ Add A Member.. Add A Member..
        mStateArr.AddAMember("EndingCeremony", 7f);
        mStateArr.AddEntryAction(() => {
            GameResultLabelEff();
            GameFinish();
            MessageInfo();
            DefnCam.GetComponent <Camera> ().enabled = true;
            mPlayerKeeper.transform.position         = new Vector3(mKeeperPosi.x, 0, mKeeperPosi.z);
            EndingCer();
            SoundManager.Instance.Play_Effect_Sound("04_Crowd_Game finish");
        });
        mStateArr.AddExitCondition(() => {
            return(mSkillCeremony);
        });
        //  ________________________________________________ Add A Member.. Add A Member..
        mStateArr.AddAMember("ShowEndingResult", 0);
        mStateArr.AddEntryAction(() => {
            GameTotalScore();
            if (Ag.ContGameNum >= 4)
            {
                FindMyChild(mResultPanel, "Panel_btn/btn_rematch", false);
                dicGameSceneMenuList ["btn_Label"].SetActive(true);
                mRscrcMan.FindChild(dicGameSceneMenuList ["btn_Label"], "Label", true).gameObject.GetComponent <UILabel> ().text = WWW.UnEscapeURL("%EC%9E%AC%EA%B2%BD%EA%B8%B0%EB%A5%BC%20%ED%95%98%EC%8B%A4%EC%88%98%20%EC%97%86%EC%8A%B5%EB%8B%88%EB%8B%A4.");
            }
            if (Ag.mySelf.myRank.WAS.winNum == 0 && Ag.mgDidWin)
            {
                Ag.mySelf.FirstGameDoneWithBot();
            }

            Ag.mySelf.DidWinOrLoseGame(Ag.mgDidWin);

            mGameOver = true;
            dicGameSceneMenuList ["Panel_top"].SetActive(false);
            dicGameSceneMenuList ["Panel_item"].SetActive(false);
            dicGameSceneMenuList ["MainBar"].SetActive(false);
            dicGameSceneMenuList ["MainSkillBar"].SetActive(false);
            dicGameSceneMenuList ["SGrade_MainSkillBar"].SetActive(false);
            EnemUserCheck = true;
            //           mMiniItem.SetActiveRecursively (false);
            mIngameObj.transform.position = new Vector3(0, 3, 0);
            mResultPanel.SetActive(true);
            //mNoticePop.SetActive (true);
            for (int i = 0; i < ListGameObject.Count; i++)
            {
                DestroyObject(ListGameObject [i]);
            }
            dicGameSceneMenuList ["Keeperinfo"].SetActive(false);
            dicGameSceneMenuList ["Kickerinfo"].SetActive(false);
            dicGameSceneMenuList ["Ui_cont"].SetActive(false);

            mCameraDefn.camera.enabled             = true;
            mCameraDefn.transform.localPosition    = new Vector3(0.6244949f, 37.91407f, -28.70337f);
            mCameraDefn.transform.localEulerAngles = new Vector3(21.27243f, 359.0441f, 359.5659f);
            mCameraDefn.fieldOfView   = 50;
            mCameraDefn.nearClipPlane = 9;
            RotStadium mStadium       = new RotStadium();
            mStadium = mRscrcMan.FindGameObject("Stadium2", true).GetComponent <RotStadium> ();
            mStadium.mStadiumRotflag = true;
            mCameraDefn.clearFlags   = CameraClearFlags.Nothing;

            int finalEarnScore;

            if (Ag.mgDidWin)
            {
                finalEarnScore = (int)FinalWinPoDeck;
            }
            else
            {
                finalEarnScore = (int)FinalLosPoDeck;
            }


            if (Ag.mgDidWin)
            {
                if (Ag.NodeObj.EnemyUser.WAS.League == "PRO_5")
                {
                    mEnemyCurScore = 0;
                }
                GameReport(Ag.NodeObj.MyUser, Ag.NodeObj.EnemyUser, (int)finalEarnScore, (int)mEnemyCurScore);
                SoundManager.Instance.Play_Effect_Sound("Short metal clip - Win");
                mWinBonus = 7;
                if (Ag.mSingleMode)
                {
                    mWinpoint = 0;
                }
                else
                {
                    mWinpoint  = 10;
                    mAllPoint += 10;
                }
            }
            else
            {
                if (Ag.NodeObj.MyUser.WAS.League == "PRO_5")
                {
                    finalEarnScore = 0;
                }
                GameReport(Ag.NodeObj.EnemyUser, Ag.NodeObj.MyUser, (int)mEnemyCurScore, (int)finalEarnScore);
                SoundManager.Instance.Play_Effect_Sound("Short metal clip - Lose");
                if (Ag.mSingleMode)
                {
                    mWinpoint = 0;
                }
                else
                {
                    mWinpoint  = -10;
                    mAllPoint -= 10;
                }
                mWinBonus = 2;
            }

            if (!Ag.mSingleMode)
            {
                mAllPoint += mMissNum;
            }
            else
            {
                mMissNum = 0;
            }
            mBonusCoin += mWinBonus;
            mBonusCoin += mItemBonus;

            StartCoroutine(CResultShow(1f));
            //mKResult.transform.FindChild ("MYnick").GetComponent<TextMesh> ().text = Ag.mySelf.mNick.ToString ().ToUpper ();
            //mCameraDefn.enabled = false;
            mCameraKick.enabled = false;
            mCerCamAxis.SetActiveRecursively(false);
            CerCam.enabled = false;

            //LastResult ();
            DestroyObject(mPlayerKicker);
            DestroyObject(mPlayerKeeper);

            DragPositionF(false);
            DragPosition(false);
            if (Ag.mSingleMode)
            {
            }
            else
            {
            }
            FirstGameWin();
            if (Ag.NodeObj.EnemyUser.WAS.KkoID == "BOT")
            {
                mRscrcMan.FindChild(mResultPanel, "Panel_btn/btn_rematch", false);
                dicGameSceneMenuList ["btn_Label"].SetActive(true);
                mRscrcMan.FindChild(dicGameSceneMenuList ["btn_Label"], "Label", true).gameObject.GetComponent <UILabel> ().text = WWW.UnEscapeURL("%EC%83%81%EB%8C%80%EA%B0%80%20%EC%9D%B4%EB%AF%B8%20%ED%87%B4%EC%9E%A5%ED%95%A8");
            }
        });
        mStateArr.AddExitCondition(() => {
            return(false);
        });
        //  ________________________________________________ Add A Member.. Add A Member..
        mStateArr.AddAMember("GameFinish", 0);
        mStateArr.AddEntryAction(() => {
            if (!Ag.mSingleMode)
            {
                Application.LoadLevel("300PrepareGame");
            }
        });
        //  ________________________________________________ SetSerialExitMember
        mStateArr.SetSerialExitMember();
        mStateArr.SetStateWithNameOf("Begin");
        mStateArr.SetDebug(true, false);
        mStateArr.AddAMember("ReadUserInfo", 0f);
        //  ////////////////////////////////////////////////     //[2012:11:12:MOON] Heart Beat
//        if (!Ag.mSingleMode)
//            AddAdditionalActions ();
        //  ////////////////////////////////////////////////     //[2012:11:12:MOON] Heart Beat
    }
    public void GameLogic()
    {
        Ag.LogString("//  _////////////////////////////////////////////////_    _____  Test  _____    Score   _____");
        NodeGameTurnRslt my, en;


        int  kickDir = 0, kickSkl, defnDir, defnSkl;
        bool rsss = AgUtilGame.DidKickerWinThisTurn(kickDir++, 3, 1, 2);

        rsss = AgUtilGame.DidKickerWinThisTurn(kickDir++, 3, kickDir, 2);
        rsss = AgUtilGame.DidKickerWinThisTurn(kickDir++, 3, 1, 2);
        rsss = AgUtilGame.DidKickerWinThisTurn(kickDir++, 3, 1, 2);
        rsss = AgUtilGame.DidKickerWinThisTurn(kickDir++, 3, 1, 2);
        rsss = AgUtilGame.DidKickerWinThisTurn(kickDir++, 3, 1, 2);


        Ag.LogIntenseWord(" Test   :::   " + rsss);


        AmGameLogic myLogic = new AmGameLogic("League_3", "League_3");  // 5 - 3 => 2... 3 - 5 => 0 ....  !!!!
        AmGameLogic enLogic = new AmGameLogic("League_3", "League_3");

        Ag.LogStartWithStr(10, " Round 1");
        my = new NodeGameTurnRslt()
        {
            roll = "KICK", direction = 4, skill = 1, grade = "A", level = 2, enchant = 0
        };
        en = new NodeGameTurnRslt()
        {
            roll = "KEEP", direction = 0, skill = 0, grade = "C", level = 2, enchant = 0
        };
        myLogic.AddNewTurn(my, en, 0, new int[] { 1, 1, 1, 1, 0, 0, 0, 0 });  // My Kick, Goal..  Win
        enLogic.AddNewTurn(en, my, 0, new int[] { 0, 0, 0, 0, 1, 1, 1, 1 });
        myLogic.ShowMySelf();
        enLogic.ShowMySelf();

        myLogic.GetTotalScore().ToString().HtLog();
        enLogic.GetTotalScore().ToString().HtLog();

        my = new NodeGameTurnRslt()
        {
            roll = "KEEP", direction = 0, skill = 0, grade = "C", level = 2, enchant = 0
        };
        en = new NodeGameTurnRslt()
        {
            roll = "KICK", direction = 4, skill = 1, grade = "A", level = 2, enchant = 0
        };
        myLogic.AddNewTurn(my, en, 0, new int[] { 0, 0, 0, 0, 1, 1, 1, 1 });  // My Kick, Goal..  Win
        enLogic.AddNewTurn(en, my, 0, new int[] { 1, 1, 1, 1, 0, 0, 0, 0 });
        myLogic.ShowMySelf();
        enLogic.ShowMySelf();
        Ag.LogDouble(" TotalScore : " + myLogic.GetTotalScore() + " Cere : " + myLogic.CeremonyBonus + "  Round : " + myLogic.TotalRound + "   TurnBonus : " + myLogic.UiTurnBonus);

        myLogic.GetTotalScore().ToString().HtLog();
        enLogic.GetTotalScore().ToString().HtLog();



        Ag.LogNewLine(10);

        // N:N => 0:0
        Ag.LogStartWithStr(10, " Round 2");
        my = new NodeGameTurnRslt()
        {
            roll = "KICK", direction = 4, skill = 1, grade = "B", level = 7, enchant = 0
        };
        en = new NodeGameTurnRslt()
        {
            roll = "KEEP", direction = 1, skill = 1, grade = "B", level = 10, enchant = 0
        };
        myLogic.AddNewTurn(my, en, 3, new int[] { 1, 3, 1, 3, 1, 1, 1, 0 });  // My Kick, Goal..  Win
        enLogic.AddNewTurn(en, my, 3, new int[] { 1, 1, 1, 0, 1, 1, 1, 0 });
        my = new NodeGameTurnRslt()
        {
            roll = "KEEP", direction = 2, skill = 1, grade = "D", level = 0, enchant = 0
        };
        en = new NodeGameTurnRslt()
        {
            roll = "KICK", direction = 2, skill = 1, grade = "C", level = 1, enchant = 0
        };
        myLogic.AddNewTurn(my, en, 0, new int[] { 1, 1, 1, 0, 1, 1, 1, 0 });  // My Kick, Goal..  Win
        enLogic.AddNewTurn(en, my, 0, new int[] { 1, 1, 1, 0, 1, 1, 1, 0 });
        myLogic.ShowMySelf();
        enLogic.ShowMySelf();
        Ag.LogDouble(" TotalScore : " + myLogic.GetTotalScore() + " Cere : " + myLogic.CeremonyBonus + "  Round : " + myLogic.TotalRound + "   TurnBonus : " + myLogic.UiTurnBonus);

        // G:G => 1:1
        Ag.LogStartWithStr(10, " Round 3");
        my = new NodeGameTurnRslt()
        {
            roll = "KICK", direction = 4, skill = 1, grade = "B", level = 7, enchant = 0
        };
        en = new NodeGameTurnRslt()
        {
            roll = "KEEP", direction = 1, skill = 1, grade = "B", level = 10, enchant = 0
        };
        myLogic.AddNewTurn(my, en, 2, new int[] { 1, 3, 1, 3, 1, 1, 1, 0 });  // My Kick, Goal..  Win
        enLogic.AddNewTurn(en, my, 2, new int[] { 1, 1, 1, 0, 1, 1, 1, 0 });
        my = new NodeGameTurnRslt()
        {
            roll = "KEEP", direction = 0, skill = 2, grade = "D", level = 0, enchant = 0
        };
        en = new NodeGameTurnRslt()
        {
            roll = "KICK", direction = 1, skill = 1, grade = "C", level = 1, enchant = 0
        };
        myLogic.AddNewTurn(my, en, 0, new int[] { 1, 1, 1, 0, 1, 1, 1, 0 });  // My Kick, Goal..  Win
        enLogic.AddNewTurn(en, my, 0, new int[] { 1, 1, 1, 0, 1, 1, 1, 0 });
        myLogic.ShowMySelf();
        enLogic.ShowMySelf();
        Ag.LogDouble(" TotalScore : " + myLogic.GetTotalScore() + " Cere : " + myLogic.CeremonyBonus + "  Round : " + myLogic.TotalRound + "   TurnBonus : " + myLogic.UiTurnBonus);
        bool?finalWin = myLogic.DidIFinalWin(enLogic);

        if (finalWin.HasValue)
        {
            Ag.LogDouble("   >>>>>>>>>>         Game is Over     Did I Win ? >>  " + finalWin.Value);
        }

        // G:G => 1:1
        Ag.LogStartWithStr(10, " Round 4");
        my = new NodeGameTurnRslt()
        {
            roll = "KICK", direction = 4, skill = 1, grade = "B", level = 7, enchant = 0
        };
        en = new NodeGameTurnRslt()
        {
            roll = "KEEP", direction = 1, skill = 1, grade = "B", level = 10, enchant = 0
        };
        myLogic.AddNewTurn(my, en, 2, new int[] { 1, 3, 1, 3, 1, 1, 1, 0 });  // My Kick, Goal..  Win
        enLogic.AddNewTurn(en, my, 2, new int[] { 1, 1, 1, 0, 1, 1, 1, 0 });
        myLogic.ShowMySelf();
        enLogic.ShowMySelf();
        Ag.LogDouble(" TotalScore : " + myLogic.GetTotalScore() + " Cere : " + myLogic.CeremonyBonus + "  Round : " + myLogic.TotalRound + "   TurnBonus : " + myLogic.UiTurnBonus);

        finalWin = myLogic.DidIFinalWin(enLogic);
        if (finalWin.HasValue)
        {
            Ag.LogDouble("   >>>>>>>>>>         Game is Over     Did I Win ? >>  " + finalWin.Value);
        }



        my = new NodeGameTurnRslt()
        {
            roll = "KEEP", direction = 1, skill = 2, grade = "D", level = 0, enchant = 0
        };
        en = new NodeGameTurnRslt()
        {
            roll = "KICK", direction = 0, skill = 1, grade = "C", level = 1, enchant = 0
        };
        myLogic.AddNewTurn(my, en, 0, new int[] { 1, 1, 1, 0, 1, 1, 1, 0 });  // My Kick, Goal..  Win
        enLogic.AddNewTurn(en, my, 0, new int[] { 1, 1, 1, 0, 1, 1, 1, 0 });
        myLogic.ShowMySelf();
        enLogic.ShowMySelf();
        Ag.LogDouble(" TotalScore : Me >> " + myLogic.GetTotalScore() + " Cere : " + myLogic.CeremonyBonus + "  Round : " + myLogic.TotalRound + "   TurnBonus : " + myLogic.UiTurnBonus);
        Ag.LogDouble(" TotalScore : En >> " + enLogic.GetTotalScore() + " Cere : " + enLogic.CeremonyBonus + "  Round : " + enLogic.TotalRound + "   TurnBonus : " + enLogic.UiTurnBonus);


//        bool? finalWin = myLogic.DidIFinalWin (enLogic);
//        if (finalWin.HasValue)
//            Ag.LogIntenseWord ("   >>>>>>>>>>         Game is Over     Did I Win ? >>  " + finalWin.Value);
//
//        (myLogic.GetTotalScore ().LogWith (" My Total Score ") + enLogic.GetTotalScore ().LogWith (" Enemy Score")).HtLog ();
//        (myLogic.SemiTotal.LogWith ("myLogic.SemiTotal") + "  UI Turn Bonus  " + myLogic.UiTurnBonus).HtLog ();
//        Ag.LogNewLine (2);
    }
Beispiel #12
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();
        }
    }
Beispiel #13
0
 public virtual void SeldomAction()
 {
     Ag.LogNewLine(2);
     Ag.LogString("AgDontDestroy :: SeldomAction  ]]] " + GetType() + " [[[  >>>>> " + mCounter + " <<<<<");
 }