//public static void moveCache(string Des,List<string> DeleteList)
        //{

        //}
        //TODO
        public static void Unpackage(string sha1)
        {
            if (sha1List != null)
            {
                foreach (string element in sha1List)
                {
                    Unzipper.UnZip(@"\HikazeLauncher\download\" + sha1 + ".zip", @".\HikazeLauncher\temp");
                }
            }
            else
            {
                throw new NullReferenceException("sha1List Empty");
            }
        }
Beispiel #2
0
        public static ArrayList GetListFormJObject(string GamePath, string GameVersion, string OldGameVersion = null)
        {
            ArrayList LibList     = new ArrayList();
            JObject   ReadingJson = JsonHandler.ReadVersionJson(GamePath, GameVersion);

            if (ReadingJson["inheritsFrom"] != null)
            {
                LibList.AddRange(GetListFormJObject(GamePath, ReadingJson["inheritsFrom"].ToString(), GameVersion));
            }
            foreach (JToken lib in ReadingJson["libraries"])
            {
                if (lib["natives"] != null)
                {
                    if (lib["natives"]["windows"] != null)
                    {
                        if (string.IsNullOrEmpty(OldGameVersion))
                        {
                            Unzipper.UnZip(GamePath + @"\libraries\" + ConvertPackageToPath(lib["name"].ToString(), lib["natives"]["windows"].ToString()),
                                           GamePath + @"\versions\" + GameVersion + @"\" + GameVersion + @"-natives");
                        }
                        else
                        {
                            Unzipper.UnZip(GamePath + @"\libraries\" + ConvertPackageToPath(lib["name"].ToString(), lib["natives"]["windows"].ToString()),
                                           GamePath + @"\versions\" + OldGameVersion + @"\" + OldGameVersion + @"-natives");
                        }
                    }
                    else
                    {
                        continue;
                    }
                }
                else
                {
                    LibList.Add(lib["name"]);
                }
            }
            return(LibList);
            //TODO:分流非Natives并解压Natives
        }