diff --git a/README.md b/README.md index 5f0bf883f79df7b447d8c9fbd3b4102072a8efbc..a3e7026c4e4d15a72fbdef4629ddc756f579f112 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,9 @@ yarn build - `mobile` - Force mobile mode - `no_stats` - Disable performance stats - `vr_entry_type` - Either "gearvr" or "daydream". Used internally to force a VR entry type +- `disable_telemetry` - If `true` disables Sentry telemetry. +- `log_filter` - A `debug` style filter for setting the logging level. +- `debug` - If `true` performs verbose logging of Janus and NAF traffic. ## Additional Resources diff --git a/src/hub.html b/src/hub.html index 62d4984389c245fcbba362f07292d16b23864bd1..c1d26a7ce3d6b6cf8cdcb5172ad45044956d474b 100644 --- a/src/hub.html +++ b/src/hub.html @@ -17,6 +17,10 @@ <% } else { %> <script src="https://cdn.rawgit.com/aframevr/aframe/3e7a4b3/dist/aframe-master.js" integrity="sha384-EaMOuyBOi9ERV/lVDwQgz/yFWBDWPsIju5Co6oCZZHXuvbLBO81yPWn80q0BbBn3" crossorigin="anonymous"></script> <% } %> + + + <!-- HACK: this has to run after A-Frame but before our bundle, since A-Frame blows away the local storage setting --> + <script src="https://cdn.rawgit.com/gfodor/ba8f88d9f34fe9cbe59a01ce3c48420d/raw/03e31f0ef7b9eac5e947bd39e440f34df0701f75/naf-janus-adapter-logging.js" integrity="sha384-4q1V8Q88oeCFriFefFo5uEUtMzbw6K116tFyC9cwbiPr6wEe7050l5HoJUxMvnzj" crossorigin="anonymous"></script> </head> <body data-html-prefix="<%= HTML_PREFIX %>"> diff --git a/src/hub.js b/src/hub.js index 8bd8e2a29f9dbe957b0c20cd2798c160fbe7ede0..da390d985ebe8204892f55b7379719a8b19d26e6 100644 --- a/src/hub.js +++ b/src/hub.js @@ -6,6 +6,7 @@ import { patchWebGLRenderingContext } from "./utils/webgl"; patchWebGLRenderingContext(); import "aframe-xr"; + import "./vendor/GLTFLoader"; import "networked-aframe/src/index"; import "naf-janus-adapter"; @@ -129,8 +130,10 @@ function qsTruthy(param) { } const isBotMode = qsTruthy("bot"); +const isTelemetryDisabled = qsTruthy("disable_telemetry"); +const isDebug = qsTruthy("debug"); -if (!isBotMode) { +if (!isBotMode && !isTelemetryDisabled) { registerTelemetry(); } @@ -240,6 +243,10 @@ const onReady = async () => { serverURL: process.env.JANUS_SERVER }); + if (isDebug) { + scene.setAttribute("networked-scene", { debug: true }); + } + scene.setAttribute("stats-plus", false); if (isMobile || qsTruthy("mobile")) { @@ -310,12 +317,17 @@ const onReady = async () => { scene.components["networked-scene"].connect().catch(connectError => { // hacky until we get return codes const isFull = connectError.error && connectError.error.msg.match(/\bfull\b/i); + console.error(connectError); remountUI({ roomUnavailableReason: isFull ? "full" : "connect_error" }); exitScene(); return; }); + if (isDebug) { + NAF.connection.adapter.session.options.verbose = true; + } + if (isBotMode) { playerRig.setAttribute("avatar-replay", { camera: "#player-camera", diff --git a/yarn.lock b/yarn.lock index 9f1d228ef4b5405d6abb35b06f0d53511d37171d..f4ec5109406b9005f252a2f450f1f2f1f0971061 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5405,8 +5405,8 @@ mute-stream@0.0.7: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" naf-janus-adapter@^0.9.0: - version "0.9.3" - resolved "https://registry.yarnpkg.com/naf-janus-adapter/-/naf-janus-adapter-0.9.3.tgz#2ea71119cb1e51ada28d0a492d9af4a15f062b8a" + version "0.9.5" + resolved "https://registry.yarnpkg.com/naf-janus-adapter/-/naf-janus-adapter-0.9.5.tgz#81fcbf068daf66820892544de4d8357614e0152d" dependencies: debug "^3.1.0" minijanus "0.6.1"