Esempio n. 1
0
 public void saveNoticeRecord(WemeNotice noti)
 {
     if (noti == null)
     {
         return;
     }
     if (noti.showType == "once")
     {
         PlayerPrefs.SetInt("NOTI" + noti.id, WSDefine.YES);
     }
 }
Esempio n. 2
0
 public UISystemPopup.PopupType getNoticePopupType(WemeNotice noti)
 {
     if ((noti.contents != null && noti.contents.Length > 10 && noti.contents.Substring(0, 5).ToLower().StartsWith("http")) ||
         noti.contents.Length > 128 || (string.IsNullOrEmpty(noti.detailLink) != null && noti.detailLink.Length > 10))
     {
         return(UISystemPopup.PopupType.Image);
     }
     else
     {
         return(UISystemPopup.PopupType.Default);
     }
 }
Esempio n. 3
0
    public WemeNotice checkNoticeRepeatType(WemeNotice noti)
    {
        if (noti == null)
        {
            return(null);
        }
        if (noti.showType == "once")
        {
            if (PlayerPrefs.GetInt("NOTI" + noti.id, WSDefine.NO) == WSDefine.YES)
            {
                return(null);
            }
        }

        return(noti);
    }
Esempio n. 4
0
    public void showWemeNotice()
    {
        bool isUsedPopupLoginAtClose = false;

        //-------check maintenance
        WemeMaintenance maintenance = PandoraManager.instance.getMaintenance();

        if (maintenance != null)
        {
            string txt = maintenance.reason;

            bool canUseMaintenance = true;

            if (string.IsNullOrEmpty(txt) == false && txt.StartsWith("AOS^"))
            {
                txt = txt.Substring(4);

#if UNITY_IOS
                canUseMaintenance = false;
#endif
            }
            else if (string.IsNullOrEmpty(txt) == false && txt.StartsWith("IOS^"))
            {
                txt = txt.Substring(4);

#if UNITY_ANDROID
                canUseMaintenance = false;
#endif
            }

            if (canUseMaintenance)
            {
                txt += "\n( " + Util.parseWemeSDKDate(maintenance.begin);
                txt += "~ " + Util.parseWemeSDKDate(maintenance.end) + " )";
                isUsedPopupLoginAtClose = true;

                UISystemPopup.open(UISystemPopup.PopupType.SystemError, txt, NetworkManager.RestartApplication, NetworkManager.RestartApplication);
            }
        }

        //---------checkClientState
        if (EpiServer.instance != null && EpiServer.instance.targetServer != EpiServer.SERVER.ALPHA)
        {
            Debug.LogError("PandoraManager.instance.clientState : " + PandoraManager.instance.clientState);
        }

        switch (PandoraManager.instance.clientState)
        {
        case "prepare":
            isUsedPopupLoginAtClose = true;
            break;

        case "test":
            break;

        case "service":
            break;

        case "upgraderecommend":

            if (isUsedPopupLoginAtClose == false)
            {
                UISystemPopup.openFirst(UISystemPopup.PopupType.YesNo, Util.getUIText("UPGRADENEED"), GoMarket, PandoraManager.instance.loginProcess);
            }
            else
            {
                UISystemPopup.openFirst(UISystemPopup.PopupType.YesNo, Util.getUIText("UPGRADENEED"), GoMarket, null);
            }

            isUsedPopupLoginAtClose = true;
            break;

        case "upgradeneed":

            UISystemPopup.openFirst(UISystemPopup.PopupType.SystemError, Util.getUIText("UPGRADERECOMMEND"), GoMarket, GoMarket);

            isUsedPopupLoginAtClose = true;
            break;

        case "finish":
            isUsedPopupLoginAtClose = true;
            break;
        }

        WemeNotice noti = PandoraManager.instance.getNextNotice();
        noti = checkNoticeRepeatType(noti);

        if (noti == null)
        {
            if (isUsedPopupLoginAtClose == false)
            {
                PandoraManager.instance.loginProcess();
            }
        }
        else
        {
            saveNoticeRecord(noti);

            if (string.IsNullOrEmpty(noti.detailLink))
            {
                if (isUsedPopupLoginAtClose == false)
                {
                    UISystemPopup.openFirst(getNoticePopupType(noti), noti.contents, PandoraManager.instance.loginProcess, PandoraManager.instance.loginProcess);
                }
                else
                {
                    UISystemPopup.openFirst(getNoticePopupType(noti), noti.contents);
                }
            }
            else
            {
                if (isUsedPopupLoginAtClose == false)
                {
                    UISystemPopup.openFirst(getNoticePopupType(noti), noti.contents, PandoraManager.instance.loginProcess, PandoraManager.instance.loginProcess, UISystemPopup.getUrlLinkString(noti.detailLink));
                }
                else
                {
                    UISystemPopup.openFirst(getNoticePopupType(noti), noti.contents, null, null, UISystemPopup.getUrlLinkString(noti.detailLink));
                }
            }
        }


        do
        {
            noti = PandoraManager.instance.getNextNotice();
            if (noti != null)
            {
                if (string.IsNullOrEmpty(noti.detailLink) == false)
                {
                    UISystemPopup.openFirst(getNoticePopupType(noti), noti.contents, null, null, UISystemPopup.getUrlLinkString(noti.detailLink));
                }
                else
                {
                    UISystemPopup.openFirst(getNoticePopupType(noti), noti.contents);
                }
            }
        }while(noti != null);
    }