private static string GetPandoraRoot()
 {
     if (string.IsNullOrEmpty(LocalDirectoryHelper._root))
     {
         LocalDirectoryHelper._root = Path.Combine(PandoraSettings.GetTemporaryCachePath(), "Pandora");
     }
     return(LocalDirectoryHelper._root);
 }
Ejemplo n.º 2
0
 public void SetUserData(Dictionary <string, string> data)
 {
     if (this._userData.IsRoleEmpty())
     {
         data["sSdkVersion"] = PandoraSettings.GetSdkVersion();
         this._userData.Assign(data);
         Logger.LogInfo(this._userData.ToString());
         this.LoadRemoteConfig(this._userData);
     }
     else
     {
         this._userData.Refresh(data);
     }
 }
 public static void DeleteAssetByUrl(string url)
 {
     try
     {
         string path = url.Replace(PandoraSettings.GetFileProtocolToken(), string.Empty);
         if (File.Exists(path))
         {
             File.Delete(path);
         }
     }
     catch (Exception ex)
     {
         string text = "删除文件发生异常,Url: " + url + "\n" + ex.Message;
         Logger.LogError(text);
         Pandora.Instance.ReportError(text, 0);
     }
 }
Ejemplo n.º 4
0
 private void OnGetRemoteConfig(RemoteConfig remoteConfig)
 {
     if (remoteConfig.IsError || remoteConfig.IsEmpty)
     {
         this.CallGame("{\"type\":\"pandoraError\",\"content\":\"cgiFailed\"}");
         return;
     }
     if (!remoteConfig.IsEmpty && !remoteConfig.IsError)
     {
         Logger.LogInfo(this._userData.ToString());
         Logger.LogInfo("<color=#00ff00>匹配到管理端规则:</color>  " + remoteConfig.ruleId.ToString());
         this._remoteConfig = remoteConfig;
         LuaStateManager.Initialize();
         this._atmSocket = this._gameObject.AddComponent <AtmSocket>();
         this._atmSocket.Connect(PandoraSettings.GetAtmHost(), PandoraSettings.GetAtmPort(), new Action(this.OnAtmConnected));
     }
 }
Ejemplo n.º 5
0
 public void Init(bool isProductEnvironment, string rootName = "")
 {
     if (!this._isInitialized)
     {
         this._isInitialized = true;
         this._rootName      = rootName;
         PandoraSettings.IsProductEnvironment = isProductEnvironment;
         PandoraSettings.ReadEnvironmentSetting();
         this._userData = new UserData();
         LocalDirectoryHelper.Initialize();
         this.CreatePandoraGameObject();
         this.AddLogHook();
         CacheManager.Initialize();
         AssetManager.Initialize();
         PanelManager.Initialize();
         TextPartner.GetFont = new Func <string, Font>(this.GetFont);
         Logger.LogLevel     = PandoraSettings.DEFAULT_LOG_LEVEL;
         Logger.LogInfo("<color=#0000ff>Pandora Init " + this.GetSystemInfo() + "</color>");
     }
 }
Ejemplo n.º 6
0
 public static string GetCachedAssetUrl(string url)
 {
     return(PandoraSettings.GetFileProtocolToken() + CacheManager.GetCachedAssetPath(url));
 }
 public static string GetStreamingAssetsUrl()
 {
     return(PandoraSettings.GetFileProtocolToken() + Application.streamingAssetsPath + "/Pandora");
 }
Ejemplo n.º 8
0
 public static string GetPlatformDescription()
 {
     return(PandoraSettings.GetPlatformDescription());
 }