mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 14:56:06 +02:00
Log parsing for udon video URL's
This commit is contained in:
@@ -193,6 +193,7 @@ namespace VRCX
|
|||||||
ParseLogLocation(fileInfo, logContext, line, offset) == true ||
|
ParseLogLocation(fileInfo, logContext, line, offset) == true ||
|
||||||
ParseLogPortalSpawn(fileInfo, logContext, line, offset) == true ||
|
ParseLogPortalSpawn(fileInfo, logContext, line, offset) == true ||
|
||||||
ParseLogJoinBlocked(fileInfo, logContext, line, offset) == true ||
|
ParseLogJoinBlocked(fileInfo, logContext, line, offset) == true ||
|
||||||
|
ParseLogVideoPlay(fileInfo, logContext, line, offset) == true ||
|
||||||
ParseLogVideoError(fileInfo, logContext, line, offset) == true)
|
ParseLogVideoError(fileInfo, logContext, line, offset) == true)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -449,6 +450,34 @@ namespace VRCX
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool ParseLogVideoPlay(FileInfo fileInfo, LogContext logContext, string line, int offset)
|
||||||
|
{
|
||||||
|
// 2021.04.20 13:37:69 Log - [Video Playback] Attempting to resolve URL 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
|
||||||
|
|
||||||
|
if (string.Compare(line, offset, "Attempting to resolve URL '", 0, 27, StringComparison.Ordinal) != 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var pos = line.LastIndexOf("'");
|
||||||
|
if (pos < 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var data = line.Substring(78);
|
||||||
|
data = data.Remove(data.Length - 1);
|
||||||
|
|
||||||
|
AppendLog(new[]
|
||||||
|
{
|
||||||
|
fileInfo.Name,
|
||||||
|
ConvertLogTimeToISO8601(line),
|
||||||
|
"video-play",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private bool ParseLogNotification(FileInfo fileInfo, LogContext logContext, string line, int offset)
|
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
|
// 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
|
||||||
|
|||||||
+20
-2
@@ -4371,6 +4371,9 @@ speechSynthesis.getVoices();
|
|||||||
case 'Event':
|
case 'Event':
|
||||||
this.speak(noty.data);
|
this.speak(noty.data);
|
||||||
break;
|
break;
|
||||||
|
case 'VideoPlay':
|
||||||
|
this.speak(`Now playing: ${noty.data}`);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -4448,6 +4451,9 @@ speechSynthesis.getVoices();
|
|||||||
case 'Event':
|
case 'Event':
|
||||||
AppApi.XSNotification('VRCX', noty.data, timeout, image);
|
AppApi.XSNotification('VRCX', noty.data, timeout, image);
|
||||||
break;
|
break;
|
||||||
|
case 'VideoPlay':
|
||||||
|
AppApi.XSNotification('VRCX', `Now playing: ${noty.data}`, timeout, image);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -4522,7 +4528,10 @@ speechSynthesis.getVoices();
|
|||||||
AppApi.DesktopNotification(noty.data, `has spawned a portal`, image);
|
AppApi.DesktopNotification(noty.data, `has spawned a portal`, image);
|
||||||
break;
|
break;
|
||||||
case 'Event':
|
case 'Event':
|
||||||
AppApi.DesktopNotification('Event', noty.data, '');
|
AppApi.DesktopNotification('Event', noty.data, image);
|
||||||
|
break;
|
||||||
|
case 'VideoPlay':
|
||||||
|
AppApi.DesktopNotification('Now playing', noty.data, image);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -5783,7 +5792,6 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case 'event':
|
case 'event':
|
||||||
tableData = {
|
tableData = {
|
||||||
created_at: gameLog.dt,
|
created_at: gameLog.dt,
|
||||||
@@ -5792,6 +5800,14 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'video-play':
|
||||||
|
tableData = {
|
||||||
|
created_at: gameLog.dt,
|
||||||
|
type: 'VideoPlay',
|
||||||
|
data: gameLog.videoURL
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -6957,6 +6973,7 @@ speechSynthesis.getVoices();
|
|||||||
sharedFeedFilters.noty.unmute = 'On';
|
sharedFeedFilters.noty.unmute = 'On';
|
||||||
sharedFeedFilters.noty.PortalSpawn = 'Everyone';
|
sharedFeedFilters.noty.PortalSpawn = 'Everyone';
|
||||||
sharedFeedFilters.noty.Event = 'On';
|
sharedFeedFilters.noty.Event = 'On';
|
||||||
|
sharedFeedFilters.noty.VideoPlay = 'Off';
|
||||||
sharedFeedFilters.wrist.Location = 'On';
|
sharedFeedFilters.wrist.Location = 'On';
|
||||||
sharedFeedFilters.wrist.OnPlayerJoined = 'Everyone';
|
sharedFeedFilters.wrist.OnPlayerJoined = 'Everyone';
|
||||||
sharedFeedFilters.wrist.OnPlayerLeft = 'Everyone';
|
sharedFeedFilters.wrist.OnPlayerLeft = 'Everyone';
|
||||||
@@ -6981,6 +6998,7 @@ speechSynthesis.getVoices();
|
|||||||
sharedFeedFilters.wrist.unmute = 'On';
|
sharedFeedFilters.wrist.unmute = 'On';
|
||||||
sharedFeedFilters.wrist.PortalSpawn = 'Everyone';
|
sharedFeedFilters.wrist.PortalSpawn = 'Everyone';
|
||||||
sharedFeedFilters.wrist.Event = 'On';
|
sharedFeedFilters.wrist.Event = 'On';
|
||||||
|
sharedFeedFilters.wrist.VideoPlay = 'On';
|
||||||
|
|
||||||
configRepository.setString('sharedFeedFilters', JSON.stringify(sharedFeedFilters));
|
configRepository.setString('sharedFeedFilters', JSON.stringify(sharedFeedFilters));
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-1
@@ -167,7 +167,7 @@ html
|
|||||||
template(#tool)
|
template(#tool)
|
||||||
div(style="margin:0 0 10px;display:flex;align-items:center")
|
div(style="margin:0 0 10px;display:flex;align-items:center")
|
||||||
el-select(v-model="gameLogTable.filters[0].value" multiple clearable collapse-tags style="flex:1" placeholder="Filter")
|
el-select(v-model="gameLogTable.filters[0].value" multiple clearable collapse-tags style="flex:1" placeholder="Filter")
|
||||||
el-option(v-once v-for="type in ['Location', 'OnPlayerJoined', 'OnPlayerLeft', 'Notification', 'PortalSpawn', 'Event']" :key="type" :label="type" :value="type")
|
el-option(v-once v-for="type in ['Location', 'OnPlayerJoined', 'OnPlayerLeft', 'Notification', 'PortalSpawn', 'Event', 'VideoPlay']" :key="type" :label="type" :value="type")
|
||||||
el-input(v-model="gameLogTable.filters[1].value" placeholder="Search" style="flex:none;width:150px;margin:0 10px")
|
el-input(v-model="gameLogTable.filters[1].value" placeholder="Search" style="flex:none;width:150px;margin:0 10px")
|
||||||
el-button(type="default" @click="resetGameLog()" icon="el-icon-refresh" circle style="flex:none")
|
el-button(type="default" @click="resetGameLog()" icon="el-icon-refresh" circle style="flex:none")
|
||||||
el-table-column(type="expand")
|
el-table-column(type="expand")
|
||||||
@@ -186,6 +186,8 @@ html
|
|||||||
location(v-if="scope.row.type === 'Location'" :location="scope.row.data[0]" :hint="scope.row.data[1]")
|
location(v-if="scope.row.type === 'Location'" :location="scope.row.data[0]" :hint="scope.row.data[1]")
|
||||||
template(v-else-if="scope.row.type === 'Event'")
|
template(v-else-if="scope.row.type === 'Event'")
|
||||||
span(v-text="scope.row.data")
|
span(v-text="scope.row.data")
|
||||||
|
template(v-else-if="scope.row.type === 'VideoPlay'")
|
||||||
|
span.x-link(v-text="scope.row.data" @click="openExternalLink(scope.row.data)")
|
||||||
template(v-else-if="scope.row.type === 'Notification'")
|
template(v-else-if="scope.row.type === 'Notification'")
|
||||||
span.x-link(v-else v-text="scope.row.data" @click="lookupUser(scope.row.data)")
|
span.x-link(v-else v-text="scope.row.data" @click="lookupUser(scope.row.data)")
|
||||||
|
|
||||||
@@ -1519,6 +1521,9 @@ html
|
|||||||
div
|
div
|
||||||
span.toggle-name Events
|
span.toggle-name Events
|
||||||
toggle-switch(:options="toggleSwitchOptionsOn" group="switchNotyGrouprequestEvent" v-model="sharedFeedFilters.noty.Event" class="toggle-switch")
|
toggle-switch(:options="toggleSwitchOptionsOn" group="switchNotyGrouprequestEvent" v-model="sharedFeedFilters.noty.Event" class="toggle-switch")
|
||||||
|
div
|
||||||
|
span.toggle-name Video Play
|
||||||
|
toggle-switch(:options="toggleSwitchOptionsOn" group="switchNotyGrouprequestVideoPlay" v-model="sharedFeedFilters.noty.VideoPlay" class="toggle-switch")
|
||||||
template(#footer)
|
template(#footer)
|
||||||
el-button(type="small" @click="cancelSharedFeedFilters") Cancel
|
el-button(type="small" @click="cancelSharedFeedFilters") Cancel
|
||||||
el-button(type="primary" size="small" style="margin-left:10px" @click="saveSharedFeedFilters") Save
|
el-button(type="primary" size="small" style="margin-left:10px" @click="saveSharedFeedFilters") Save
|
||||||
@@ -1598,6 +1603,9 @@ html
|
|||||||
div
|
div
|
||||||
span.toggle-name Events
|
span.toggle-name Events
|
||||||
toggle-switch(:options="toggleSwitchOptionsOn" group="switchWristGrouprequestEvent" v-model="sharedFeedFilters.wrist.Event" class="toggle-switch")
|
toggle-switch(:options="toggleSwitchOptionsOn" group="switchWristGrouprequestEvent" v-model="sharedFeedFilters.wrist.Event" class="toggle-switch")
|
||||||
|
div
|
||||||
|
span.toggle-name Video Play
|
||||||
|
toggle-switch(:options="toggleSwitchOptionsOn" group="switchWristGrouprequestVideoPlay" v-model="sharedFeedFilters.wrist.VideoPlay" class="toggle-switch")
|
||||||
template(#footer)
|
template(#footer)
|
||||||
el-button(type="small" @click="cancelSharedFeedFilters") Cancel
|
el-button(type="small" @click="cancelSharedFeedFilters") Cancel
|
||||||
el-button(type="primary" size="small" @click="saveSharedFeedFilters") Save
|
el-button(type="primary" size="small" @click="saveSharedFeedFilters") Save
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ function parseRawGameLog(dt, type, args) {
|
|||||||
gameLog.event = args[0];
|
gameLog.event = args[0];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'video-play':
|
||||||
|
gameLog.videoURL = args[0];
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -958,6 +958,9 @@ speechSynthesis.getVoices();
|
|||||||
case 'Event':
|
case 'Event':
|
||||||
text = noty.data;
|
text = noty.data;
|
||||||
break;
|
break;
|
||||||
|
case 'VideoPlay':
|
||||||
|
text = `<strong>Now playing:</strong> ${noty.data}`;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user