Skip to content

Commit

Permalink
Changes and fixes
Browse files Browse the repository at this point in the history
Remove nonce (rip)
Current instance avatar change on wrist feed
Ignore non-standard unity package variants
Remove GPUFix
  • Loading branch information
Natsumi-sama committed Nov 13, 2023
1 parent 25f47f9 commit 7bb5c8e
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 45 deletions.
29 changes: 28 additions & 1 deletion Dotnet/LogWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ out var lineDate
ParseLogPortalSpawn(fileInfo, logContext, line, offset) ||
ParseLogNotification(fileInfo, logContext, line, offset) ||
ParseLogAPIRequest(fileInfo, logContext, line, offset) ||
ParseLogAvatarChange(fileInfo, logContext, line, offset) ||
ParseLogJoinBlocked(fileInfo, logContext, line, offset) ||
ParseLogAvatarPedestalChange(fileInfo, logContext, line, offset) ||
ParseLogVideoError(fileInfo, logContext, line, offset) ||
Expand Down Expand Up @@ -797,7 +798,33 @@ private bool ParseLogAPIRequest(FileInfo fileInfo, LogContext logContext, string

return true;
}
//

private bool ParseLogAvatarChange(FileInfo fileInfo, LogContext logContext, string line, int offset)
{
// 2023.11.05 14:45:57 Log - [Behaviour] Switching K․MOG to avatar MoeSera

if (string.Compare(line, offset, "[Behaviour] Switching ", 0, 22, StringComparison.Ordinal) != 0)
return false;

var pos = line.LastIndexOf(" to avatar ");
if (pos < 0)
return false;

var displayName = line.Substring(offset + 22, pos - (offset + 22));
var avatarName = line.Substring(pos + 11);

AppendLog(new[]
{
fileInfo.Name,
ConvertLogTimeToISO8601(line),
"avatar-change",
displayName,
avatarName
});

return true;
}

