mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
onPlayerJoining changes
This commit is contained in:
+30
-9
@@ -3741,31 +3741,52 @@ speechSynthesis.getVoices();
|
|||||||
var feedTable = this.feedTable.data;
|
var feedTable = this.feedTable.data;
|
||||||
for (var i = feedTable.length - 1; i > -1; i--) {
|
for (var i = feedTable.length - 1; i > -1; i--) {
|
||||||
var ctx = feedTable[i];
|
var ctx = feedTable[i];
|
||||||
|
if (ctx.created_at < bias) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
if ((ctx.type === 'GPS') && (ctx.location[0] === this.lastLocation.location)) {
|
if ((ctx.type === 'GPS') && (ctx.location[0] === this.lastLocation.location)) {
|
||||||
if (joiningMap[ctx.displayName]) {
|
if (joiningMap[ctx.displayName]) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
joiningMap[ctx.displayName] = ctx.created_at;
|
||||||
|
if (API.cachedUsers.has(ctx.userId)) {
|
||||||
|
var user = API.cachedUsers.get(ctx.userId);
|
||||||
|
if (ctx.location[0] !== user.location) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
var joining = true;
|
var joining = true;
|
||||||
var playersInInstance = this.lastLocation.playerList;
|
var gameLogTable = this.gameLogTable.data;
|
||||||
if (!playersInInstance.includes(ctx.displayName)) {
|
for (var k = gameLogTable.length - 1; k > -1; k--) {
|
||||||
|
var gameLogItem = gameLogTable[k];
|
||||||
|
console.log(gameLogItem);
|
||||||
|
if (gameLogItem.type === 'Notification') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ((gameLogItem.type === 'Location') || (gameLogItem.created_at < bias)) {
|
||||||
|
console.log('break');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if ((gameLogItem.type === 'OnPlayerJoined') && (gameLogItem.data === ctx.displayName)) {
|
||||||
|
console.log('joining');
|
||||||
|
joining = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (joining) {
|
||||||
var onPlayerJoining = {
|
var onPlayerJoining = {
|
||||||
...ctx,
|
...ctx,
|
||||||
type: 'OnPlayerJoining'
|
type: 'OnPlayerJoining'
|
||||||
};
|
};
|
||||||
if ((this.sharedFeedFilters.wrist.OnPlayerJoining === 'Friends') ||
|
if ((this.sharedFeedFilters.wrist.OnPlayerJoining === 'Friends') ||
|
||||||
((this.sharedFeedFilters.wrist.OnPlayerJoining === 'VIP') && (ctx.isFavorite))) {
|
((this.sharedFeedFilters.wrist.OnPlayerJoining === 'VIP') && (ctx.isFavorite))) {
|
||||||
wristFeed.push(onPlayerJoining);
|
wristFeed.unshift(onPlayerJoining);
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
if ((this.sharedFeedFilters.noty.OnPlayerJoining === 'Friends') ||
|
if ((this.sharedFeedFilters.noty.OnPlayerJoining === 'Friends') ||
|
||||||
((this.sharedFeedFilters.noty.OnPlayerJoining === 'VIP') && (ctx.isFavorite))) {
|
((this.sharedFeedFilters.noty.OnPlayerJoining === 'VIP') && (ctx.isFavorite))) {
|
||||||
notyFeed.push(onPlayerJoining);
|
notyFeed.unshift(onPlayerJoining);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
joiningMap[ctx.displayName] = ctx.created_at;
|
|
||||||
}
|
|
||||||
if (ctx.created_at < bias) {
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user