mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-26 10:13:48 +02:00
Electron support for Linux (#1074)
* init * SQLite changes * Move html folder, edit build scripts * AppApi interface * Build flags * AppApi inheritance * Finishing touches * Merge upstream changes * Test CI * Fix class inits * Rename AppApi * Merge upstream changes * Fix SQLiteLegacy on Linux, Add Linux interop, build tools * Linux specific localisation strings * Make it run * Bring back most of Linux functionality * Clean up * Fix TTS voices * Fix UI var * Changes * Electron minimise to tray * Remove separate toggle for WlxOverlay * Fixes * Touchups * Move csproj * Window zoom, Desktop Notifications, VR check on Linux * Fix desktop notifications, VR check spam * Fix building on Linux * Clean up * Fix WebApi headers * Rewrite VRCX updater * Clean up * Linux updater * Add Linux to build action * init * SQLite changes * Move html folder, edit build scripts * AppApi interface * Build flags * AppApi inheritance * Finishing touches * Merge upstream changes * Test CI * Fix class inits * Rename AppApi * Merge upstream changes * Fix SQLiteLegacy on Linux, Add Linux interop, build tools * Linux specific localisation strings * Make it run * Bring back most of Linux functionality * Clean up * Fix TTS voices * Changes * Electron minimise to tray * Remove separate toggle for WlxOverlay * Fixes * Touchups * Move csproj * Window zoom, Desktop Notifications, VR check on Linux * Fix desktop notifications, VR check spam * Fix building on Linux * Clean up * Fix WebApi headers * Rewrite VRCX updater * Clean up * Linux updater * Add Linux to build action * Test updater * Rebase and handle merge conflicts * Fix Linux updater * Fix Linux app restart * Fix friend order * Handle AppImageInstaller, show an install message on Linux * Updates to the AppImage installer * Fix Linux updater, fix set version, check for .NET, copy wine prefix * Handle random errors * Rotate tall prints * try fix Linux restart bug * Final --------- Co-authored-by: rs189 <35667100+rs189@users.noreply.github.com>
This commit is contained in:
132
src/service/gamelog.js
Normal file
132
src/service/gamelog.js
Normal file
@@ -0,0 +1,132 @@
|
||||
// requires binding of LogWatcher
|
||||
|
||||
class GameLogService {
|
||||
parseRawGameLog(dt, type, args) {
|
||||
var gameLog = {
|
||||
dt,
|
||||
type
|
||||
};
|
||||
|
||||
switch (type) {
|
||||
case 'location':
|
||||
gameLog.location = args[0];
|
||||
gameLog.worldName = args[1];
|
||||
break;
|
||||
|
||||
case 'location-destination':
|
||||
gameLog.location = args[0];
|
||||
break;
|
||||
|
||||
case 'player-joined':
|
||||
gameLog.displayName = args[0];
|
||||
gameLog.userId = args[1];
|
||||
break;
|
||||
|
||||
case 'player-left':
|
||||
gameLog.displayName = args[0];
|
||||
gameLog.userId = args[1];
|
||||
break;
|
||||
|
||||
case 'notification':
|
||||
gameLog.json = args[0];
|
||||
break;
|
||||
|
||||
case 'portal-spawn':
|
||||
break;
|
||||
|
||||
case 'event':
|
||||
gameLog.event = args[0];
|
||||
break;
|
||||
|
||||
case 'video-play':
|
||||
gameLog.videoUrl = args[0];
|
||||
gameLog.displayName = args[1];
|
||||
break;
|
||||
|
||||
case 'resource-load-string':
|
||||
case 'resource-load-image':
|
||||
gameLog.resourceUrl = args[0];
|
||||
break;
|
||||
|
||||
case 'video-sync':
|
||||
gameLog.timestamp = args[0];
|
||||
break;
|
||||
|
||||
case 'vrcx':
|
||||
gameLog.data = args[0];
|
||||
break;
|
||||
|
||||
case 'api-request':
|
||||
gameLog.url = args[0];
|
||||
break;
|
||||
|
||||
case 'avatar-change':
|
||||
gameLog.displayName = args[0];
|
||||
gameLog.avatarName = args[1];
|
||||
break;
|
||||
|
||||
case 'photon-id':
|
||||
gameLog.displayName = args[0];
|
||||
gameLog.photonId = args[1];
|
||||
break;
|
||||
|
||||
case 'screenshot':
|
||||
gameLog.screenshotPath = args[0];
|
||||
break;
|
||||
|
||||
case 'vrc-quit':
|
||||
break;
|
||||
|
||||
case 'openvr-init':
|
||||
break;
|
||||
|
||||
case 'desktop-mode':
|
||||
break;
|
||||
|
||||
case 'udon-exception':
|
||||
gameLog.data = args[0];
|
||||
break;
|
||||
|
||||
case 'sticker-spawn':
|
||||
gameLog.userId = args[0];
|
||||
gameLog.displayName = args[1];
|
||||
gameLog.fileId = args[2];
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return gameLog;
|
||||
}
|
||||
|
||||
async getAll() {
|
||||
var gameLogs = [];
|
||||
var done = false;
|
||||
while (!done) {
|
||||
var rawGameLogs = await LogWatcher.Get();
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
for (var [fileName, dt, type, ...args] of rawGameLogs) {
|
||||
var gameLog = this.parseRawGameLog(dt, type, args);
|
||||
gameLogs.push(gameLog);
|
||||
}
|
||||
if (rawGameLogs.length === 0) {
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
return gameLogs;
|
||||
}
|
||||
|
||||
async setDateTill(dateTill) {
|
||||
await LogWatcher.SetDateTill(dateTill);
|
||||
}
|
||||
|
||||
async reset() {
|
||||
await LogWatcher.Reset();
|
||||
}
|
||||
}
|
||||
|
||||
var self = new GameLogService();
|
||||
window.gameLogService = self;
|
||||
|
||||
export { self as default, GameLogService as LogWatcherService };
|
||||
Reference in New Issue
Block a user