Make player container an ordered dictionary

This commit is contained in:
2023-01-16 16:13:44 +01:00
parent 5fbe00aefa
commit 2d294ddfd2
3 changed files with 19 additions and 9 deletions
+4 -1
View File
@@ -1,6 +1,7 @@
import json
import simple_websocket
from collections import OrderedDict
from flask import Flask
from flask_sock import Sock
from queue import Queue
@@ -14,7 +15,9 @@ class Client:
class GlebbyState:
def __init__(self):
self.clients_lock = Lock()
self.clients = dict()
# We want to preserve the order that clients arrived in,
# e.g. for whose turn it is
self.clients = OrderedDict()
self.next_client_id_lock = Lock()
self.next_client_id = 0