def chooseTrack(self, trackId):
    avId = self.air.getAvatarIdFromSender()
    self.notify.debug(('chooseTrack: avatar %s choseTrack %s' % (avId, trackId)))
    if (not self.pendingAvId):
        self.notify.warning(('chooseTrack: not expecting an answer from any avatar: %s' % avId))
        return
    if (self.pendingAvId != avId):
        self.notify.warning(('chooseTrack: not expecting an answer from this avatar: %s' % avId))
        return
    if (trackId == (- 1)):
        self.pendingAvId = None
        self.pendingTracks = None
        self.pendingTrackQuest = None
        self.air.questManager.avatarCancelled(avId)
        self.cancelChoseTrack(avId)
        return
    for track in self.pendingTracks:
        if (trackId == track):
            self.air.questManager.avatarChoseTrack(avId, self, self.pendingTrackQuest, trackId)
            self.pendingAvId = None
            self.pendingTracks = None
            self.pendingTrackQuest = None
            return
    self.notify.warning(('chooseTrack: avatar: %s chose a track not offered: %s' % (avId, trackId)))
    self.pendingAvId = None
    self.pendingTracks = None
    self.pendingTrackQuest = None
    return
def chooseTrack(self, trackId):
    avId = self.air.getAvatarIdFromSender()
    self.notify.debug(('chooseTrack: avatar %s choseTrack %s' % (avId, trackId)))
    if (not self.pendingAvId):
        self.notify.warning(('chooseTrack: not expecting an answer from any avatar: %s' % avId))
        return
    if (self.pendingAvId != avId):
        self.notify.warning(('chooseTrack: not expecting an answer from this avatar: %s' % avId))
        return
    if (trackId == (- 1)):
        self.pendingAvId = None
        self.pendingTracks = None
        self.pendingTrackQuest = None
        self.air.questManager.avatarCancelled(avId)
        self.cancelChoseTrack(avId)
        return
    for track in self.pendingTracks:
        if (trackId == track):
            self.air.questManager.avatarChoseTrack(avId, self, self.pendingTrackQuest, trackId)
            self.pendingAvId = None
            self.pendingTracks = None
            self.pendingTrackQuest = None
            return
    self.notify.warning(('chooseTrack: avatar: %s chose a track not offered: %s' % (avId, trackId)))
    self.pendingAvId = None
    self.pendingTracks = None
    self.pendingTrackQuest = None
    return