mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 22:33:50 +02:00
Attempt 2 at instance timers, API incorrectly reporting users as active
trash fix for a trash bug
This commit is contained in:
@@ -3223,6 +3223,7 @@ speechSynthesis.getVoices();
|
||||
userId: content.userId
|
||||
}
|
||||
});
|
||||
$app.APILastOnline.set(content.userId, Date.now());
|
||||
break;
|
||||
|
||||
case 'friend-active':
|
||||
@@ -3668,6 +3669,8 @@ speechSynthesis.getVoices();
|
||||
|
||||
$app.data.debug = false;
|
||||
|
||||
$app.data.APILastOnline = new Map();
|
||||
|
||||
$app.data.sharedFeed = {
|
||||
gameLog: {
|
||||
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);
|
||||
if (typeof ctx === 'undefined') {
|
||||
return;
|
||||
@@ -5004,8 +5007,14 @@ speechSynthesis.getVoices();
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (ctx.state === 'online' && ref.state === 'active' && state === 'active') {
|
||||
return;
|
||||
if (ctx.state === 'online' && state === 'active') {
|
||||
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.isVIP) {
|
||||
|
||||
Reference in New Issue
Block a user