mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 22:33:50 +02:00
ok maybe not
This commit is contained in:
@@ -1390,19 +1390,16 @@ speechSynthesis.getVoices();
|
|||||||
n: 50,
|
n: 50,
|
||||||
offset: 0
|
offset: 0
|
||||||
};
|
};
|
||||||
|
// API offset limit is 5000
|
||||||
mainLoop: for (var i = 100; i > -1; i--) {
|
mainLoop: for (var i = 100; i > -1; i--) {
|
||||||
if (params.offset > 5000) {
|
|
||||||
// API offset limit is 5000
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
retryLoop: for (var j = 0; j < 10; j++) {
|
retryLoop: for (var j = 0; j < 10; j++) {
|
||||||
// handle 429 ratelimit error, retry 10 times
|
// handle 429 ratelimit error, retry 10 times
|
||||||
try {
|
try {
|
||||||
var args = await this.getFriends(params);
|
var args = await this.getFriends(params);
|
||||||
friends = friends.concat(args.json);
|
if (!args.json || args.json.length === 0) {
|
||||||
if (!args.json || args.json.length < 50) {
|
|
||||||
break mainLoop;
|
break mainLoop;
|
||||||
}
|
}
|
||||||
|
friends = friends.concat(args.json);
|
||||||
break retryLoop;
|
break retryLoop;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
@@ -1414,9 +1411,6 @@ speechSynthesis.getVoices();
|
|||||||
console.error('Awful workaround for awful VRC API bug');
|
console.error('Awful workaround for awful VRC API bug');
|
||||||
break retryLoop;
|
break retryLoop;
|
||||||
}
|
}
|
||||||
if (j === 9) {
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
await new Promise((resolve) => {
|
await new Promise((resolve) => {
|
||||||
workerTimers.setTimeout(resolve, 5000);
|
workerTimers.setTimeout(resolve, 5000);
|
||||||
});
|
});
|
||||||
@@ -4557,7 +4551,10 @@ speechSynthesis.getVoices();
|
|||||||
console.log(
|
console.log(
|
||||||
`${ctx.name} updateFriendState ${ctx.state} -> ${newState}`
|
`${ctx.name} updateFriendState ${ctx.state} -> ${newState}`
|
||||||
);
|
);
|
||||||
if (location !== ctx.ref?.location) {
|
if (
|
||||||
|
typeof ctx.ref !== 'undefined' &&
|
||||||
|
location !== ctx.ref.location
|
||||||
|
) {
|
||||||
console.log(
|
console.log(
|
||||||
`${ctx.name} pendingOfflineLocation ${location} -> ${ctx.ref.location}`
|
`${ctx.name} pendingOfflineLocation ${location} -> ${ctx.ref.location}`
|
||||||
);
|
);
|
||||||
@@ -4602,14 +4599,14 @@ speechSynthesis.getVoices();
|
|||||||
ctx.ref.$online_for = Date.now();
|
ctx.ref.$online_for = Date.now();
|
||||||
ctx.ref.$offline_for = '';
|
ctx.ref.$offline_for = '';
|
||||||
ctx.ref.$active_for = '';
|
ctx.ref.$active_for = '';
|
||||||
var worldName = await this.getWorldName(ref.location);
|
var worldName = await this.getWorldName(location);
|
||||||
var groupName = await this.getGroupName(location);
|
var groupName = await this.getGroupName(location);
|
||||||
var feed = {
|
var feed = {
|
||||||
created_at: new Date().toJSON(),
|
created_at: new Date().toJSON(),
|
||||||
type: 'Online',
|
type: 'Online',
|
||||||
userId: id,
|
userId: id,
|
||||||
displayName: ctx.name,
|
displayName: ctx.name,
|
||||||
location: ref.location,
|
location,
|
||||||
worldName,
|
worldName,
|
||||||
groupName,
|
groupName,
|
||||||
time: ''
|
time: ''
|
||||||
|
|||||||
Reference in New Issue
Block a user