mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-03 05:26:05 +02:00
gamelog parse api user requests
This commit is contained in:
+31
-1
@@ -67,7 +67,7 @@ namespace VRCX
|
|||||||
thread.Interrupt();
|
thread.Interrupt();
|
||||||
thread.Join();
|
thread.Join();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
m_ResetLog = true;
|
m_ResetLog = true;
|
||||||
@@ -214,6 +214,7 @@ namespace VRCX
|
|||||||
ParseLogLocationDestination(fileInfo, logContext, line, offset) == true ||
|
ParseLogLocationDestination(fileInfo, logContext, line, offset) == true ||
|
||||||
ParseLogPortalSpawn(fileInfo, logContext, line, offset) == true ||
|
ParseLogPortalSpawn(fileInfo, logContext, line, offset) == true ||
|
||||||
ParseLogNotification(fileInfo, logContext, line, offset) == true ||
|
ParseLogNotification(fileInfo, logContext, line, offset) == true ||
|
||||||
|
ParseLogAPIRequest(fileInfo, logContext, line, offset) == true ||
|
||||||
ParseLogJoinBlocked(fileInfo, logContext, line, offset) == true ||
|
ParseLogJoinBlocked(fileInfo, logContext, line, offset) == true ||
|
||||||
ParseLogAvatarPedestalChange(fileInfo, logContext, line, offset) == true ||
|
ParseLogAvatarPedestalChange(fileInfo, logContext, line, offset) == true ||
|
||||||
ParseLogVideoError(fileInfo, logContext, line, offset) == true ||
|
ParseLogVideoError(fileInfo, logContext, line, offset) == true ||
|
||||||
@@ -654,6 +655,35 @@ namespace VRCX
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool ParseLogAPIRequest(FileInfo fileInfo, LogContext logContext, string line, int offset)
|
||||||
|
{
|
||||||
|
// 2021.10.03 09:49:50 Log - [API] [110] Sending Get request to https://api.vrchat.cloud/api/1/worlds?apiKey=JlE5Jldo5Jibnk5O5hTx6XVqsJu4WJ26&organization=vrchat&userId=usr_032383a7-748c-4fb2-94e4-bcb928e5de6b&n=99&order=descending&offset=0&releaseStatus=public&maxUnityVersion=2019.4.31f1&minUnityVersion=5.5.0f1&maxAssetVersion=4&minAssetVersion=0&platform=standalonewindows
|
||||||
|
// 2021.10.03 09:48:43 Log - [API] [101] Sending Get request to https://api.vrchat.cloud/api/1/users/usr_032383a7-748c-4fb2-94e4-bcb928e5de6b?apiKey=JlE5Jldo5Jibnk5O5hTx6XVqsJu4WJ26&organization=vrchat
|
||||||
|
|
||||||
|
if (string.Compare(line, offset, "[API] [", 0, 7, StringComparison.Ordinal) != 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var pos = line.LastIndexOf("] Sending Get request to ");
|
||||||
|
if (pos < 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var data = line.Substring(pos + 25);
|
||||||
|
|
||||||
|
AppendLog(new[]
|
||||||
|
{
|
||||||
|
fileInfo.Name,
|
||||||
|
ConvertLogTimeToISO8601(line),
|
||||||
|
"api-request",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public string[][] Get()
|
public string[][] Get()
|
||||||
{
|
{
|
||||||
Update();
|
Update();
|
||||||
|
|||||||
@@ -7601,6 +7601,27 @@ speechSynthesis.getVoices();
|
|||||||
case 'video-play':
|
case 'video-play':
|
||||||
this.addGameLogVideo(gameLog, location, userId, pushToTable);
|
this.addGameLogVideo(gameLog, location, userId, pushToTable);
|
||||||
return;
|
return;
|
||||||
|
case 'api-request':
|
||||||
|
if (!this.isGameRunning) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var userId = '';
|
||||||
|
try {
|
||||||
|
var url = new URL(gameLog.url);
|
||||||
|
var urlParams = new URLSearchParams(gameLog.url);
|
||||||
|
if (url.pathname.substring(0, 13) === '/api/1/users/') {
|
||||||
|
var pathArray = url.pathname.split('/');
|
||||||
|
userId = pathArray[4]
|
||||||
|
} else if (urlParams.has('userId')) {
|
||||||
|
userId = urlParams.get('userId');
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
if (userId && !API.cachedUsers.has(userId)) {;
|
||||||
|
API.getUser({userId});
|
||||||
|
}
|
||||||
|
return;
|
||||||
case 'vrcx':
|
case 'vrcx':
|
||||||
// VideoPlay(PyPyDance) "https://jd.pypy.moe/api/v1/videos/jr1NX4Jo8GE.mp4",0.1001,239.606,"0905 : [J-POP] 【まなこ】金曜日のおはよう 踊ってみた (vernities)"
|
// VideoPlay(PyPyDance) "https://jd.pypy.moe/api/v1/videos/jr1NX4Jo8GE.mp4",0.1001,239.606,"0905 : [J-POP] 【まなこ】金曜日のおはよう 踊ってみた (vernities)"
|
||||||
var type = gameLog.data.substr(0, gameLog.data.indexOf(' '));
|
var type = gameLog.data.substr(0, gameLog.data.indexOf(' '));
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ class GameLogService {
|
|||||||
gameLog.data = args[0];
|
gameLog.data = args[0];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'api-request':
|
||||||
|
gameLog.url = args[0];
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user