Add allsessions

This commit is contained in:
Dominic Zimmer 2020-04-17 02:19:28 +02:00
parent 0f23259e04
commit f05503b871

View File

@ -72,10 +72,11 @@ class Model(object):
async def send_state(self, clientid):
# TODO: compute state, send to client
session = "deine mudda"
session = "No session"
if "session" in self.model["clients"][clientid]:
session = self.model["clients"][clientid]["session"]
data = {"session": session}
allsessions = [ name for name in self.model["sessions"] ]
data = {"currentsession": session, "allsessions": allsessions}
for socket in self.sockets[clientid]:
await socket.send_json(data)