예제 #1
0
    public void UpdateInsertCache(string filePath, string sha)
    {
        Sha newSHA = new Sha();

        newSHA.path     = filePath;
        newSHA.unixTime = DateTime.Now;
        newSHA.SHA      = sha;
        string write = "";
        bool   found = false;

        for (int i = 0; i < shas.Count; i++)
        {
            if (shas[i].path == newSHA.path)
            {
                shas[i] = newSHA; found = true;
            }
            write += shas[i].ToString() + "\n";
        }
        if (!found)
        {
            shas.Add(newSHA);
            write += newSHA.ToString() + "\n";
        }
        File.WriteAllText("Assets/essential/Update/SHACACHE.conf", write);
    }