private void StartDownLoad(GameResFileInfo resInfo) { if (IsLoading) { return; } IsLoading = true; IsDone = false; Progress = 0; gameResInfo = resInfo; string localfolderPath = URLFactory.GetLocalGameResSaveFolder(resInfo.gameName); string tagfolderPath = URLFactory.GetLocalGameTagFolder(resInfo.gameName); if (!Directory.Exists(localfolderPath)) { Directory.CreateDirectory(localfolderPath); } if (!Directory.Exists(tagfolderPath)) { Directory.CreateDirectory(tagfolderPath); } TotalBytesKB = 0; foreach (DownLoadFileInfo info in resInfo.infoList) { if (DownLoadManager.CheckOnceFileInfo(info) != GameVersionState.NewestVersion) { DownLoadThread downLoadThread = new DownLoadThread(); downLoadThreadList.Add(downLoadThread); downLoadThread.StartDownLoad(info); TotalBytesKB += info.size; } } }
private void ClearUrlParams(ref List <string> urlParmsList, ref string PageName, string Slug, int TabID, PortalSettings pS) { var Locales = LocaleController.Instance.GetLocales(pS.PortalId); //Remove Slug urlParmsList.Remove(Slug); //Check if locale matches foreach (var key in Locales.Keys) { if (urlParmsList.Contains(key.ToLower())) { urlParmsList.Remove(key.ToLower()); break; } } // if locale is changed in portal alias, for Live Article foreach (var key in pS.PortalAlias.HTTPAlias.ToString().Split('/')) { if (urlParmsList.Contains(key.ToLower())) { urlParmsList.Remove(key.ToLower()); break; } } URLFactory.GetPageName(ref PageName, TabID, pS); }
private void UpdateTag() { UnZipFile(); string localTagPath = URLFactory.GetLocalGameTagPath(CurDownLoadFileInfo); StreamWriter streamWriter = new StreamWriter(localTagPath); streamWriter.WriteLine(CurDownLoadFileInfo.version); streamWriter.Close(); }
private static string Redirect(out int status, out string location, int PortalID, PortalSettings pS, int TabID, string result, URLEntity CurrentURL, string QueryParameters) { URLEntity RedirectURL = URLManager.GetDefaultURL(CurrentURL.ModuleID, CurrentURL.EntityID, CurrentURL.Entity, CurrentURL.Language); location = URLFactory.GetFriendlyURL(null, pS, RedirectURL.Slug, QueryParameters, RedirectURL.Language, RedirectURL.PageName); status = 301; return(result); }
public static string GetPermLink(string _PermLink, int ModuleID, string Entity, int EntityID) { if (string.IsNullOrEmpty(_PermLink)) { _PermLink = URLFactory.GetEntityURL(ModuleID, EntityID, Entity, null); } return(_PermLink); }
public static List <IUIData> GetData(int PortalID, int ModuleID, string Identifier, Dictionary <string, string> UIEngineInfo, Dictionary <string, string> Parameters) { Dictionary <string, IUIData> Settings = new Dictionary <string, IUIData>(); List <URLEntity> Urls = new List <URLEntity>(); if (Parameters.ContainsKey("eid") && Parameters.ContainsKey("ename")) { Urls = URLFactory.GetUrlHistory(ModuleID, int.Parse(Parameters["eid"]), Parameters["ename"]).OrderByDescending(o => o.URLID).ToList(); } Settings.Add("UrlHistory", new UIData { Name = "UrlHistory", Options = Urls }); return(Settings.Values.ToList()); }
private void UnZipFile() { string fileName = CurDownLoadFileInfo.fileName; if (fileName.EndsWith(".zip")) { string fullPath = URLFactory.GetLocalGameResSavePath(CurDownLoadFileInfo); string unZipToDirectoryPath = URLFactory.GetLocalGameResSaveFolder(CurDownLoadFileInfo.GameName); if (!Directory.Exists(unZipToDirectoryPath)) { Directory.CreateDirectory(unZipToDirectoryPath); } UtilsZipHelper.UnZipFile(fullPath, unZipToDirectoryPath); File.Delete(fullPath); } }
public static List <URLEntity> GetURLs(List <URLEntity> _URLs, int ModuleID, string Entity, int EntityID) { if (_URLs == null) //Check if we've already persisted the object once { if (ModuleID != 0) //Check if data even exists in db yet. Product.ModuleID == 0 indicates a new category { _URLs = URLFactory.GetURLs(ModuleID, EntityID, Entity); } if (_URLs == null) //No URLs are available yet { _URLs = new List <URLEntity>(); } } return(_URLs); }
public void StartDownLoad(DownLoadFileInfo info) { if (IsDownLoading) { return; } Init(); CurDownLoadFileInfo = info; Progress = 0; IsDone = false; IsDownLoading = true; string serverGameResPath = URLFactory.GetServerGameResPath(info); string localSavePath = URLFactory.GetLocalGameResSavePath(info); if (File.Exists(localSavePath)) { File.Delete(localSavePath); } _myWebClient.DownloadFileAsync(new Uri(serverGameResPath), localSavePath); }
public static GameVersionState CheckOnceFileInfo(DownLoadFileInfo info) { int gameServerVersion = info.version; string localTagPath = URLFactory.GetLocalGameTagPath(info); if (File.Exists(localTagPath)) { StreamReader streamReader = new StreamReader(localTagPath); string versionStr = streamReader.ReadToEnd(); streamReader.Close(); int versioni; if (int.TryParse(versionStr, out versioni)) { if (versioni >= gameServerVersion) { return(GameVersionState.NewestVersion); } return(GameVersionState.OldVersion); } } return(GameVersionState.UnLoad); }
public static string GetUnique(int ModuleID, string Slug) { return(URLFactory.GetUnique(ModuleID, Slug)); }
public static int UpdatePageName(int ModuleID, bool value) { return(URLFactory.UpdatePageName(ModuleID, value)); }
public static void DeleteUrls(int ModuleID, int EntityID, string Entity) { URLFactory.DeleteUrls(ModuleID, EntityID, Entity); }
public static void Add(URLEntity URL) { URLFactory.Add(URL); }
public HotClassILRuntime CreateHotClass(string className, string nameSpace = "PlatformLobbyCode") { string classFullName = URLFactory.FormatNameSpace(nameSpace, className); return(new HotClassILRuntime(classFullName)); }
public static string GetFriendlyURL(int?ModuleID, PortalSettings pS, string Slug, string QueryParameters, string Language, bool IncludePageName) { return(URLFactory.GetFriendlyURL(ModuleID, pS, Slug, QueryParameters, Language, IncludePageName)); }
public static void GetIdenCode(string mmobileNum) { Utils.PostHttpRequest(URLFactory.FormatWebPhpUrl(URLFactory.WebServerPath, URLFactory.RequestIdenCodePhp), URLFactory.FormatPhpParam(true, "phone", mmobileNum), null); }
public static URLEntity GetURL(int ModuleID, string[] Slugs) { return(URLFactory.GetURL(ModuleID, Slugs)); }
public static URLEntity GetURL(string Slug) { return(URLFactory.GetURL(0, Slug)); }
public static URLEntity GetDefaultURL(int ModuleID, int EntityID, string Entity, string Language) { return(URLFactory.GetDefaultURL(ModuleID, EntityID, Entity, Language)); }
public static void InitDefaultURLs <T>(int ModuleID, List <T> Entities, string Language) { URLFactory.InitDefaultURLs(ModuleID, Entities, Language); }
public static void InitDefaultURLs <T>(int ModuleID, List <T> Entities) { URLFactory.InitDefaultURLs(ModuleID, Entities); }
public static Dictionary <string, string> GetFriendlyURLs(PortalSettings pS, int ModuleID, string Language, Dictionary <string, int> Entities) { return(URLFactory.GetFriendlyURLs(pS, ModuleID, Language, Entities)); }
public static List <URLEntity> GetUrlHistory(int ModuleID, int EntityID, string Entity) { return(URLFactory.GetUrlHistory(ModuleID, EntityID, Entity)); }
public static int GetSlugTabID(string[] urlParms, ref string Slug, int TabID, PortalInfo Pi) { return(URLFactory.GetSlugTabID(urlParms, ref Slug, TabID, Pi)); }
public static string GetCurrentLanguage() { return(URLFactory.GetCurrentLanguage()); }