Fixes for traveling

This commit is contained in:
Natsumi
2022-07-27 19:02:39 +12:00
parent e2cb10fd8c
commit 0fd7329f18
+28 -3
View File
@@ -1350,6 +1350,9 @@ speechSynthesis.getVoices();
onlineFriends: [], onlineFriends: [],
activeFriends: [], activeFriends: [],
offlineFriends: [], offlineFriends: [],
travelingToInstance: '',
travelingToLocation: '',
travelingToWorld: '',
// VRCX // VRCX
$homeLocation: {}, $homeLocation: {},
$isVRCPlus: false, $isVRCPlus: false,
@@ -1360,6 +1363,7 @@ speechSynthesis.getVoices();
$userColour: '', $userColour: '',
$trustSortNum: 1, $trustSortNum: 1,
$languages: [], $languages: [],
$previousLocation: '',
// //
...json ...json
}; };
@@ -1480,6 +1484,9 @@ speechSynthesis.getVoices();
location: '', location: '',
worldId: '', worldId: '',
instanceId: '', instanceId: '',
travelingToInstance: '',
travelingToLocation: '',
travelingToWorld: '',
// VRCX // VRCX
$location: {}, $location: {},
$location_at: Date.now(), $location_at: Date.now(),
@@ -1497,6 +1504,7 @@ speechSynthesis.getVoices();
$timeSpent: 0, $timeSpent: 0,
$lastSeen: '', $lastSeen: '',
$nickName: '', $nickName: '',
$previousLocation: '',
// //
...json ...json
}; };
@@ -1548,7 +1556,7 @@ speechSynthesis.getVoices();
// FIXME // FIXME
// if the status is offline, just ignore status and statusDescription only. // if the status is offline, just ignore status and statusDescription only.
if (has && ref.status !== 'offline' && $ref.status !== 'offline') { if (has && ref.status !== 'offline' && $ref.status !== 'offline') {
if (props.location) { if (props.location && props.location[0] !== 'traveling') {
var ts = Date.now(); var ts = Date.now();
props.location.push(ts - ref.$location_at); props.location.push(ts - ref.$location_at);
ref.$location_at = ts; ref.$location_at = ts;
@@ -3791,6 +3799,7 @@ speechSynthesis.getVoices();
this.$emit('USER', { this.$emit('USER', {
json: { json: {
location: content.location, location: content.location,
travelingToLocation: content.travelingToLocation,
...content.user ...content.user
}, },
params: { params: {
@@ -3864,6 +3873,7 @@ speechSynthesis.getVoices();
this.$emit('USER', { this.$emit('USER', {
json: { json: {
location: content.location, location: content.location,
travelingToLocation: content.travelingToLocation,
...content.user ...content.user
}, },
params: { params: {
@@ -7583,8 +7593,14 @@ speechSynthesis.getVoices();
props.location[0] !== 'offline' && props.location[0] !== 'offline' &&
props.location[0] !== '' && props.location[0] !== '' &&
props.location[1] !== 'offline' && props.location[1] !== 'offline' &&
props.location[1] !== '' props.location[1] !== '' &&
props.location[0] !== 'traveling'
) { ) {
// skip GPS if user is offline or traveling
var previousLocation = props.location[1];
if (previousLocation === 'traveling') {
previousLocation = ref.$previousLocation;
}
var worldName = await $app.getWorldName(props.location[0]); var worldName = await $app.getWorldName(props.location[0]);
var feed = { var feed = {
created_at: new Date().toJSON(), created_at: new Date().toJSON(),
@@ -7593,13 +7609,22 @@ speechSynthesis.getVoices();
displayName: ref.displayName, displayName: ref.displayName,
location: props.location[0], location: props.location[0],
worldName, worldName,
previousLocation: props.location[1], previousLocation,
time: props.location[2] time: props.location[2]
}; };
$app.addFeed(feed); $app.addFeed(feed);
database.addGPSToDatabase(feed); database.addGPSToDatabase(feed);
$app.updateFriendGPS(ref.id); $app.updateFriendGPS(ref.id);
} }
if (
props.location &&
props.location[0] === 'traveling' &&
props.location[1] !== 'traveling'
) {
// store previous location when user is traveling
ref.$previousLocation = props.location[1];
$app.updateFriendGPS(ref.id);
}
if ( if (
(props.currentAvatarImageUrl || (props.currentAvatarImageUrl ||
props.currentAvatarThumbnailImageUrl) && props.currentAvatarThumbnailImageUrl) &&