Пример #1
0
//    public IEnumerator Awake ()
//    {
//        return 0;
//        //base.Awake ();
//        //DontDestroyOnLoad (this.gameObject);
//    }
    // Use this for initialization



    public override void Start()
    {
        //Ag.GameStt.TitleSceneBegan ();

        base.Start();
        //CheckWasServerVision ();
        //Debug.Log ("Getbool" + PreviewLabs.PlayerPrefs.GetBool ("BgmSoundOff"));
        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        #if UNITY_IPHONE
        NotificationServices.RegisterForRemoteNotificationTypes(RemoteNotificationType.Alert | RemoteNotificationType.Badge | RemoteNotificationType.Sound);
        Ag.LogIntenseWord("NotificationServices.  Register For Remote NotificationTypes  ");
        #endif

        ("  Title :: Start    ").HtLog();
        //Ag.mFBOrder = "ConNet";
        GameInit();
        StartCoroutine(WaitAndPrint());
        JCE.JceUrgentNoticePT(Ag.mySelf);
        JCE.JceTextNoticePT(Ag.mySelf);


        if (AgUtil.IsLGeVuModel())
        {
            Screen.SetResolution((Screen.height / 2) * 3, Screen.height, true);
        }
    }
Пример #2
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;
        }
    }
Пример #3
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;
    }
Пример #4
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;
    }
Пример #5
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;
    }
Пример #6
0
    void PriceItem()
    {
        pushSetting();
        #if UNITY_IPHONE
        //JCE.JceNotiTokenSetting (Ag.mySelf);
        #endif

        WasItemPrice aObj = new WasItemPrice()
        {
            User = Ag.mySelf, DiscountOnly = false
        };
        aObj.messageAction = (int pInt) => {
            switch (pInt)
            {
            case 0:
                //JCE.JceLogin(Ag.mySelf);
                JCE.JceImageNotice(Ag.mySelf);
                //JCE.JceEventBanner(Ag.mySelf);
                FetchEventList();
                break;
            }
        };
    }
Пример #7
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;
    }
