Skip to content
Snippets Groups Projects
Commit f6531e7e authored by Alexander Schulz's avatar Alexander Schulz
Browse files

bugfix group creation after group server crash

parent e0f0d890
No related branches found
No related tags found
No related merge requests found
......@@ -422,7 +422,7 @@ class Server(multiprocessing.Process):
# Register client. Check if chatgroup exists, if yes answer client with chatgroup server IP
def register_client(self, group, client_addr):
if group not in self.local_servers_cache:
if group not in self.local_group_cache:
print(self.server_id+": "+"Group "+group+" doesn't exist.")
else:
......@@ -438,9 +438,18 @@ class Server(multiprocessing.Process):
self.local_clients_cache[client_cache_key] = client_addr
def find_groupchat_server_addresse(self, group):
for key in self.local_servers_cache:
# double check if group really exist
for key in self.local_group_cache:
print("Key ", key)
if group == str(key):
addr = self.local_servers_cache[key][0]
print("ID: ", self.local_group_cache[key])
if self.local_group_cache[key] == "MAIN":
addr = self.server_address
else:
id = self.local_group_cache[key]
addr = self.local_servers_cache[id][0]
print("Address: ", addr)
return addr
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment