From d15c65cca5e2993d82ab9b57801b862edbe4566e Mon Sep 17 00:00:00 2001 From: pypy Date: Tue, 3 Mar 2020 20:19:00 +0900 Subject: [PATCH] show yourself in worlds (closes #35) --- html/app.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/html/app.js b/html/app.js index bc77f9e7..de150893 100644 --- a/html/app.js +++ b/html/app.js @@ -5573,6 +5573,9 @@ CefSharp.BindObjectAsync( } } } + if (this.lastLocation === L.tag) { + users.push(this.API.currentUser); + } users.sort(compareByDisplayName); D.users = users; D.instance = {}; @@ -5987,6 +5990,19 @@ CefSharp.BindObjectAsync( } instance.users.push(ref); } + var lastLocation$ = API.parseLocation(this.lastLocation); + if (lastLocation$.worldId === D.id) { + var instance = instances[lastLocation$.instanceId]; + if (instance === undefined) { + instance = { + id: lastLocation$.instanceId, + occupants: 1, + users: [] + }; + instances[instance.id] = instance; + } + instance.users.push(this.API.currentUser); + } var rooms = []; for (var instance of Object.values(instances)) { // due to references on callback of API.getUser()