Bug - Fixed get_player_id() and get_player_name() seem bugged.

Aenimus

Member
Code:
> ash "canart".get_player_id()

Returned: canart

> ash get_player_id("canart")

Returned: canart

> ash get_player_name(2273519)

Returned: 2273519

But occasionally it works:

Code:
> ash "aenimus".get_player_id()

Returned: 2273519
 

Veracity

Developer
Staff member
I looked at both of those functions. They go to ContactManager, which registers names/ids from your contact list, kmail, messages in chat, and so on.
If a name or id is known, it's a simple lookup. If not, the ContactManager will do "/whois" with the name or number and enter the results in its database.

Turns out that get_player_id() was doing that, but get_player_name was not. Revision 20059 forces a /whois for get_player_name if the contact is not known.

I don't know why it sometimes returns a number for the name or the name for the id. I'll poke some more.
 

Veracity

Developer
Staff member
I am not reproducing this any more after forcing the /whois.

Both get_player_name and get_player_id called methods that would return the input argument if the name or id respectively was not in the database and they were not told to do a /whois to look it up. Since only get_player_name didn't force such a lookup, I do not see how get_player_id in your examples would return the name.

But, at this point, it "works for me".

How about you?
 
Top