Пример #8
0
    public void SetColumnC()
    {
        int colN = 0, colEA;

        muiCol++;
        muiRow = 0;

        //  _////////////////////////////////////////////////_    _///////////////////////_    _____  ***  _____  column 3  _____
        Rect rect004 = myGUI.GetRect(muiCol, muiRow++);

        int h, m, s;  // 타이머 테스트

        timerObj.TimeLeft(out h, out m, out s);
        GUI.Label(myGUI.DivideRect(rect004, 3, 0), h + ":" + m + ":" + s + "  " + timerObj.DidTimerFinished() + " , " + timerObj.SecondsLeft());

        //  _////////////////////////////////////////////////_    _///////////////////////_    _____  Go to   _____    Node Screen   _____
        if (GUI.Button(myGUI.DivideRect(rect004, 3, 2), "Node >"))
        {
            IsNodeScreen = true;
        }

        colN = 0;
        Rect rectPlugin = myGUI.GetRect(muiCol, muiRow++);
//        if (GUI.Button (myGUI.DivideRect (rectPlugin, 3, colN++), "JailBrk")) {
//            pluginObj.CheckRootingJailbreak ();
//        }
//        if (GUI.Button (myGUI.DivideRect (rectPlugin, 3, 1), "Percent")) {
//            AgUtil.LinearPercentVari (100, 10000, 3800);
//
//        }

        string msggg = "";

        #if UNITY_IPHONE
        if (NotificationServices.deviceToken == null)
        {
            msggg = "null";
        }
        else
        {
            msggg = " Token ";
        }
        #endif
        if (GUI.Button(myGUI.DivideRect(rectPlugin, 3, colN++), msggg))
        {
            JCE.JceNotiTokenSetting(myUser);
        }
        if (GUI.Button(myGUI.DivideRect(rectPlugin, 3, colN++), "Noti " + Ag.arrNoti.Count))
        {
//            arrNoti = NotificationServices.remoteNotifications;
//            for (int k = 0; k < arrNoti.Length; k++) {
//                RemoteNotification curNoti = arrNoti [k];
//                Ag.LogString ("  Notification ::  alertBody > " + curNoti.alertBody + "     userInfo.Count > " + curNoti.userInfo.Count +
//                "   badgeNum > " + curNoti.applicationIconBadgeNumber);
//
//                Ag.arrNoti.Add (new AmNotification () { msg = curNoti.alertBody });
//            }
        }
        if (GUI.Button(myGUI.DivideRect(rectPlugin, 3, colN++), "SendNoti"))
        {
            JCE.JceNotiSendMessage(myUser, " 안드로이드 iOS .. .. ");
        }



        //  _////////////////////////////////////////////////_    _///////////////////////_    _____  SingleTry  _____  Test  _____
        Rect rect005 = myGUI.GetRect(muiCol, muiRow++);
        colN  = 0;
        colEA = 5;
        if (GUI.Button(myGUI.DivideRect(rect005, colEA, colN++), "Try A"))
        {
            myUser.ShowSingleTry(false).ToString().HtLog();
        }
        if (GUI.Button(myGUI.DivideRect(rect005, colEA, colN++), "Confirm"))
        {
            myUser.ConfirmSingleTry(false);
        }
        if (GUI.Button(myGUI.DivideRect(rect005, colEA, colN++), "Try S"))
        {
            myUser.ShowSingleTry(true).ToString().HtLog();
        }
        if (GUI.Button(myGUI.DivideRect(rect005, colEA, colN++), "Confirm"))
        {
            myUser.ConfirmSingleTry(true);
        }
        if (GUI.Button(myGUI.DivideRect(rect005, colEA, colN++), "Init"))
        {
            myUser.InitSingleTry();
        }

        Rect rect006 = myGUI.GetRect(muiCol, muiRow++);
        colN  = 0;
        colEA = 5;
        int mm, ss;
        myUser.HeartCoolTime(out mm, out ss);
        mm = myUser.HeartCoolTime();  // %
        if (GUI.Button(myGUI.DivideRect(rect006, colEA, colN++), "H  " + mm + " %, S " + ss))
        {
            myUser.HeartCoolTimeNewGameStarted();
            //myUser.HeartSetMax (); // Set Maximum
        }
        if (GUI.Button(myGUI.DivideRect(rect006, colEA, colN++), " SetMax"))
        {
            myUser.HeartSetMax();
        }
        if (GUI.Button(myGUI.DivideRect(rect006, colEA, colN++), " CurTime"))
        {
            ("   Remain Sec ::   " + myUser.CurrentRemainSec()).HtLog();
        }
        // Scout
//        myUser.ScoutCoolTimeRemain (out mm, out ss);
//        if (GUI.Button (myGUI.DivideRect (rect006, colEA, colN++), "S  " + mm + ":" + ss)) {
//            myUser.CoolTimeScoutUse ();
//        }

        myUser.ContWinCoolTimeRemain(out mm, out ss);
        if (GUI.Button(myGUI.DivideRect(rect006, colEA, colN++), "CW  " + mm + ":" + ss))
        {
            myUser.CoolTimeChooseOneMoreGameWin();
            myUser.ContWinCoolTimeRemainPercent().ToString().HtLog();     // + or - ...
        }


        Rect rect007 = myGUI.GetRect(muiCol, muiRow++);
        colN  = 0;
        colEA = 4;
        if (GUI.Button(myGUI.DivideRect(rect007, colEA, colN++), "PopupIAPL"))
        {
            WasPopupStoreIAPurchaseList aObj = new WasPopupStoreIAPurchaseList()
            {
                User = myUser
            };
            aObj.messageAction = (int pInt) => {
                aObj = null;
            };
        }
        if (GUI.Button(myGUI.DivideRect(rect007, colEA, colN++), "PopupL"))
        {
            WasPopupStoreList aObj = new WasPopupStoreList()
            {
                User = myUser
            };
            aObj.messageAction = (int pInt) => {
                aObj = null;
            };
        }
        if (GUI.Button(myGUI.DivideRect(rect007, colEA, colN++), "Popup"))
        {
            WasPopupPurchase aObj = new WasPopupPurchase()
            {
                User = myUser, PopupCode = "DiscHeartDay"
            };
            aObj.messageAction = (int pInt) => {
                aObj = null;
            };
            aObj = new WasPopupPurchase()
            {
                User = myUser, PopupCode = "DiscHeartWeek"
            };
            aObj.messageAction = (int pInt) => {
                aObj = null;
            };
            aObj = new WasPopupPurchase()
            {
                User = myUser, PopupCode = "DiscHeartMonth"
            };
            aObj.messageAction = (int pInt) => {
                aObj = null;
            };
        }
        if (GUI.Button(myGUI.DivideRect(rect007, colEA, colN++), "PopPurchase"))
        {
            WasPopupPurchase aObj = new WasPopupPurchase()
            {
                User = myUser, PopupCode = "DiscGlove"
            };
            aObj.messageAction = (int pInt) => {
                aObj = null;
            };
        }

        Rect rctNoti = myGUI.GetRect(muiCol, muiRow++);
        colN = 0;
        if (GUI.Button(myGUI.DivideRect(rctNoti, 3, colN++), "Logout"))
        {
            JCE.JceNotiMessage(myUser, "logout");  // logout, alarmOn, alarmOff
        }
        if (GUI.Button(myGUI.DivideRect(rctNoti, 3, colN++), "Alm : On"))
        {
            JCE.JceNotiMessage(myUser, "alarmOn");  // logout, alarmOn, alarmOff
        }
        if (GUI.Button(myGUI.DivideRect(rctNoti, 3, colN++), "Alm : Off"))
        {
            JCE.JceNotiMessage(myUser, "alarmOff");  // logout, alarmOn, alarmOff
        }



        Rect joy1 = myGUI.GetRect(muiCol, muiRow++);
        colN  = 0;
        colEA = 4;
        if (GUI.Button(myGUI.DivideRect(joy1, colEA, colN++), "JCE"))      //
        //JoyLogin jObj = new JoyLogin ();

        {
            JCE.JceUrgentNoticePT(myUser);
        }
        if (GUI.Button(myGUI.DivideRect(joy1, colEA, colN++), "Img"))      //
        {
            JCE.JceImageNotice(myUser);
        }
        if (GUI.Button(myGUI.DivideRect(joy1, colEA, colN++), "Text"))      //
        //JCE.JceEventBanner (myUser);
        {
            JCE.JceTextNoticePT(myUser);
        }
        if (GUI.Button(myGUI.DivideRect(joy1, colEA, colN++), "Event"))      //
        //JCE.JceEventBanner (myUser);
        {
            JCE.JceEventBanner(myUser);
        }
//        if (GUI.Button (myGUI.DivideRect (joy1, colEA, colN++), "Test")) {  //
//            int wid1, wid2;
//            WasCard was = myUser.arrCard [2].WAS;
//            myUser.arrCard [2].GetSkillWidth (false, out wid1, out wid2);
//            ("   Wid1, wid2  ::   " + was.condition + "  " + was.skill [0] + "  / " + was.skill [1] + "  >>> " + wid1 + " / " + wid2).HtLog ();
//            myUser.arrCard [2].GetSkillWidth (true, out wid1, out wid2);
//            ("  drink on   Wid1, wid2  ::   " + wid1 + "   " + wid2).HtLog ();
//
//        }


        //  _////////////////////////////////////////////////_    _____  Code Only  _____  Packet Send  _____
        Rect joy2 = myGUI.GetRect(muiCol, muiRow++);
        colN      = 0;
        colEA     = 3;
        packetNum = int.Parse(GUI.TextField(myGUI.DivideRect(joy2, colEA, colN++), packetNum.ToString(), 5));
        if (GUI.Button(myGUI.DivideRect(joy2, colEA, colN++), "Send"))      //
        {
            WasCodeOnlyProtocol aObj = new WasCodeOnlyProtocol()
            {
                User = Ag.mySelf, protoCode = packetNum
            };
            aObj.messageAction = (int pInt) => {
                aObj = null;
            };
        }
        if (GUI.Button(myGUI.DivideRect(joy2, colEA, colN++), "TEST"))      //
        {
            WasPurchaseItem aObj = new WasPurchaseItem()
            {
                User       = myUser,
                itemType   = "HEARTUPGRADE",
                itemTypeId = "HeartSpeedUp", //"HeartLimitUp",
                ea         = 1,
            };
            aObj.messageAction = (int pInt) => {
                aObj = null;
            };
//            WasHeartFillMax aObj = new WasHeartFillMax () { User = myUser };
//            aObj.messageAction = (int pInt) => {
//                aObj = null;
//            };
        }

        Rect corot = myGUI.GetRect(muiCol, muiRow++);
        colN  = 0;
        colEA = 4;
        if (GUI.Button(myGUI.DivideRect(corot, colEA, colN++), "Corout"))      //
        {
            StartCoroutine("SomeCrtine");
        }
        if (GUI.Button(myGUI.DivideRect(corot, colEA, colN++), "End"))      //
        {
            StopCoroutine("SomeCrtine");
        }

        #if UNITY_IPHONE
        //  _////////////////////////////////////////////////_    _____  Purchase  _____    IAP   _____
        string iapMsg = "N : " + AgStt.mIAP.arrProduct.Count + "  Psble : " + AgStt.mIAP.CanMakePayment();
        GUI.Label(myGUI.GetRect(muiCol, muiRow++), iapMsg);

        Rect iap1   = myGUI.GetRect(muiCol, muiRow++);
        int  colNum = 3;
        int  col    = 0;

        if (GUI.Button(myGUI.DivideRect(iap1, colNum, col++), "IAP:Init"))      //
        {
            AgStt.mIAP.ProductRequest();
        }

        if (GUI.Button(myGUI.DivideRect(iap1, colNum, col++), "cash0030"))      //
        {
            AgStt.mIAP.PurchaseProduct("com.appsgraphy.psykickbattlekakao.cash0030");
        }
        #endif
        //  _////////////////////////////////////////////////_    _____  Code  _____  Etc Test  _____
        Rect joy9 = myGUI.GetRect(muiCol, muiRow++);
        colN  = 0;
        colEA = 3;

        if (GUI.Button(myGUI.DivideRect(joy9, colEA, colN++), " SetNow "))
        {
            testDT = DateTime.Now;
            Ag.LogIntenseWord("    Now is " + testDT + "   Ag. Now () :: " + Ag.Now());
            Ag.LogIntenseWord("    Diff is " + (testDT - Ag.Now()).TotalSeconds);
        }

        if (GUI.Button(myGUI.DivideRect(joy9, colEA, colN++), " Time "))
        {
            Ag.LogIntenseWord("  Total Seconds  ... " + Ag.TotalSecondsHavePassedInSeoulSince(testDT));
        }
    }