// private bool ParseLogPhotonId(FileInfo fileInfo, LogContext logContext, string line, int offset)
// {
// // 2021.11.02 02:21:41 Log - [Behaviour] Configuring remote player VRCPlayer[Remote] 22349737 1194
Expand Down
95 changes: 75 additions & 20 deletions html/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2593,7 +2593,6 @@ speechSynthesis.getVoices();
secureName: '',
shortName: '',
world: {},
nonce: '',
users: [], // only present when you're the owner
clientNumber: '',
photonRegion: '',
Expand Down Expand Up @@ -9249,7 +9248,8 @@ speechSynthesis.getVoices();
var userMap = {
displayName: ctx.displayName,
userId: ctx.userId,
joinTime: Date.parse(ctx.created_at)
joinTime: Date.parse(ctx.created_at),
lastAvatar: ''
};
this.lastLocation.playerList.set(ctx.displayName, userMap);
if (this.friends.has(ctx.userId)) {
Expand Down Expand Up @@ -9967,7 +9967,8 @@ speechSynthesis.getVoices();
var userMap = {
displayName: gameLog.displayName,
userId,
joinTime
joinTime,
lastAvatar: ''
};
this.lastLocation.playerList.set(gameLog.displayName, userMap);
if (userId) {
Expand Down Expand Up @@ -10024,16 +10025,13 @@ speechSynthesis.getVoices();
database.addGamelogJoinLeaveToDatabase(entry);
break;
case 'player-left':
if (!this.lastLocation.playerList.has(gameLog.displayName)) {
break;
}
var time = 0;
var ref = this.lastLocation.playerList.get(gameLog.displayName);
if (typeof ref !== 'undefined') {
time = Date.now() - ref.joinTime;
this.lastLocation.playerList.delete(gameLog.displayName);
this.lastLocation.friendList.delete(gameLog.displayName);
if (typeof ref === 'undefined') {
break;
}
var time = Date.now() - ref.joinTime;
this.lastLocation.playerList.delete(gameLog.displayName);
this.lastLocation.friendList.delete(gameLog.displayName);
this.photonLobbyAvatars.delete(userId);
this.updateVRLastLocation();
this.getCurrentInstanceUserList();
Expand Down Expand Up @@ -10167,6 +10165,30 @@ speechSynthesis.getVoices();
}
}
break;
case 'avatar-change':
var ref = this.lastLocation.playerList.get(gameLog.displayName);
if (
this.photonLoggingEnabled ||
typeof ref === 'undefined' ||
ref.lastAvatar === gameLog.avatarName
) {
break;
}
if (!ref.lastAvatar) {
ref.lastAvatar = gameLog.avatarName;
this.lastLocation.playerList.set(gameLog.displayName, ref);
break;
}
ref.lastAvatar = gameLog.avatarName;
this.lastLocation.playerList.set(gameLog.displayName, ref);
var entry = {
created_at: gameLog.dt,
type: 'AvatarChange',
userId,
name: gameLog.avatarName,
displayName: gameLog.displayName
};
break;
case 'vrcx':
// 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(' '));
Expand Down Expand Up @@ -10279,7 +10301,11 @@ speechSynthesis.getVoices();

$app.methods.silentSeachUser = function (displayName) {
var playerListRef = this.lastLocation.playerList.get(displayName);
if (!this.gameLogApiLoggingEnabled || playerListRef.userId) {
if (
!this.gameLogApiLoggingEnabled ||
!playerListRef ||
playerListRef.userId
) {
return;
}
if (this.debugGameLog) {
Expand Down Expand Up @@ -11870,6 +11896,12 @@ speechSynthesis.getVoices();
}
if (!avatar.assetUrl && unityPackages.length > 0) {
for (var unityPackage of unityPackages) {
if (
unityPackage.variant &&
unityPackage.variant !== 'standard'
) {
continue;
}
if (unityPackage.platform === 'standalonewindows') {
avatar.assetUrl = unityPackage.assetUrl;
}
Expand Down Expand Up @@ -14524,16 +14556,12 @@ speechSynthesis.getVoices();
);
$app.data.isStartAsMinimizedState = false;
$app.data.isCloseToTray = false;
$app.data.gpuFix = false;
VRCXStorage.Get('VRCX_StartAsMinimizedState').then((result) => {
$app.isStartAsMinimizedState = result === 'true';
});
VRCXStorage.Get('VRCX_CloseToTray').then((result) => {
$app.isCloseToTray = result === 'true';
});
VRCXStorage.Get('VRCX_GPUFix').then((result) => {
$app.gpuFix = result === 'true';
});
if (configRepository.getBool('VRCX_CloseToTray')) {
// move back to JSON
$app.data.isCloseToTray = configRepository.getBool('VRCX_CloseToTray');
Expand All @@ -14550,7 +14578,6 @@ speechSynthesis.getVoices();
this.isStartAsMinimizedState.toString()
);
VRCXStorage.Set('VRCX_CloseToTray', this.isCloseToTray.toString());
VRCXStorage.Set('VRCX_GPUFix', this.gpuFix.toString());
AppApi.SetStartup(this.isStartAtWindowsStartup);
};
$app.data.photonEventOverlay = configRepository.getBool(
Expand Down Expand Up @@ -16918,6 +16945,12 @@ speechSynthesis.getVoices();
var isIos = false;
if (typeof unityPackages === 'object') {
for (var unityPackage of unityPackages) {
if (
unityPackage.variant &&
unityPackage.variant !== 'standard'
) {
continue;
}
if (unityPackage.platform === 'standalonewindows') {
isPC = true;
} else if (unityPackage.platform === 'android') {
Expand Down Expand Up @@ -17541,6 +17574,9 @@ speechSynthesis.getVoices();
var fileSize = '';
for (let i = ref.unityPackages.length - 1; i > -1; i--) {
var unityPackage = ref.unityPackages[i];
if (unityPackage.variant && unityPackage.variant !== 'standard') {
continue;
}
if (
unityPackage.platform === 'standalonewindows' &&
this.compareUnityVersion(unityPackage.unityVersion)
Expand Down Expand Up @@ -18298,6 +18334,7 @@ speechSynthesis.getVoices();
if (
!assetUrl &&
unityPackage.platform === 'standalonewindows' &&
unityPackage.variant === 'standard' &&
this.compareUnityVersion(unityPackage.unityVersion)
) {
assetUrl = unityPackage.assetUrl;
Expand Down Expand Up @@ -18560,6 +18597,12 @@ speechSynthesis.getVoices();
var platforms = [];
if (ref.unityPackages) {
for (var unityPackage of ref.unityPackages) {
if (
unityPackage.variant &&
unityPackage.variant !== 'standard'
) {
continue;
}
var platform = 'PC';
if (unityPackage.platform === 'standalonewindows') {
platform = 'PC';
Expand Down Expand Up @@ -19032,9 +19075,6 @@ speechSynthesis.getVoices();
} else if (D.region === 'Japan') {
tags.push(`~region(jp)`);
}
if (D.accessType !== 'public' && D.accessType !== 'group') {
tags.push(`~nonce(${window.crypto.randomUUID()})`);
}
if (D.accessType !== 'invite' && D.accessType !== 'friends') {
D.strict = false;
}
Expand Down Expand Up @@ -22915,6 +22955,9 @@ speechSynthesis.getVoices();
var assetUrl = '';
for (var i = ref.unityPackages.length - 1; i > -1; i--) {
var unityPackage = ref.unityPackages[i];
if (unityPackage.variant && unityPackage.variant !== 'standard') {
continue;
}
if (
unityPackage.platform === 'standalonewindows' &&
this.compareUnityVersion(unityPackage.unityVersion)
Expand Down Expand Up @@ -23078,6 +23121,9 @@ speechSynthesis.getVoices();
var assetUrl = '';
for (var i = ref.unityPackages.length - 1; i > -1; i--) {
var unityPackage = ref.unityPackages[i];
if (unityPackage.variant && unityPackage.variant !== 'standard') {
continue;
}
if (
unityPackage.platform === 'standalonewindows' &&
this.compareUnityVersion(unityPackage.unityVersion)
Expand Down Expand Up @@ -23196,6 +23242,12 @@ speechSynthesis.getVoices();
var unityPackages = this.avatarDialog.ref.unityPackages;
for (let i = unityPackages.length - 1; i > -1; i--) {
var unityPackage = unityPackages[i];
if (
unityPackage.variant &&
unityPackage.variant !== 'standard'
) {
continue;
}
if (
unityPackage.platform === 'standalonewindows' &&
this.compareUnityVersion(unityPackage.unityVersion)
Expand Down Expand Up @@ -28685,6 +28737,9 @@ speechSynthesis.getVoices();
var assetUrl = '';
for (let i = D.ref.unityPackages.length - 1; i > -1; i--) {
var unityPackage = D.ref.unityPackages[i];
if (unityPackage.variant && unityPackage.variant !== 'standard') {
continue;
}
if (
unityPackage.platform === 'standalonewindows' &&
this.compareUnityVersion(unityPackage.unityVersion)
Expand Down
28 changes: 14 additions & 14 deletions html/src/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -1896,17 +1896,17 @@ html
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
.toggle-item
span.toggle-name Lobby Avatar Change
el-radio-group(v-model="sharedFeedFilters.noty.AvatarChange" size="mini")
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
template(v-if="photonLoggingEnabled")
br
.toggle-item
span.toggle-name Photon Event Logging
.toggle-item
span.toggle-name Lobby Avatar Change
el-radio-group(v-model="sharedFeedFilters.noty.AvatarChange" size="mini")
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
.toggle-item
span.toggle-name Lobby ChatBox Message
el-radio-group(v-model="sharedFeedFilters.noty.ChatBoxMessage" size="mini")
Expand Down Expand Up @@ -2118,17 +2118,17 @@ html
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
.toggle-item
span.toggle-name Lobby Avatar Change
el-radio-group(v-model="sharedFeedFilters.wrist.AvatarChange" size="mini")
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
template(v-if="photonLoggingEnabled")
br
.toggle-item
span.toggle-name Photon Event Logging
.toggle-item
span.toggle-name Lobby Avatar Change
el-radio-group(v-model="sharedFeedFilters.wrist.AvatarChange" size="mini")
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
.toggle-item
span.toggle-name Lobby ChatBox Message
el-radio-group(v-model="sharedFeedFilters.wrist.ChatBoxMessage" size="mini")
Expand Down
6 changes: 0 additions & 6 deletions html/src/mixins/tabs/settings.pug
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,6 @@ mixin settingsTab()
el-button-group(style="display:block")
el-button(size="small" icon="el-icon-s-operation" @click="promptSetPendingOffline") {{ $t('view.settings.advanced.advanced.pending_offline.set_delay') }}
+simpleSwitch("view.settings.advanced.advanced.cache_debug.udon_exception_logging", "udonExceptionLogging", "saveOpenVROption")
div.options-container-item
span.name {{ $t('view.settings.advanced.advanced.cache_debug.gpu_fix') }}
el-tooltip(placement="top" style="margin-left:5px" :content="$t('view.settings.advanced.advanced.cache_debug.gpu_fix_warning')")
i.el-icon-warning
el-switch(v-model="gpuFix" @change="saveVRCXWindowOption")
span.name(style="margin-left:15px") {{ $t('view.settings.advanced.advanced.cache_debug.gpu_fix_notice') }}
div.options-container-item
span.name {{ $t('view.settings.advanced.advanced.cache_debug.disable_gamelog') }}
el-switch(v-model="gameLogDisabled" @change="disableGameLogDialog")
Expand Down
5 changes: 5 additions & 0 deletions html/src/service/gamelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ class GameLogService {
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];
Expand Down
8 changes: 4 additions & 4 deletions html/src/vr.pug
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ html
span.time {{ feed.created_at | formatDate }}
| 🧍 #[span.name(v-text="feed.displayName" style="margin-right:5px" :style="{'color':feed.tagColour}")]
template(v-if="feed.releaseStatus === 'public'")
| #[i.x-user-status.online]
template(v-else)
| #[i.x-user-status.askme]
| {{ feed.name }}
| #[i.x-user-status.online]&nbsp;
template(v-else-if="feed.releaseStatus === 'private'")
| #[i.x-user-status.askme]&nbsp;
| {{ feed.name }}
template(v-if="feed.description && feed.description !== feed.name")
| - {{ feed.description }}
div(v-else-if="feed.type === 'ChatBoxMessage'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")
Expand Down

0 comments on commit 7bb5c8e

Please sign in to comment.