mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Handle currentUser websocket traveling
This commit is contained in:
+8
-3
@@ -19916,7 +19916,6 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.updateCurrentUserLocation = function () {
|
$app.methods.updateCurrentUserLocation = function () {
|
||||||
API.currentUser.$travelingToTime = this.lastLocationDestinationTime;
|
|
||||||
var ref = API.cachedUsers.get(API.currentUser.id);
|
var ref = API.cachedUsers.get(API.currentUser.id);
|
||||||
if (typeof ref === 'undefined') {
|
if (typeof ref === 'undefined') {
|
||||||
return;
|
return;
|
||||||
@@ -19924,7 +19923,8 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
|
|
||||||
// update cached user with both gameLog and API locations
|
// update cached user with both gameLog and API locations
|
||||||
var currentLocation = API.currentUser.$locationTag;
|
var currentLocation = API.currentUser.$locationTag;
|
||||||
if (API.currentUser.$location === 'traveling') {
|
var L = $utils.parseLocation(currentLocation);
|
||||||
|
if (L.isTraveling) {
|
||||||
currentLocation = API.currentUser.$travelingToLocation;
|
currentLocation = API.currentUser.$travelingToLocation;
|
||||||
}
|
}
|
||||||
ref.location = API.currentUser.$locationTag;
|
ref.location = API.currentUser.$locationTag;
|
||||||
@@ -19956,13 +19956,18 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
} else {
|
} else {
|
||||||
ref.$location_at = this.lastLocation.date;
|
ref.$location_at = this.lastLocation.date;
|
||||||
ref.$travelingToTime = this.lastLocationDestinationTime;
|
ref.$travelingToTime = this.lastLocationDestinationTime;
|
||||||
|
API.currentUser.$travelingToTime = this.lastLocationDestinationTime;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.setCurrentUserLocation = async function (location) {
|
$app.methods.setCurrentUserLocation = async function (
|
||||||
|
location,
|
||||||
|
travelingToLocation
|
||||||
|
) {
|
||||||
API.currentUser.$location_at = Date.now();
|
API.currentUser.$location_at = Date.now();
|
||||||
API.currentUser.$travelingToTime = Date.now();
|
API.currentUser.$travelingToTime = Date.now();
|
||||||
API.currentUser.$locationTag = location;
|
API.currentUser.$locationTag = location;
|
||||||
|
API.currentUser.$travelingToLocation = travelingToLocation;
|
||||||
this.updateCurrentUserLocation();
|
this.updateCurrentUserLocation();
|
||||||
|
|
||||||
// janky gameLog support for Quest
|
// janky gameLog support for Quest
|
||||||
|
|||||||
@@ -427,12 +427,15 @@ export default class extends baseClass {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// content.user: {}
|
// content.user: {} // we don't trust this
|
||||||
// content.world: {}
|
// content.world: {} // this is long gone
|
||||||
|
// content.worldId // where did worldId go?
|
||||||
|
// content.instance // without worldId, this is useless
|
||||||
|
|
||||||
this.currentUser.presence.instance = content.instance;
|
$app.setCurrentUserLocation(
|
||||||
this.currentUser.presence.world = content.worldId;
|
content.location,
|
||||||
$app.setCurrentUserLocation(content.location);
|
content.travelingToLocation
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'group-joined':
|
case 'group-joined':
|
||||||
|
|||||||
Reference in New Issue
Block a user