<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _do_join_packet(self, packet, ip, port):
 """ React to join packet - add a client to this server :param packet: Packet from client that wants to join :type packet: paps.si.app.message.APPJoinMessage :param ip: Client ip address :type ip: unicode :param port: Client port :type port: int :rtype: None """

        self.debug("()")
        device_id = packet.header.device_id
        key = u"{}:{}".format(ip, port)

        if device_id == Id.REQUEST:
            device_id = self._new_device_id(key)

        client = self._clients.get(device_id, {})
        data = {}

        if packet.payload:
            try:
                data = packet.payload
            except:
                data = {}

        client['device_id'] = device_id
        client['key'] = key
        people = []
        try:
            for index, person_dict in enumerate(data['people']):
                person = Person()
                person.from_dict(person_dict)
                person.id = u"{}.{}".format(device_id, person.id)
                # To get original id -> id.split('.')[0]
                people.append(person)
            self.changer.on_person_new(people)
        except:
            self.exception("Failed to update people")
            return

        # Original ids (without device id)
        client['people'] = people
        # Add config to client data?
        client_dict = dict(client)
        del client_dict['people']

        self._send_packet(ip, port, APPConfigMessage(payload=client_dict))
        self._clients[device_id] = client
        self._key2deviceId[key] = device_id