Spaces:
Runtime error
Runtime error
GitLab CI
commited on
Commit
·
2e1a626
1
Parent(s):
5771de1
Update game build from GitLab CI
Browse files- server/static/godot/index.html +1 -1
- server/static/godot/index.pck +2 -2
- server/static/index.html +16 -1
server/static/godot/index.html
CHANGED
|
@@ -97,7 +97,7 @@ body {
|
|
| 97 |
|
| 98 |
<script src="index.js"></script>
|
| 99 |
<script>
|
| 100 |
-
const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"ensureCrossOriginIsolationHeaders":false,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":
|
| 101 |
const GODOT_THREADS_ENABLED = false;
|
| 102 |
const engine = new Engine(GODOT_CONFIG);
|
| 103 |
|
|
|
|
| 97 |
|
| 98 |
<script src="index.js"></script>
|
| 99 |
<script>
|
| 100 |
+
const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"ensureCrossOriginIsolationHeaders":false,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":18582528,"index.wasm":35376909},"focusCanvas":true,"gdextensionLibs":[]};
|
| 101 |
const GODOT_THREADS_ENABLED = false;
|
| 102 |
const engine = new Engine(GODOT_CONFIG);
|
| 103 |
|
server/static/godot/index.pck
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aed0401261f4e6874f34383b267790e2465c030c957dc078a8eebb7bdc5a6e3f
|
| 3 |
+
size 18582528
|
server/static/index.html
CHANGED
|
@@ -33,14 +33,29 @@
|
|
| 33 |
// URL of the server to send audio chunks
|
| 34 |
const serverUrl = "./api/process"
|
| 35 |
const FETCH_TIMEOUT = 5000 // 5 seconds timeout
|
|
|
|
| 36 |
|
| 37 |
// Check server availability first
|
| 38 |
const controller = new AbortController()
|
| 39 |
const timeout = setTimeout(() => controller.abort(), FETCH_TIMEOUT)
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
fetch("./api/data", {
|
| 42 |
method: 'GET',
|
| 43 |
-
signal: controller.signal
|
|
|
|
|
|
|
|
|
|
| 44 |
})
|
| 45 |
.then(response => {
|
| 46 |
clearTimeout(timeout)
|
|
|
|
| 33 |
// URL of the server to send audio chunks
|
| 34 |
const serverUrl = "./api/process"
|
| 35 |
const FETCH_TIMEOUT = 5000 // 5 seconds timeout
|
| 36 |
+
var token = ""
|
| 37 |
|
| 38 |
// Check server availability first
|
| 39 |
const controller = new AbortController()
|
| 40 |
const timeout = setTimeout(() => controller.abort(), FETCH_TIMEOUT)
|
| 41 |
|
| 42 |
+
// Écouter les messages venant de l'iframe
|
| 43 |
+
window.addEventListener('message', function (event) {
|
| 44 |
+
// Vérifier que le message a la structure attendue
|
| 45 |
+
console.log(event.data)
|
| 46 |
+
if (event.data?.type === 'game_token') {
|
| 47 |
+
token = event.data.data
|
| 48 |
+
console.log("Token reçu :", token)
|
| 49 |
+
// Utilisez le token comme souhaité
|
| 50 |
+
}
|
| 51 |
+
})
|
| 52 |
+
|
| 53 |
fetch("./api/data", {
|
| 54 |
method: 'GET',
|
| 55 |
+
signal: controller.signal,
|
| 56 |
+
headers: {
|
| 57 |
+
'Authorization': `Bearer ${token}`
|
| 58 |
+
}
|
| 59 |
})
|
| 60 |
.then(response => {
|
| 61 |
clearTimeout(timeout)
|