diff --git a/LogWatcher.cs b/LogWatcher.cs index b945b04d..7ec90b6f 100644 --- a/LogWatcher.cs +++ b/LogWatcher.cs @@ -279,7 +279,31 @@ namespace VRCX // 2020.11.01 00:07:01 Log - [PlayerManager] Removed player 2 / Rize♡ // 2020.11.01 00:07:02 Log - [Player] Unregistering Rize♡ - if (string.Compare(line, offset, "OnPlayerJoined ", 0, 15, StringComparison.Ordinal) == 0) + if (string.Compare(line, offset, "Initialized PlayerAPI \"", 0, 23, StringComparison.Ordinal) == 0) + { + var pos = line.LastIndexOf("\" is "); + if (pos < 0) + { + return false; + } + + var userDisplayName = line.Substring(offset + 23, pos - (offset + 23)); + var userType = line.Substring(pos + 5); + + AppendLog(new[] + { + fileInfo.Name, + ConvertLogTimeToISO8601(line), + "player-joined", + userDisplayName, + userType, + }); + + return true; + } + + // fallback method + /*if (string.Compare(line, offset, "OnPlayerJoined ", 0, 15, StringComparison.Ordinal) == 0) { var userDisplayName = line.Substring(offset + 15); @@ -292,7 +316,7 @@ namespace VRCX }); return true; - } + }*/ if (string.Compare(line, offset, "OnPlayerLeft ", 0, 13, StringComparison.Ordinal) == 0) { diff --git a/html/src/service/gamelog.js b/html/src/service/gamelog.js index d52c6945..3683e86b 100644 --- a/html/src/service/gamelog.js +++ b/html/src/service/gamelog.js @@ -20,6 +20,7 @@ function parseRawGameLog(dt, type, args) { case 'player-joined': gameLog.userDisplayName = args[0]; + gameLog.userType = args[1]; break; case 'player-left':