Public bug reported:

It seems that when a "nick" is used 2 times in the hub the clientmanager
deletes the userdata for both.

Have tryed this as a test to avoid "same nicks" i the hub in access.lua
the bellow works fine on the first attempt and disconnects the user but
on a second try the cm:findByNick(nick) returs nil alto there is still a
user with that nick connected.

in onINF

        local userOnline = verify_online(nick)
        base.print(userOnline)
        if userOnline then
                local message = base.tostring("Your nickname ( " .. nick .. " ) 
is curently used in this hub by another client, please use another nick or try 
again later.")
                autil.dump(c, adchpp.AdcCommand_ERROR_PROTOCOL_GENERIC, message)
                return false
        end

and the function that verify's

local function verify_online(nick)
        local userOnline
        base.print(cm:findByNick(nick))
        if cm:findByNick(nick) then
                while cm:findByNick(nick) do
                        victim = cm:findByNick(nick)
                        base.print(victim)
                        userOnline = victim:asClient()
                        if userOnline:getState() ~= 
adchpp.Entity_STATE_IDENTIFY then
                                return userOnline
                        end
                end
        end
        return userOnline
end

** Affects: adchpp
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of
Dcplusplus-team, which is subscribed to ADCH++.
https://bugs.launchpad.net/bugs/719955

Title:
  Client Manager seems to remove ...

Status in ADCH++:
  New

Bug description:
  It seems that when a "nick" is used 2 times in the hub the
  clientmanager deletes the userdata for both.

  Have tryed this as a test to avoid "same nicks" i the hub in
  access.lua the bellow works fine on the first attempt and disconnects
  the user but on a second try the cm:findByNick(nick) returs nil alto
  there is still a user with that nick connected.

  in onINF

        local userOnline = verify_online(nick)
        base.print(userOnline)
        if userOnline then
                local message = base.tostring("Your nickname ( " .. nick .. " ) 
is curently used in this hub by another client, please use another nick or try 
again later.")
                autil.dump(c, adchpp.AdcCommand_ERROR_PROTOCOL_GENERIC, message)
                return false
        end

  and the function that verify's

  local function verify_online(nick)
        local userOnline
        base.print(cm:findByNick(nick))
        if cm:findByNick(nick) then
                while cm:findByNick(nick) do
                        victim = cm:findByNick(nick)
                        base.print(victim)
                        userOnline = victim:asClient()
                        if userOnline:getState() ~= 
adchpp.Entity_STATE_IDENTIFY then
                                return userOnline
                        end
                end
        end
        return userOnline
  end



_______________________________________________
Mailing list: https://launchpad.net/~linuxdcpp-team
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~linuxdcpp-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to