Locked chat function from double entry.
This commit is contained in:
parent
a6dfbd31b0
commit
0d22dbe9a3
|
|
@ -35,6 +35,7 @@ class ClientRegistry(object):
|
|||
self.chat = {}
|
||||
self.chatCount = 1
|
||||
self.chatColors = ColorCache()
|
||||
self.chatLock = threading.Lock()
|
||||
Config.get().wireProperty("max_clients", self._checkClientCount)
|
||||
super().__init__()
|
||||
|
||||
|
|
@ -71,6 +72,7 @@ class ClientRegistry(object):
|
|||
|
||||
# Broadcast chat message to all connected clients.
|
||||
def broadcastChatMessage(self, client, text: str, name: str = None):
|
||||
with self.chatLock:
|
||||
if name is not None:
|
||||
# Names can only include alphanumerics
|
||||
name = re.sub("\W+", "", name)
|
||||
|
|
|
|||
Loading…
Reference in New Issue