mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Add more log parsing for portals, video errors, shader keyword limit
This commit is contained in:
110
LogWatcher.cs
110
LogWatcher.cs
@@ -1,4 +1,4 @@
|
||||
// Copyright(c) 2019 pypy. All rights reserved.
|
||||
// Copyright(c) 2019 pypy. All rights reserved.
|
||||
//
|
||||
// This work is licensed under the terms of the MIT license.
|
||||
// For a copy, see <https://opensource.org/licenses/MIT>.
|
||||
@@ -28,6 +28,7 @@ namespace VRCX
|
||||
private readonly List<string[]> m_LogList;
|
||||
private Thread m_Thread;
|
||||
private bool m_ResetLog;
|
||||
private static bool ShaderKeywordsLimitReached = false;
|
||||
|
||||
// NOTE
|
||||
// FileSystemWatcher() is unreliable
|
||||
@@ -189,7 +190,10 @@ namespace VRCX
|
||||
{
|
||||
offset += 2;
|
||||
if (ParseLogOnPlayerJoinedOrLeft(fileInfo, logContext, line, offset) == true ||
|
||||
ParseLogLocation(fileInfo, logContext, line, offset) == true)
|
||||
ParseLogLocation(fileInfo, logContext, line, offset) == true ||
|
||||
ParseLogPortalSpawn(fileInfo, logContext, line, offset) == true ||
|
||||
ParseLogJoinBlocked(fileInfo, logContext, line, offset) == true ||
|
||||
ParseLogVideoError(fileInfo, logContext, line, offset) == true ||
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -197,7 +201,8 @@ namespace VRCX
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ParseLogNotification(fileInfo, logContext, line, 34) == true)
|
||||
if (ParseLogNotification(fileInfo, logContext, line, 34) == true ||
|
||||
ParseLogShaderKeywordsLimit(fileInfo, logContext, line, 34) == true)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -270,6 +275,7 @@ namespace VRCX
|
||||
location,
|
||||
logContext.RecentWorldName
|
||||
});
|
||||
ShaderKeywordsLimitReached = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -345,6 +351,104 @@ namespace VRCX
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool ParseLogPortalSpawn(FileInfo fileInfo, LogContext logContext, string line, int offset)
|
||||
{
|
||||
// 2021.04.06 11:25:45 Log - [Network Processing] RPC invoked ConfigurePortal on (Clone [1600004] Portals/PortalInternalDynamic) for Natsumi-sama
|
||||
|
||||
if (string.Compare(line, offset, "RPC invoked ConfigurePortal on (Clone [", 0, 39, StringComparison.Ordinal) != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var pos = line.LastIndexOf("] Portals/PortalInternalDynamic) for ");
|
||||
if (pos < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//var portalId = line.Substring(offset + 39, pos - (offset + 39));
|
||||
var data = line.Substring(pos + 37);
|
||||
|
||||
AppendLog(new[]
|
||||
{
|
||||
fileInfo.Name,
|
||||
ConvertLogTimeToISO8601(line),
|
||||
"portal-spawn",
|
||||
data
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool ParseLogShaderKeywordsLimit(FileInfo fileInfo, LogContext logContext, string line, int offset)
|
||||
{
|
||||
// 2021.04.04 12:21:06 Error - Maximum number (256) of shader keywords exceeded, keyword _TOGGLESIMPLEBLUR_ON will be ignored.
|
||||
|
||||
if (string.Compare(line, offset, "Maximum number (256) of shader keywords exceeded", 0, 48, StringComparison.Ordinal) != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ShaderKeywordsLimitReached == true)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
AppendLog(new[]
|
||||
{
|
||||
fileInfo.Name,
|
||||
ConvertLogTimeToISO8601(line),
|
||||
"event",
|
||||
"Shader Keyword Limit has been reached"
|
||||
});
|
||||
ShaderKeywordsLimitReached = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool ParseLogJoinBlocked(FileInfo fileInfo, LogContext logContext, string line, int offset)
|
||||
{
|
||||
// 2021.04.07 09:34:37 Error - [Behaviour] Master is not sending any events! Moving to a new instance.
|
||||
|
||||
if (string.Compare(line, offset, "Master is not sending any events! Moving to a new instance.", 0, 59, StringComparison.Ordinal) != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
AppendLog(new[]
|
||||
{
|
||||
fileInfo.Name,
|
||||
ConvertLogTimeToISO8601(line),
|
||||
"event",
|
||||
"Joining instance blocked by master"
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool ParseLogVideoError(FileInfo fileInfo, LogContext logContext, string line, int offset)
|
||||
{
|
||||
// 2021.04.08 06:37:45 Error - [Video Playback] ERROR: Video unavailable
|
||||
// 2021.04.08 06:40:07 Error - [Video Playback] ERROR: Private video
|
||||
|
||||
if (string.Compare(line, offset, "ERROR: ", 0, 7, StringComparison.Ordinal) != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var data = line.Substring(offset + 7);
|
||||
|
||||
AppendLog(new[]
|
||||
{
|
||||
fileInfo.Name,
|
||||
ConvertLogTimeToISO8601(line),
|
||||
"event",
|
||||
"VideoError: " + data
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool ParseLogNotification(FileInfo fileInfo, LogContext logContext, string line, int offset)
|
||||
{
|
||||
// 2021.01.03 05:48:58 Log - Received Notification: < Notification from username:pypy, sender user id:usr_4f76a584-9d4b-46f6-8209-8305eb683661 to of type: friendRequest, id: not_3a8f66eb-613c-4351-bee3-9980e6b5652c, created at: 01/14/2021 15:38:40 UTC, details: {{}}, type:friendRequest, m seen:False, message: ""> received at 01/02/2021 16:48:58 UTC
|
||||
|
||||
Reference in New Issue
Block a user