Пример #9
0
    /// <summary>
    /// 카카오 로그인시
    /// </summary>
    public void OnLoginWas()
    {
        #if UNITY_EDITOR
        //if (!Ag.mGuest)
        GitIgnoreThis.SetKKOID4Test();
        Ag.LogIntenseWord("  UNITY_EDITOR_OSX    :: GitIgnoreThis.SetKKOID4Test ()   ");
        #endif

        JCE.JceImageNotice(Ag.mySelf);

        SetTimerLogin();

        Ag.LogIntenseWord("  OnLoginWas   KKO  ID ::::::  " + Ag.mySelf.WAS.KkoID);
        WasLogin aObj = new WasLogin()
        {
            User = Ag.mySelf, osVer = "1.1"
        };

        aObj.messageAction = (int pInt) => {
            switch (pInt)   //
            {
            case 0:
                Ag.LogIntenseWord(" result : Success ");
                mMainFlag = true;
                mPushLabelLoadName.SetActive(true);
                mPushLabelLoadName.GetComponent <UILabel> ().text = WWW.UnEscapeURL("%EA%B2%BD%EA%B8%B0%EC%9E%A5%EC%97%90%20%EC%9E%85%EC%9E%A5%EC%A4%91%EC%9E%85%EB%8B%88%EB%8B%A4.");

                if (Ag.mGuest)
                {
                    Ag.mySelf.WAS.KkoNick   = "No name";
                    Ag.mySelf.KkoNickEncode = "No name";
                }
                else
                {
                    Ag.mySelf.WAS.KkoNick     = StcPlatform.PltmNick;
                    Ag.mySelf.KkoNickEncode   = WWW.EscapeURL(StcPlatform.PltmNick);
                    Ag.mySelf.TeamNameEncoded = WWW.EscapeURL(Ag.mySelf.WAS.TeamName);
                }
                UserInfo();
                //mGuestButton.SetActive (false);

                break;

            case -2:
                mPopup.SetActive(true);
                dicMenuList ["notification_kakaologin"].SetActive(true);
                AgStt.FromGuest2Kakao = true;

                //RegistProcess();
                //kakaoLogin
                break;

            case 4:
                mPopup2.SetActive(true);
                KakaoNativeExtension.Instance.Unregister(onUnregisterComplete, onUnregisterError);
                dicMenuList["alert_withdrawman"].SetActive(true);
                break;

            case -1:
            case -5:
            case 5:
                Ag.LogIntenseWord(" Login : go to Regist ...  " + mMakeGudan.ToString());
                BgmSound.Instance.Play();
                LocalSettingSave();
                PreviewLabs.PlayerPrefs.SetBool("DidTutorial", false);
                PreviewLabs.PlayerPrefs.Flush();
                mMakeGudan.SetActive(true);   //
                mMakeGudan.transform.FindChild("club/Label_alert").GetComponent <UILabel> ().text = "";
                mPushLabel.SetActive(false);
                StopTimer();

                return;
            }
        };
    }