bettermint commited on
Commit
26ce47a
·
verified ·
1 Parent(s): 7f0744e

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +0 -34
main.py CHANGED
@@ -206,36 +206,6 @@ async def websocket_endpoint(websocket: WebSocket, elo: str):
206
  user_playing['patricia'] -= 1
207
 
208
 
209
- @app.websocket("/trollfish")
210
- async def websocket_endpoint(websocket: WebSocket):
211
- await websocket.accept()
212
-
213
- user_playing['total'] += 1
214
- user_playing['trollfish'] += 1
215
-
216
- stockfish = EngineChess([f"./engines/trollfish/trollfish"])
217
-
218
- async def read_from_socket(websocket: WebSocket):
219
- async for data in websocket.iter_text():
220
- print(f"Trollfish Client: {data}")
221
- stockfish.put(data)
222
-
223
- asyncio.create_task(read_from_socket(websocket))
224
-
225
- try:
226
- while True:
227
- while True:
228
- res = stockfish.read_line()
229
- if res:
230
- await websocket.send_text(f"{res}")
231
- else:
232
- break
233
- await asyncio.sleep(0.1)
234
- finally:
235
- user_playing['total'] -= 1
236
- user_playing['trollfish'] -= 1
237
-
238
-
239
  @app.get("/")
240
  async def root(request: Request):
241
  html_content = """
@@ -303,10 +273,6 @@ async def root(request: Request):
303
  <label>Stockfish Users:</label>
304
  <span id="stockfish-users">""" + str(user_playing['stockfish']) + """</span>
305
  </div>
306
- <div class="stat">
307
- <label>Trollfish Users:</label>
308
- <span id="trollfish-users">""" + str(user_playing['trollfish']) + """</span>
309
- </div>
310
  <div class="stat">
311
  <label>Rodent-III Users:</label>
312
  <span id="rodent3-users">""" + str(user_playing['rodent']) + """</span>
 
206
  user_playing['patricia'] -= 1
207
 
208
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  @app.get("/")
210
  async def root(request: Request):
211
  html_content = """
 
273
  <label>Stockfish Users:</label>
274
  <span id="stockfish-users">""" + str(user_playing['stockfish']) + """</span>
275
  </div>
 
 
 
 
276
  <div class="stat">
277
  <label>Rodent-III Users:</label>
278
  <span id="rodent3-users">""" + str(user_playing['rodent']) + """</span>