Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static string getRealPathCurrent(string prefix, string path, string title_id)
- {
- string savePath = Program.root + "/" + prefix + "/" + title_id;
- string[] stringSeparators = new string[] { "vol/content/", "vol\\content\\" };
- string[] result;
- string resultstr = "";
- result = path.Split(stringSeparators, StringSplitOptions.None);
- if (result.Length >= 2)
- {
- resultstr = result[result.Length - 1];
- stringSeparators = new string[] { "/", "\\" };
- result = resultstr.Split(stringSeparators, StringSplitOptions.None);
- savePath += "/" + "content";
- resultstr = "";
- for (int i = 0; i < result.Length; i++)
- {
- resultstr += "/" + result[i];
- }
- savePath += resultstr;
- return savePath;
- }
- else {
- if (currentPersistentID == 0) return "";
- stringSeparators = new string[] { "vol/save/", "vol\\save\\" };
- result = path.Split(stringSeparators, StringSplitOptions.None);
- if (result.Length < 2) return "";
- resultstr = result[result.Length - 1];
- stringSeparators = new string[] { "/", "\\" };
- result = resultstr.Split(stringSeparators, StringSplitOptions.None);
- if (result.Length < 2)
- {
- if (result[0] != "common") return savePath + "/" + String.Format("{0:X}", currentPersistentID);
- return savePath + "/" + "common";
- }
- resultstr = "";
- if (result[0] != "common")
- savePath += "/" + String.Format("{0:X}", currentPersistentID);
- else
- savePath += "/" + "common";
- for (int i = 1; i < result.Length; i++)
- {
- resultstr += "/" + result[i];
- }
- savePath += resultstr;
- return savePath;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement