Пример #1
0
 def welcome(self, user):
     """ welcomes a user to the roomserver """
     self.send_message(create_message('RoomServer', 'Please welcome {name} to the server!\nThere are currently {i} users online -\n {r}\n'.format(name=user.id, 
                       i=self.amount_of_users_connected, 
                       r=' '.join(self.user_names))))
     logging.debug('Welcoming user {user} to {room}'.format(user=user.id.name, room=self.name))
Пример #2
0
 def disconnect(self, user):
     """ Disconnect a user and send a message to the 
         connected clients """
     self.remove_user(user)
     self.send_message(create_message('RoomServer', 'Please all say goodbye to {name}!'.format(name=user.id.name)))
     self.send_message(create_disconnect(user.id.name))