mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Attempt 2 at instance timers, API incorrectly reporting users as active
trash fix for a trash bug
This commit is contained in:
+12
-3
@@ -3223,6 +3223,7 @@ speechSynthesis.getVoices();
|
|||||||
userId: content.userId
|
userId: content.userId
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$app.APILastOnline.set(content.userId, Date.now());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'friend-active':
|
case 'friend-active':
|
||||||
@@ -3668,6 +3669,8 @@ speechSynthesis.getVoices();
|
|||||||
|
|
||||||
$app.data.debug = false;
|
$app.data.debug = false;
|
||||||
|
|
||||||
|
$app.data.APILastOnline = new Map();
|
||||||
|
|
||||||
$app.data.sharedFeed = {
|
$app.data.sharedFeed = {
|
||||||
gameLog: {
|
gameLog: {
|
||||||
wrist: [],
|
wrist: [],
|
||||||
@@ -4928,7 +4931,7 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.updateFriend = function (id, state, origin) {
|
$app.methods.updateFriend = async function (id, state, origin) {
|
||||||
var ctx = this.friends.get(id);
|
var ctx = this.friends.get(id);
|
||||||
if (typeof ctx === 'undefined') {
|
if (typeof ctx === 'undefined') {
|
||||||
return;
|
return;
|
||||||
@@ -5004,8 +5007,14 @@ speechSynthesis.getVoices();
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ctx.state === 'online' && ref.state === 'active' && state === 'active') {
|
if (ctx.state === 'online' && state === 'active') {
|
||||||
return;
|
await new Promise(resolve => setTimeout(resolve, 50000));
|
||||||
|
if (this.APILastOnline.has(id)) {
|
||||||
|
var date = this.APILastOnline.get(id);
|
||||||
|
if (date > Date.now() - 60000) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (ctx.state === 'online') {
|
if (ctx.state === 'online') {
|
||||||
if (ctx.isVIP) {
|
if (ctx.isVIP) {
|
||||||
|
|||||||
Reference in New Issue
Block a user