public static void DestroyPanel(string panelName)
        {
            Logger.DEBUG("panelName=" + panelName);
            PandoraImpl pandoraImpl = Pandora.Instance.GetPandoraImpl();

            pandoraImpl.DestroyPanel(panelName);
        }
        public static void AsyncDownloadImage(string url)
        {
            Logger.DEBUG(url);
            PandoraImpl pandoraImpl = Pandora.Instance.GetPandoraImpl();

            pandoraImpl.ShowIMG(string.Empty, url, null, 0u);
        }
        public static void AsyncSetImage(string panelName, string url, Image image, uint callId)
        {
            Logger.DEBUG(string.Concat(new string[]
            {
                "panelName=",
                panelName,
                " url=",
                url,
                " callId=",
                callId.ToString()
            }));
            PandoraImpl pandoraImpl = Pandora.Instance.GetPandoraImpl();

            pandoraImpl.ShowIMG(panelName, url, image, callId);
        }
 public static void NotifyCloseAllPanel()
 {
     try
     {
         LuaScriptMgr luaScriptMgr = Pandora.Instance.GetLuaScriptMgr();
         PandoraImpl  pandoraImpl  = Pandora.Instance.GetPandoraImpl();
         if (luaScriptMgr != null && pandoraImpl.GetIsLuaMgrInited())
         {
             luaScriptMgr.CallLuaFunction("Common.NotifyCloseAllPanel", new object[0]);
         }
     }
     catch (Exception ex)
     {
         Logger.ERROR(ex.get_StackTrace());
     }
 }
Exemplo n.º 5
0
        private void Update()
        {
            while (Logger.logMsgQueue.get_Count() > 0)
            {
                Logger.LogUnit logUnit     = Logger.logMsgQueue.Dequeue() as Logger.LogUnit;
                PandoraImpl    pandoraImpl = Pandora.Instance.GetPandoraImpl();
                switch (logUnit.level)
                {
                case Logger.LogLevel.kDEBUG:
                    if (pandoraImpl.GetIsDebug())
                    {
                        Logger.WriteLog(logUnit.msg);
                    }
                    break;

                case Logger.LogLevel.kINFO:
                    if (pandoraImpl.GetIsDebug())
                    {
                        Logger.WriteLog(logUnit.msg);
                    }
                    break;

                case Logger.LogLevel.kWARN:
                    if (pandoraImpl.GetIsDebug())
                    {
                        Logger.WriteLog(logUnit.msg);
                    }
                    break;

                case Logger.LogLevel.kERROR:
                    if (pandoraImpl.GetIsDebug())
                    {
                        Logger.WriteLog(logUnit.msg);
                    }
                    break;

                case Logger.LogLevel.kREPORT:
                    if (pandoraImpl.GetIsNetLog())
                    {
                        NetLogic netLogic = Pandora.Instance.GetNetLogic();
                        netLogic.StreamReport(logUnit.msg);
                    }
                    break;
                }
            }
        }
 public static void NotifyPushData(string jsonData)
 {
     try
     {
         Logger.DEBUG("jsonData=" + jsonData);
         LuaScriptMgr luaScriptMgr = Pandora.Instance.GetLuaScriptMgr();
         PandoraImpl  pandoraImpl  = Pandora.Instance.GetPandoraImpl();
         if (luaScriptMgr != null && pandoraImpl.GetIsLuaMgrInited())
         {
             luaScriptMgr.CallLuaFunction("Common.NotifyPushData", new object[]
             {
                 jsonData
             });
         }
     }
     catch (Exception ex)
     {
         Logger.ERROR(ex.get_StackTrace());
     }
 }
        public static void CreatePanel(uint callId, string panelName)
        {
            Logger.DEBUG("callId=" + callId.ToString() + " panelName=" + panelName);
            PandoraImpl   pandoraImpl   = Pandora.Instance.GetPandoraImpl();
            Action <bool> onCreatePanel = delegate(bool status)
            {
                Dictionary <string, string> dictionary = new Dictionary <string, string>();
                dictionary.set_Item("RetCode", status ? "0" : "-1");
                dictionary.set_Item("PanelName", panelName);
                string result = Json.Serialize(dictionary);
                CSharpInterface.ExecCallback(callId, result);
                if (!status)
                {
                    Logger.ERROR(string.Empty);
                    pandoraImpl.DestroyPanel(panelName);
                }
            };

            pandoraImpl.CreatePanel(panelName, onCreatePanel);
        }
 public static void ExecCallback(uint callId, string result)
 {
     try
     {
         Logger.DEBUG("callId=" + callId.ToString() + " result=" + result);
         LuaScriptMgr luaScriptMgr = Pandora.Instance.GetLuaScriptMgr();
         PandoraImpl  pandoraImpl  = Pandora.Instance.GetPandoraImpl();
         if (luaScriptMgr != null && pandoraImpl.GetIsLuaMgrInited())
         {
             luaScriptMgr.CallLuaFunction("Common.ExecCallback", new object[]
             {
                 callId,
                 result
             });
         }
     }
     catch (Exception ex)
     {
         Logger.ERROR(ex.get_StackTrace());
     }
 }
Exemplo n.º 9
0
        public void Init()
        {
            if (this.isInited)
            {
                return;
            }
            string temporaryCachePath = Application.temporaryCachePath;

            this.logPath             = temporaryCachePath + "/Pandora/logs";
            this.cachePath           = temporaryCachePath + "/Pandora/cache";
            this.imgPath             = this.cachePath + "/imgs";
            this.cookiePath          = this.cachePath + "/cookies";
            this.tempPath            = temporaryCachePath + "/Pandora/temp";
            this.streamingAssetsPath = Application.streamingAssetsPath + "/Pandora";
            this.pandoraGameObject   = new GameObject("Pandora GameObject");
            Object.DontDestroyOnLoad(this.pandoraGameObject);
            this.pandoraImpl = this.pandoraGameObject.AddComponent <PandoraImpl>();
            this.logger      = this.pandoraGameObject.AddComponent <Logger>();
            this.pandoraGameObject.AddComponent <MidasUtil>();
            this.pandoraImpl.Init();
            this.isInited = true;
        }
        public static bool GetFunctionSwitch(string functionName)
        {
            PandoraImpl pandoraImpl = Pandora.Instance.GetPandoraImpl();

            return(pandoraImpl.GetFunctionSwitch(functionName));
        }
        public static bool GetTotalSwitch()
        {
            PandoraImpl pandoraImpl = Pandora.Instance.GetPandoraImpl();

            return(pandoraImpl.GetTotalSwitch());
        }
        public static bool IsImageDownloaded(string url)
        {
            PandoraImpl pandoraImpl = Pandora.Instance.GetPandoraImpl();

            return(pandoraImpl.IsImgDownloaded(url));
        }