mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Woah, another user state bug
This commit is contained in:
@@ -329,8 +329,13 @@ speechSynthesis.getVoices();
|
|||||||
console.error('API.$on(USER) invalid args', args);
|
console.error('API.$on(USER) invalid args', args);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$app.updateFriend({ id: args.json.id, state: args.json.state }); // online/offline
|
if (args.json.state === 'online') {
|
||||||
args.ref = this.applyUser(args.json); // GPS
|
args.ref = this.applyUser(args.json); // GPS
|
||||||
|
$app.updateFriend({ id: args.json.id, state: args.json.state }); // online/offline
|
||||||
|
} else {
|
||||||
|
$app.updateFriend({ id: args.json.id, state: args.json.state }); // online/offline
|
||||||
|
args.ref = this.applyUser(args.json); // GPS
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
API.$on('USER:LIST', function (args) {
|
API.$on('USER:LIST', function (args) {
|
||||||
@@ -487,6 +492,7 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
if (typeof ref === 'undefined') {
|
if (typeof ref === 'undefined') {
|
||||||
ref = {
|
ref = {
|
||||||
|
ageVerificationStatus: '',
|
||||||
allowAvatarCopying: false,
|
allowAvatarCopying: false,
|
||||||
badges: [],
|
badges: [],
|
||||||
bio: '',
|
bio: '',
|
||||||
|
|||||||
@@ -195,6 +195,8 @@ export default class extends baseClass {
|
|||||||
accountDeletionDate: null,
|
accountDeletionDate: null,
|
||||||
accountDeletionLog: null,
|
accountDeletionLog: null,
|
||||||
activeFriends: [],
|
activeFriends: [],
|
||||||
|
ageVerificationStatus: '',
|
||||||
|
ageVerified: false,
|
||||||
allowAvatarCopying: false,
|
allowAvatarCopying: false,
|
||||||
badges: [],
|
badges: [],
|
||||||
bio: '',
|
bio: '',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as workerTimers from 'worker-timers';
|
import * as workerTimers from 'worker-timers';
|
||||||
import Noty from 'noty';
|
import Noty from 'noty';
|
||||||
import { baseClass, $app, API, $t } from './baseClass.js';
|
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
||||||
|
|
||||||
export default class extends baseClass {
|
export default class extends baseClass {
|
||||||
constructor(_app, _API, _t) {
|
constructor(_app, _API, _t) {
|
||||||
@@ -262,12 +262,28 @@ export default class extends baseClass {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'friend-online':
|
case 'friend-online':
|
||||||
|
// Where is instanceId, travelingToWorld, travelingToInstance?
|
||||||
|
// More JANK, what a mess
|
||||||
|
var $location = $utils.parseLocation(content.location);
|
||||||
|
var $travelingToLocation = $utils.parseLocation(
|
||||||
|
content.travelingToLocation
|
||||||
|
);
|
||||||
if (content?.user?.id) {
|
if (content?.user?.id) {
|
||||||
this.$emit('USER', {
|
this.$emit('USER', {
|
||||||
json: {
|
json: {
|
||||||
|
id: content.userId,
|
||||||
|
platform: content.platform,
|
||||||
|
state: 'online',
|
||||||
|
|
||||||
location: content.location,
|
location: content.location,
|
||||||
|
worldId: content.worldId,
|
||||||
|
instanceId: $location.instanceId,
|
||||||
travelingToLocation:
|
travelingToLocation:
|
||||||
content.travelingToLocation,
|
content.travelingToLocation,
|
||||||
|
travelingToWorld: $travelingToLocation.worldId,
|
||||||
|
travelingToInstance:
|
||||||
|
$travelingToLocation.instanceId,
|
||||||
|
|
||||||
...content.user
|
...content.user
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
@@ -288,13 +304,6 @@ export default class extends baseClass {
|
|||||||
|
|
||||||
case 'friend-active':
|
case 'friend-active':
|
||||||
if (content?.user?.id) {
|
if (content?.user?.id) {
|
||||||
this.$emit('USER', {
|
|
||||||
json: content.user,
|
|
||||||
params: {
|
|
||||||
userId: content.userId
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.$emit('USER', {
|
this.$emit('USER', {
|
||||||
json: {
|
json: {
|
||||||
id: content.userId,
|
id: content.userId,
|
||||||
@@ -306,7 +315,18 @@ export default class extends baseClass {
|
|||||||
instanceId: 'offline',
|
instanceId: 'offline',
|
||||||
travelingToLocation: 'offline',
|
travelingToLocation: 'offline',
|
||||||
travelingToWorld: 'offline',
|
travelingToWorld: 'offline',
|
||||||
travelingToInstance: 'offline'
|
travelingToInstance: 'offline',
|
||||||
|
|
||||||
|
...content.user
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
userId: content.userId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$emit('FRIEND:STATE', {
|
||||||
|
json: {
|
||||||
|
state: 'active'
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
userId: content.userId
|
userId: content.userId
|
||||||
@@ -346,6 +366,10 @@ export default class extends baseClass {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'friend-location':
|
case 'friend-location':
|
||||||
|
var $location = $utils.parseLocation(content.location);
|
||||||
|
var $travelingToLocation = $utils.parseLocation(
|
||||||
|
content.travelingToLocation
|
||||||
|
);
|
||||||
if (!content?.user?.id) {
|
if (!content?.user?.id) {
|
||||||
var ref = this.cachedUsers.get(content.userId);
|
var ref = this.cachedUsers.get(content.userId);
|
||||||
if (typeof ref !== 'undefined') {
|
if (typeof ref !== 'undefined') {
|
||||||
@@ -353,8 +377,14 @@ export default class extends baseClass {
|
|||||||
json: {
|
json: {
|
||||||
...ref,
|
...ref,
|
||||||
location: content.location,
|
location: content.location,
|
||||||
|
worldId: content.worldId,
|
||||||
|
instanceId: $location.instanceId,
|
||||||
travelingToLocation:
|
travelingToLocation:
|
||||||
content.travelingToLocation
|
content.travelingToLocation,
|
||||||
|
travelingToWorld:
|
||||||
|
$travelingToLocation.worldId,
|
||||||
|
travelingToInstance:
|
||||||
|
$travelingToLocation.instanceId
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
userId: content.userId
|
userId: content.userId
|
||||||
@@ -366,7 +396,12 @@ export default class extends baseClass {
|
|||||||
this.$emit('USER', {
|
this.$emit('USER', {
|
||||||
json: {
|
json: {
|
||||||
location: content.location,
|
location: content.location,
|
||||||
|
worldId: content.worldId,
|
||||||
|
instanceId: $location.instanceId,
|
||||||
travelingToLocation: content.travelingToLocation,
|
travelingToLocation: content.travelingToLocation,
|
||||||
|
travelingToWorld: $travelingToLocation.worldId,
|
||||||
|
travelingToInstance:
|
||||||
|
$travelingToLocation.instanceId,
|
||||||
...content.user,
|
...content.user,
|
||||||
state: 'online' // JANK
|
state: 'online' // JANK
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user