Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lobby #594

Closed
wants to merge 20 commits into from
Closed

Lobby #594

wants to merge 20 commits into from

Conversation

gfodor
Copy link
Contributor

@gfodor gfodor commented Sep 30, 2018

Add a pre entry lobby so users can see what is going on before they chose to join a room.

  • Does a ton of refactoring and cleanup of hub.js, breaking some code out into SceneEntryManager and lifting a bunch of closures into top level functions, among other things. (hopefully this makes @mquander happy :)) There's more I could probably do but this is a good first step.

  • Removes the speculative Daydream entry mode

  • Changes the hub landing page to connect to Janus and put the user into a spectator mode which automatically pans the camera through the scene, but allows the user to rotate it.

More visual design changes forthcoming but this is a basic "lobby" mode. This has two benefits: it allows the user to see what is going on in the room before entering, and also as a bonus causes avatars, objects, etc, to load before entering VR, which avoids the worst hitching.

@buildsize
Copy link

buildsize bot commented Sep 30, 2018

File name Previous Size New Size Change
avatar-selector.html 608 bytes 608 bytes 0 bytes (0%)
favicon.ico 33.69 KB 33.69 KB 0 bytes (0%)
hub-preview.png 22.78 KB 22.78 KB 0 bytes (0%)
hub.html 26.69 KB 26.59 KB -106 bytes (0%)
index.html 696 bytes 696 bytes 0 bytes (0%)
link.html 804 bytes 804 bytes 0 bytes (0%)
LoadingObject_Atom-[hash].glb 27.43 KB 27.43 KB 0 bytes (0%)
waternormals-[hash].jpg 242.98 KB 242.98 KB 0 bytes (0%)
bubble_off-[hash].png 8.58 KB 8.58 KB 0 bytes (0%)
bubble_off-hover-[hash].png 10.41 KB 10.41 KB 0 bytes (0%)
bubble_on-[hash].png 9.24 KB 9.24 KB 0 bytes (0%)
bubble_on-hover-[hash].png 8.88 KB 8.88 KB 0 bytes (0%)
create_object-[hash].png 15.05 KB 15.05 KB 0 bytes (0%)
create_object-hover-[hash].png 15.87 KB 15.87 KB 0 bytes (0%)
freeze_off-[hash].png 12.24 KB 12.24 KB 0 bytes (0%)
freeze_off-hover-[hash].png 12.82 KB 12.82 KB 0 bytes (0%)
freeze_on-[hash].png 12.83 KB 12.83 KB 0 bytes (0%)
freeze_on-hover-[hash].png 13.31 KB 13.31 KB 0 bytes (0%)
mute_off-[hash].png 4.81 KB 4.81 KB 0 bytes (0%)
mute_off-hover-[hash].png 6.08 KB 6.08 KB 0 bytes (0%)
mute_on-[hash].png 9.57 KB 9.57 KB 0 bytes (0%)
mute_on-hover-[hash].png 8.61 KB 8.61 KB 0 bytes (0%)
spawn_photo-[hash].png 5.78 KB 5.78 KB 0 bytes (0%)
tooltip.9-[hash].png 815 bytes 815 bytes 0 bytes (0%)
watch-[hash].glb 880.11 KB 880.11 KB 0 bytes (0%)
account-[hash].svg 826 bytes 826 bytes 0 bytes (0%)
daydream_entry-[hash].svg 7.13 KB 7.13 KB 0 bytes (0%)
default_thumbnail-[hash].png 3.23 KB 3.23 KB 0 bytes (0%)
desktop_screen_entry-[hash].svg 604 bytes 604 bytes 0 bytes (0%)
device_entry-[hash].svg 3.66 KB 3.66 KB 0 bytes (0%)
dropdown_arrow-[hash].png 206 bytes 206 bytes 0 bytes (0%)
dropdown_arrow@2x-[hash].png 302 bytes 302 bytes 0 bytes (0%)
gearvr_entry-[hash].svg 574 bytes 574 bytes 0 bytes (0%)
generic_vr_entry-[hash].svg 1.15 KB 1.15 KB 0 bytes (0%)
giphy_logo-[hash].png 1.38 KB 1.38 KB 0 bytes (0%)
help-hud-[hash].png 11.76 KB 11.76 KB 0 bytes (0%)
help-hud@2x-[hash].png 18.87 KB 18.87 KB 0 bytes (0%)
level_background-[hash].png 4.97 KB 4.97 KB 0 bytes (0%)
level_background@2x-[hash].png 6.46 KB 6.46 KB 0 bytes (0%)
level_fill-[hash].png 1.71 KB 1.71 KB 0 bytes (0%)
level_fill@2x-[hash].png 3.38 KB 3.38 KB 0 bytes (0%)
logo-[hash].svg 14.21 KB 14.21 KB 0 bytes (0%)
mic_denied-[hash].png 4.11 KB 4.11 KB 0 bytes (0%)
mic_denied@2x-[hash].png 8.08 KB 8.08 KB 0 bytes (0%)
mic_granted-[hash].png 3.71 KB 3.71 KB 0 bytes (0%)
mic_granted@2x-[hash].png 7.43 KB 7.43 KB 0 bytes (0%)
mic_level-[hash].png 990 bytes 990 bytes 0 bytes (0%)
mic_level@2x-[hash].png 2.32 KB 2.32 KB 0 bytes (0%)
mic_small-[hash].png 298 bytes 298 bytes 0 bytes (0%)
mic_small@2x-[hash].png 298 bytes 298 bytes 0 bytes (0%)
mobile_screen_entry-[hash].svg 1.28 KB 1.28 KB 0 bytes (0%)
speaker_level-[hash].png 953 bytes 953 bytes 0 bytes (0%)
speaker_level@2x-[hash].png 2.13 KB 2.13 KB 0 bytes (0%)
warning_icon-[hash].png 582 bytes 582 bytes 0 bytes (0%)
warning_icon@2x-[hash].png 1.05 KB 1.05 KB 0 bytes (0%)
aframe-inspector.min-[hash].js 384.44 KB 384.44 KB 0 bytes (0%)
avatar-selector-[hash].js 33.58 KB 33.71 KB 141 bytes (0%)
avatar-selector-[hash].js.map 75.74 KB 75.92 KB 181 bytes (0%)
engine-[hash].js 1.42 MB 1.42 MB -28 bytes (0%)
engine-[hash].js.map 4.47 MB 4.47 MB -2 bytes (0%)
gifparsing.worker-[hash].js 1.91 KB 1.91 KB 0 bytes (0%)
gifparsing.worker-[hash].js.map 8.32 KB 8.32 KB 0 bytes (0%)
hub-[hash].js 305.07 KB 307.14 KB 2.07 KB (1%)
hub-[hash].js.map 733.31 KB 735.38 KB 2.06 KB (0%)
index-[hash].js 48.78 KB 48.78 KB 4 bytes (0%)
index-[hash].js.map 81.77 KB 81.78 KB 14 bytes (0%)
link-[hash].js 23.73 KB 23.73 KB 0 bytes (0%)
link-[hash].js.map 46.59 KB 46.59 KB 0 bytes (0%)
sketchfab-zip.worker-[hash].js 155.49 KB 155.49 KB 0 bytes (0%)
sketchfab-zip.worker-[hash].js.map 774.45 KB 774.45 KB 0 bytes (0%)
vendor-[hash].js 529.53 KB 529.53 KB 4 bytes (0%)
vendor-[hash].js.map 1.78 MB 1.78 MB -13 bytes (0%)
quack-[hash].mp3 7.03 KB 7.03 KB 0 bytes (0%)
specialquack-[hash].mp3 11.57 KB 11.57 KB 0 bytes (0%)
tone-[hash].mp3 53.92 KB 53.92 KB 0 bytes (0%)
tone-[hash].wav 385.29 KB 385.29 KB 0 bytes (0%)
tone-[hash].webm 32.04 KB 32.04 KB 0 bytes (0%)
tone-[hash].ogg 32.55 KB 32.55 KB 0 bytes (0%)
avatar-selector-[hash].css 1.12 KB 1.12 KB 0 bytes (0%)
avatar-selector-[hash].css.map 136 bytes 136 bytes 0 bytes (0%)
hub-[hash].css 50.15 KB 50.15 KB 0 bytes (0%)
hub-[hash].css.map 124 bytes 124 bytes 0 bytes (0%)
index-[hash].css 32.65 KB 32.65 KB 0 bytes (0%)
index-[hash].css.map 126 bytes 126 bytes 0 bytes (0%)
link-[hash].css 4.64 KB 4.64 KB 0 bytes (0%)
link-[hash].css.map 125 bytes 125 bytes 0 bytes (0%)
home-[hash].mp4 2 MB 2 MB 0 bytes (0%)
home-[hash].webm 1.81 MB 1.81 MB 0 bytes (0%)
negx-[hash].jpg 54.45 KB 54.45 KB 0 bytes (0%)
negy-[hash].jpg 50.97 KB 50.97 KB 0 bytes (0%)
negz-[hash].jpg 53.29 KB 53.29 KB 0 bytes (0%)
posx-[hash].jpg 58.64 KB 58.64 KB 0 bytes (0%)
posy-[hash].jpg 19.17 KB 19.17 KB 0 bytes (0%)
posz-[hash].jpg 57.49 KB 57.49 KB 0 bytes (0%)
spawn_pen-[hash].png 4.6 KB 4.6 KB 0 bytes (0%)
spawn_pen-hover-[hash].png 5.25 KB 5.25 KB 0 bytes (0%)
spawn_camera-[hash].png 5.3 KB 5.3 KB 0 bytes (0%)
spawn_camera-hover-[hash].png 6.27 KB 6.27 KB 0 bytes (0%)
scene.html 1.55 KB 1.55 KB 0 bytes (0%)
scene-[hash].js 86.2 KB 86.5 KB 300 bytes (0%)
scene-[hash].js.map 201.23 KB 201.86 KB 652 bytes (0%)
scene-[hash].css 3.61 KB 3.61 KB 0 bytes (0%)
scene-[hash].css.map 126 bytes 126 bytes 0 bytes (0%)
camera_tool-[hash].glb 757.23 KB 757.23 KB 0 bytes (0%)
hub-preview-white-[hash].png 79.24 KB 79.24 KB 0 bytes (0%)

