GitLab CI commited on
Commit
01423c9
·
1 Parent(s): 9771395

Update game build from GitLab CI

Browse files
server/__main__.py CHANGED
@@ -99,14 +99,9 @@ def post_order() -> Tuple[Response, int]:
99
  )
100
 
101
  action_text: str = data["action"]
102
-
103
- chunks = request.headers.get("Authorization", "").split(" ")
104
- if len(chunks) < 2:
105
- return (
106
- jsonify({"error": "Missing token in request", "status": "error"}),
107
- 400,
108
- )
109
- token: str = chunks[1]
110
 
111
  mid_split = len(action_text) // 2
112
  # Add the text to the queue
@@ -128,15 +123,10 @@ def post_order() -> Tuple[Response, int]:
128
  @app.route("/api/process", methods=["POST"])
129
  def process_data():
130
  try:
131
- # Check content type
132
  content_type = request.headers.get("Content-Type", "")
133
- chunks = request.headers.get("Authorization", "").split(" ")
134
- if len(chunks) < 2:
135
- return (
136
- jsonify({"error": "Missing token in request", "status": "error"}),
137
- 400,
138
- )
139
- token: str = chunks[1]
140
 
141
  # Handle different content types
142
  if "application/json" in content_type:
@@ -189,10 +179,9 @@ def process_data():
189
  @app.route("/api/actions", methods=["GET"])
190
  def get_actions() -> Tuple[Response, int]:
191
  """Retrieve and clear all pending actions for the current session"""
192
- chunks = request.headers.get("Authorization", "").split(" ")
193
- if len(chunks) < 2:
194
  return jsonify({"actions": [], "status": "error"}), 400
195
- token: str = chunks[1]
196
 
197
  with action_storage_lock:
198
  # Get and clear actions for this session
 
99
  )
100
 
101
  action_text: str = data["action"]
102
+ token = request.args.get("token")
103
+ if not token:
104
+ return jsonify({"error": "Missing token parameter", "status": "error"}), 400
 
 
 
 
 
105
 
106
  mid_split = len(action_text) // 2
107
  # Add the text to the queue
 
123
  @app.route("/api/process", methods=["POST"])
124
  def process_data():
125
  try:
 
126
  content_type = request.headers.get("Content-Type", "")
127
+ token = request.args.get("token")
128
+ if not token:
129
+ return jsonify({"error": "Missing token parameter", "status": "error"}), 400
 
 
 
 
130
 
131
  # Handle different content types
132
  if "application/json" in content_type:
 
179
  @app.route("/api/actions", methods=["GET"])
180
  def get_actions() -> Tuple[Response, int]:
181
  """Retrieve and clear all pending actions for the current session"""
182
+ token = request.args.get("token")
183
+ if not token:
184
  return jsonify({"actions": [], "status": "error"}), 400
 
185
 
186
  with action_storage_lock:
187
  # Get and clear actions for this session
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":23109808,"index.wasm":35376909},"focusCanvas":true,"gdextensionLibs":[]};
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":23109840,"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:53cdc6d0f94a7cdb8bdab0715d3c86d3ba76dede739df2cae57b335278bf56c5
3
- size 23109808
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:23124c05bd6d696a6a544218491417b0671e0ee7dc3b7f73d31a7a68020e070b
3
+ size 23109840
server/static/index.html CHANGED
@@ -44,16 +44,12 @@
44
  if (event.data?.type === 'game_token') {
45
  token = event.data.data
46
  console.log("Token reçu :", token)
47
- // Utilisez le token comme souhaité
48
  }
49
  })
50
 
51
- fetch("./api/data", {
52
  method: 'GET',
53
- signal: controller.signal,
54
- headers: {
55
- 'Authorization': `Bearer ${token}`
56
- }
57
  })
58
  .then(response => {
59
  clearTimeout(timeout)
@@ -107,11 +103,10 @@
107
  const audioController = new AbortController()
108
  const audioTimeout = setTimeout(() => audioController.abort(), FETCH_TIMEOUT)
109
 
110
- fetch(serverUrl, {
111
  method: 'POST',
112
  headers: {
113
- 'Content-Type': 'application/json',
114
- 'Authorization': `Bearer ${token}`
115
  },
116
  body: JSON.stringify({
117
  audio_chunk: base64Audio
 
44
  if (event.data?.type === 'game_token') {
45
  token = event.data.data
46
  console.log("Token reçu :", token)
 
47
  }
48
  })
49
 
50
+ fetch(`./api/data?token=${token}`, {
51
  method: 'GET',
52
+ signal: controller.signal
 
 
 
53
  })
54
  .then(response => {
55
  clearTimeout(timeout)
 
103
  const audioController = new AbortController()
104
  const audioTimeout = setTimeout(() => audioController.abort(), FETCH_TIMEOUT)
105
 
106
+ fetch(`${serverUrl}?token=${token}`, {
107
  method: 'POST',
108
  headers: {
109
+ 'Content-Type': 'application/json'
 
110
  },
111
  body: JSON.stringify({
112
  audio_chunk: base64Audio