Refresh user/world players in instance count 1

This commit is contained in:
Natsumi
2021-06-02 07:18:34 +12:00
parent ad85eb8c55
commit 12b299da20
+12 -10
View File
@@ -5507,7 +5507,6 @@ speechSynthesis.getVoices();
} }
var ctx = this.friends.get(userId); var ctx = this.friends.get(userId);
if ((typeof ctx.ref !== 'undefined') && if ((typeof ctx.ref !== 'undefined') &&
(ctx.ref.location !== 'private') &&
(ctx.state === 'online')) { (ctx.state === 'online')) {
if (ctx.isVIP) { if (ctx.isVIP) {
removeFromArray(this.friendsGroupA_, ctx); removeFromArray(this.friendsGroupA_, ctx);
@@ -8287,15 +8286,21 @@ speechSynthesis.getVoices();
} }
users.sort(compareByLocationAt); users.sort(compareByLocationAt);
D.users = users; D.users = users;
if (!L.worldId) { if ((L.worldId) &&
return; (this.lastLocation.location === D.ref.location)) {
}
if (this.lastLocation.location === L.tag) {
D.instance = { D.instance = {
id: L.tag, id: D.ref.location,
occupants: this.lastLocation.playerList.length occupants: this.lastLocation.playerList.length
}; };
} }
if ((L.isOffline) ||
(L.isPrivate) ||
(L.worldId === '')) {
D.instance = {
id: D.ref.location,
occupants: 0
};
}
}; };
$app.methods.setUserDialogWorlds = function (userId) { $app.methods.setUserDialogWorlds = function (userId) {
@@ -8828,16 +8833,13 @@ speechSynthesis.getVoices();
} }
var lastLocation$ = API.parseLocation(this.lastLocation.location); var lastLocation$ = API.parseLocation(this.lastLocation.location);
var playersInInstance = this.lastLocation.playerList; var playersInInstance = this.lastLocation.playerList;
if ((lastLocation$.worldId === D.id) && (playersInInstance.length > 0)) { if (lastLocation$.worldId === D.id) {
var instance = instances[lastLocation$.instanceId];
if (typeof instance === 'undefined') {
instance = { instance = {
id: lastLocation$.instanceId, id: lastLocation$.instanceId,
occupants: playersInInstance.length, occupants: playersInInstance.length,
users: [] users: []
}; };
instances[instance.id] = instance; instances[instance.id] = instance;
}
var ref = API.cachedUsers.get(API.currentUser.id); var ref = API.cachedUsers.get(API.currentUser.id);
if (typeof ref === 'undefined') { if (typeof ref === 'undefined') {
ref = API.currentUser; ref = API.currentUser;