This commit is contained in:
Natsumi
2023-01-17 22:09:29 +13:00
parent 4c1faa66ce
commit b92a7f6751
5 changed files with 98 additions and 29 deletions

View File

@@ -1186,6 +1186,17 @@ speechSynthesis.getVoices();
API.$on('USER:CURRENT', function (args) {
var {json} = args;
args.ref = this.applyCurrentUser(json);
var location = '';
var travelingToLocation = '';
if (json.presence?.world && $app.isRealInstance(json.presence.world)) {
location = `${json.presence.world}:${json.presence.instance}`;
}
if (
json.presence?.travelingToWorld &&
$app.isRealInstance(json.presence.travelingToWorld)
) {
travelingToLocation = `${json.presence.travelingToWorld}:${json.presence.travelingToInstance}`;
}
this.applyUser({
id: json.id,
displayName: json.displayName,
@@ -1207,10 +1218,14 @@ speechSynthesis.getVoices();
fallbackAvatar: json.fallbackAvatar,
profilePicOverride: json.profilePicOverride,
isFriend: false,
location: json.location,
travelingToInstance: json.travelingToInstance,
travelingToLocation: json.travelingToLocation,
travelingToWorld: json.travelingToWorld
// Presence
location,
travelingToLocation,
instanceId: json.presence?.instance,
worldId: json.presence?.world,
travelingToInstance: json.presence?.travelingToInstance,
travelingToWorld: json.presence?.travelingToWorld
});
});
@@ -1451,6 +1466,7 @@ speechSynthesis.getVoices();
username: '',
displayName: '',
userIcon: '',
profilePicOverride: '',
bio: '',
bioLinks: [],
pastDisplayNames: [],
@@ -1459,6 +1475,7 @@ speechSynthesis.getVoices();
currentAvatarThumbnailImageUrl: '',
currentAvatar: '',
currentAvatarAssetUrl: '',
fallbackAvatar: '',
homeLocation: '',
twoFactorAuthEnabled: false,
status: '',
@@ -1474,9 +1491,22 @@ speechSynthesis.getVoices();
onlineFriends: [],
activeFriends: [],
offlineFriends: [],
travelingToInstance: '',
travelingToLocation: '',
travelingToWorld: '',
presence: {
avatarThumbnail: '',
displayName: '',
groups: [],
id: '',
instance: '',
instanceType: '',
isRejoining: '0',
platform: '',
profilePicOverride: '',
status: '',
travelingToInstance: '',
travelingToWorld: '',
world: '',
...json.presence
},
// VRCX
$online_for: Date.now(),
$offline_for: '',
@@ -1592,10 +1622,12 @@ speechSynthesis.getVoices();
id: '',
displayName: '',
userIcon: '',
profilePicOverride: '',
bio: '',
bioLinks: [],
currentAvatarImageUrl: '',
currentAvatarThumbnailImageUrl: '',
fallbackAvatar: '',
status: '',
statusDescription: '',
state: '',
@@ -5679,7 +5711,7 @@ speechSynthesis.getVoices();
if (noty.thumbnailImageUrl) {
imageUrl = noty.thumbnailImageUrl;
} else if (noty.details && noty.details.imageUrl) {
imageUrl = noty.details.imageURL;
imageUrl = noty.details.imageUrl;
} else if (noty.imageUrl) {
imageUrl = noty.imageUrl;
} else if (userId) {
@@ -7615,7 +7647,7 @@ speechSynthesis.getVoices();
);
}
var newRef = args.ref;
if (ctx.state !== newState && ctx.ref !== 'undefined') {
if (ctx.state !== newState && typeof ctx.ref !== 'undefined') {
if (
(newState === 'offline' || newState === 'active') &&
ctx.state === 'online'
@@ -9784,7 +9816,7 @@ speechSynthesis.getVoices();
showGroupBadgeToOthers: user.showGroupBadgeToOthers,
showSocialRank: user.showSocialRank
});
this.photonUserJoin(id, user.avatarDict, gameLogDate);
this.photonUserJoin(id, user, gameLogDate);
}
} else {
console.log('oldSetUserProps', data);
@@ -9821,7 +9853,7 @@ speechSynthesis.getVoices();
user.user.showGroupBadgeToOthers,
showSocialRank: user.user.showSocialRank
});
this.photonUserJoin(id, user.avatarDict, gameLogDate);
this.photonUserJoin(id, user, gameLogDate);
}
break;
case 42:
@@ -9904,7 +9936,7 @@ speechSynthesis.getVoices();
});
this.photonUserJoin(
data.Parameters[254],
data.Parameters[249].avatarDict,
data.Parameters[249],
gameLogDate
);
this.checkPhotonBotJoin(
@@ -10442,10 +10474,19 @@ speechSynthesis.getVoices();
this.photonLobbyUserData.set(photonId, photonUser);
};
$app.methods.photonUserJoin = function (photonId, avatar, gameLogDate) {
$app.methods.photonUserJoin = function (photonId, user, gameLogDate) {
if (photonId === this.photonLobbyCurrentUser) {
return;
}
var avatar = user.avatarDict;
var platform = '';
if (user.last_platform === 'android') {
platform = 'Quest';
} else if (user.inVRMode) {
platform = 'VR';
} else {
platform = 'Desktop';
}
this.checkVRChatCache(avatar).then((cacheInfo) => {
var inCache = false;
if (cacheInfo[0] > 0) {
@@ -10457,7 +10498,8 @@ speechSynthesis.getVoices();
type: 'OnPlayerJoined',
created_at: gameLogDate,
avatar,
inCache
inCache,
platform
});
});
};
@@ -10620,6 +10662,7 @@ speechSynthesis.getVoices();
}
var {groupOnNameplate} = this.photonLobbyJointime.get(photonId);
if (
groupOnNameplate &&
groupOnNameplate !== groupId &&
photonId !== this.photonLobbyCurrentUser
) {
@@ -15643,6 +15686,10 @@ speechSynthesis.getVoices();
$app.methods.refreshUserDialogTreeData = function () {
var D = this.userDialog;
if (D.id === API.currentUser.id) {
D.treeData = buildTreeData(API.currentUser);
return;
}
D.treeData = buildTreeData(D.ref);
};
@@ -20154,7 +20201,7 @@ speechSynthesis.getVoices();
workerTimers.setTimeout(() => this.restartVRCX(), 2000);
} else {
this.downloadDialog.visible = false;
this.pendingVRCXUpdate = this.downloadCurrent.ref.name;
this.pendingVRCXInstall = this.downloadCurrent.ref.name;
this.showVRCXUpdateDialog();
}
}
@@ -20765,7 +20812,8 @@ speechSynthesis.getVoices();
};
$app.data.checkingForVRCXUpdate = false;
$app.data.pendingVRCXUpdate = '';
$app.data.pendingVRCXInstall = '';
$app.data.pendingVRCXUpdate = false;
$app.data.branches = {
Stable: {
@@ -20893,7 +20941,7 @@ speechSynthesis.getVoices();
D.releases = releases;
D.release = json[0].name;
this.VRCXUpdateDialog.updatePendingIsLatest = false;
if (D.release === this.pendingVRCXUpdate) {
if (D.release === this.pendingVRCXInstall) {
// update already downloaded and latest version
this.VRCXUpdateDialog.updatePendingIsLatest = true;
}
@@ -20903,6 +20951,9 @@ speechSynthesis.getVoices();
};
$app.methods.saveAutoUpdateVRCX = function () {
if (this.autoUpdateVRCX === 'Off') {
this.pendingVRCXUpdate = false;
}
configRepository.setString('VRCX_autoUpdateVRCX', this.autoUpdateVRCX);
};
@@ -20925,6 +20976,7 @@ speechSynthesis.getVoices();
url,
method: 'GET'
});
this.pendingVRCXUpdate = false;
this.checkingForVRCXUpdate = false;
var json = JSON.parse(response.data);
if (this.debugWebRequests) {
@@ -20934,7 +20986,7 @@ speechSynthesis.getVoices();
this.latestAppVersion = json.name;
var name = json.name;
this.VRCXUpdateDialog.updatePendingIsLatest = false;
if (name === this.pendingVRCXUpdate) {
if (name === this.pendingVRCXInstall) {
// update already downloaded
this.VRCXUpdateDialog.updatePendingIsLatest = true;
} else if (name > this.appVersion) {
@@ -20953,12 +21005,13 @@ speechSynthesis.getVoices();
if (!downloadUrl) {
return;
}
this.pendingVRCXUpdate = true;
this.notifyMenu('settings');
var type = 'Auto';
if (!API.isLoggedIn) {
this.showVRCXUpdateDialog();
} else if (this.autoUpdateVRCX === 'Notify') {
this.showVRCXUpdateDialog();
// this.showVRCXUpdateDialog();
} else if (this.autoUpdateVRCX === 'Auto Download') {
var autoInstall = false;
this.downloadVRCXUpdate(