Copy link
Contributor

@brianpeiris brianpeiris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments I left about loadedSceneUrl and environment-root probably need to be addressed.

});
const hudController = this.playerRig.querySelector("[hud-controller]");
hudController.setAttribute("hud-controller", { showTip: !this.store.state.activity.hasFoundFreeze });
document.querySelector("a-scene").emit("username-changed", { username: displayName });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use this.scene instead of querying the selector again.

if (screenEntity) {
screenEntity.setAttribute("visible", sharingScreen);
} else if (sharingScreen) {
const sceneEl = document.querySelector("a-scene");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use this.scene

src/scene-entry-manager.js Outdated Show resolved Hide resolved
src/hub.js Show resolved Hide resolved
src/hub.js Outdated
e.preventDefault();
});
if (isBotMode) {
entryManager.enterSceneWhenLoaded(new MediaStream(), false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is never called with true instead of false.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's OK -- i defined the public interface of this function to match that of enterScene


// Connect to reticulum over phoenix channels to get hub info.
const hubId = qs.get("hub_id") || document.location.pathname.substring(1).split("/")[0];
console.log(`Hub ID: ${hubId}`);

const socket = connectToReticulum(isDebug);
const channel = socket.channel(`hub:${hubId}`, {});
let loadedSceneUrl = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this loadedSceneUrl mechanism was removed in the refactor. Wasn't it needed for a proper re-join?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, yeah so the way I detect if its a reconnect is via NAF.connection.isConnected() -- I think that incidentally works but probably not the best thing to check. any suggestions?

@@ -459,7 +456,9 @@
id="environment-root"
nav-mesh-helper
static-body="shape: none;"
></a-entity>
>
<a-entity id="environment-scene"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've replaced environment-root with environment-scene? Looks like environment-root is not referenced anywhere now. You'll probably want to move the nav-mesh-helper and static-body components over if that's the case.

Copy link
Contributor Author

@gfodor gfodor Oct 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so I believe the scene structure is unchanged, but previously the join code created the environment-scene element and a few things closed over it and used it (it did not have a name in the dom, it was passed around in a var.) so i just moved that into the DOM directly so those closures could get lifted.

Copy link
Contributor

@brianpeiris brianpeiris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gfodor
Copy link
Contributor Author

gfodor commented Oct 2, 2018

#599

@gfodor gfodor closed this Oct 2, 2018
@brianpeiris brianpeiris added the whats new Include this PR on the "What's New" page label Oct 22, 2018
@netpro2k netpro2k changed the title Feature/lobby Lobby Dec 13, 2018
@brianpeiris brianpeiris deleted the feature/lobby branch December 13, 2018 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
whats new Include this PR on the "What's New" page
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants