def create_env(self, username): # check other is conn if Interaction.is_connected(username): other_client = Interaction.get_client(username) self.env = Env((self, other_client), (self.username, other_client.username)) other_client.env = self.env Interaction.inform_inenv(other_client.username) other_client.in_env = True self.in_env = True
def check_env_rinv(self, username): # check other is conn if Interaction.is_connected(username): other_client = Interaction.get_client(username) # check if other client is already in env if other_client.in_env: other_client.env.add_client(self) self.in_env = True self.env = other_client.env else: self.create_env(username) Interaction.inform_inenv(self.username)