Make player container an ordered dictionary
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user