/// <summary> /// 判断程序是否需要更新 /// </summary> /// <returns></returns> public static void CheckUpdate(bool Tips) { var builder = new LSBuilder(); var obj = builder.Get($"{Config["ApiHost"]}{Config["UpdateUrl"]}"); if (obj == null) { return; } var info = obj["tag"].GetValue(typeof(VersionInfo)) as VersionInfo; if (info != null && !info.Name.Equals(Version)) { //若当前版本低于最新版本时,触发更新 if (MessageBox.Show(Language.Default["NeedUpdateTips"], Language.Default["Tips"], MessageBoxButtons.OKCancel) != DialogResult.OK) { return; //提示更新 } StartUpdate(); //启动更新 } else if (Tips) { MessageBox.Show(Language.Default["NeedNotUpdateTips"]); //提示不需要更新 } Config.Save(); }
private List <string> GetAvatar(string profession, string part) { LSBuilder builder = new LSBuilder(); var obj = builder.Get($"{API_HOST}/avatar/list/{profession}/{part}"); List <Avatar> list = new List <Avatar>(); obj.GetValue(ref list); return(list.ConvertAll(avatar => avatar.Code)); }
private List <string> GetProfession() { LSBuilder builder = new LSBuilder(); var obj = builder.Get($"{API_HOST}/profession/list"); List <Profession> list = new List <Profession>(); obj.GetValue(ref list); return(list.ConvertAll(profesion => profesion.Name)); }
private List <Profession> GetProfession() { var builder = new LSBuilder(); var obj = builder.Get($"{API_HOST}/profession/list"); var list = new List <Profession>(); obj.GetValue(ref list); return(list); }
private List <Profession> GetProfession() { var builder = new LSBuilder(); var obj = builder.Get("http://localhost:8080/api/dressing/profession/list"); var list = new List <Profession>(); obj.GetValue(ref list); return(list); }
private static List <string> GetAvatar(string profession, string part) { var url = $"{API_HOST}/avatar/list/{profession}/{part}.json"; var builder = new LSBuilder(); var obj = builder.Get(url); var list = new List <Avatar>(); obj.GetValue(ref list); Console.WriteLine("GET ... " + url); return(list.ConvertAll(avatar => avatar.Code)); }
public void Refresh() { NetList.Clear(); try { var builder = new LSBuilder(); var obj = builder.Get(MARKET_URL); if (obj["status"].Value.Equals("success")) { NetList = obj["tag"].GetValue(typeof(List <Metadata>)) as List <Metadata>; } } catch (Exception e) { } }
public void Refresh() { NetList.Clear(); try { var builder = new LSBuilder(); var obj = builder.Get(Config["MarketUrl"].Value); if (obj["status"].Value.Equals("success")) { NetList = obj["tag"].GetValue(typeof(List <Metadata>)) as List <Metadata>; } } catch (Exception e) { throw new PluginExecption("PluginListDownloadError"); } }
public void Test02() { Program.RegistyHandler(); foreach (var profession in profession_array) { var dir = $"E:/avatar/icon_new_image/{profession}"; if (Directory.Exists(dir)) { Directory.Delete(dir, true); } Directory.CreateDirectory(dir); foreach (var part in part_array) { var list = Tools.Load($@"D:\地下城与勇士\ImagePacks2\sprite_character_{profession + (profession.Contains("_") ? "" : "_")}equipment_avatar_{part}.NPK"); var builder = new LSBuilder(); var obj = builder.Get($"http://localhost/api/avatar/icon?profession={profession}&part={part}"); var cur_list = new List <string>(); foreach (var child in obj) { var code = child["code"].Value.ToString(); cur_list.Add(code); } var rs = new List <Album>(); foreach (var img in list.ToArray()) { var name = img.Name; var regex = new Regex("\\d+"); var match = regex.Match(name); if (match.Success) { var code = match.Value; if (!cur_list.Contains(code)) { rs.Add(img); } } } Tools.WriteNPK($"E:/avatar/icon_new_image/{profession}/{part}.NPK", rs); } } }
/// <summary> /// 判断程序是否需要更新 /// </summary> /// <returns></returns> public static void CheckUpdate(bool Tips) { try { var builder = new LSBuilder(); var obj = builder.Get(Config["UpdateUrl"].Value).GetValue(typeof(VersionInfo)) as VersionInfo; if (!obj.Name.Equals(Version)) //若当前版本低于最新版本时,触发更新 { if (MessageBox.Show(Language.Default["NeedUpdateTips"], "", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; //提示更新 } StartUpdate(); //启动更新 } else if (Tips) { MessageBox.Show(Language.Default["NeedNotUpdateTips"]);//提示不需要更新 } } catch (Exception e) { Console.Write(e.StackTrace); } Config.Save(); }
private void ComparePlugin() { var builder = new LSBuilder(); var obj = builder.Get(DOWNLOAD_PLUGIN_API_URL, new Dictionary <string, object>() { ["guid"] = Guid.ToString() }); var files = obj.GetValue(typeof(List <FileInfo>)) as List <FileInfo>; Stack = new Stack <FileInfo>(); foreach (var info in files) { info.Name = $"plugin/{Guid}/{info.Name}"; if (!Check(info)) { Stack.Push(info); } } if (Stack.Count > 0) { Download(Stack.Pop()); } }
private void Compare() { var builder = new LSBuilder(); var obj = builder.Get(UPDATE_URL); var version = obj.GetValue(typeof(VersionInfo)) as VersionInfo; var files = version.Files; Stack = new Stack <FileInfo>(); foreach (var info in files) { if (!Check(info)) { Stack.Push(info); } } if (Stack.Count > 0) { Download(Stack.Pop()); } else { Start(); } }