Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions Assets/Plugin/Exporters/MIDIDMX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,26 @@ private void findVRCLog()
logStream = null;
}

string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string[] logs = Directory.GetFiles(path + "\\..\\LocalLow\\VRChat\\VRChat", "output_log_*.txt", SearchOption.TopDirectoryOnly);
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN

string localPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
string localLowPath = localPath + "Low";

#elif UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX

string _userFolder = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);

string localPath = Path.Join(_userFolder, ".config"); // Assume XDG defaults
string localLowPath = Path.Join(_userFolder, ".local", "share"); // Assume XDG defaults

#endif

// path + "\\..\\LocalLow\\VRChat\\VRChat"
string vrcFolder = Path.Join(localLowPath, "VRChat", "VRChat");
if (!Directory.Exists(vrcFolder))
return;

string[] logs = Directory.GetFiles(vrcFolder, "output_log_*.txt", SearchOption.TopDirectoryOnly);
if (logs.Length == 0) return;

Array.Sort(logs);
Expand All @@ -394,9 +412,17 @@ private void findVRCLog()
//Editor!!
if (useEditorLog)
{
log = path + "\\..\\Local\\Unity\\Editor\\Editor.log";
// path + "\\..\\Local\\Unity\\Editor\\Editor.log"
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
log = Path.Join(Path.Join(localPath, "Unity", "Editor"), "Editor.log");
#elif UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX
log = Path.Join(Path.Join(localPath, "unity3d"), "Editor.log");
#endif
}

if (!File.Exists(log))
return;

logStream = new FileStream(log, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);

//forward to the end to wait on it
Expand Down
Loading