Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Don Cullen on July 21, 2006, 04:18 PM

Title: [Solved] Simple: How to detect that I'm banned from channel?
Post by: Don Cullen on July 21, 2006, 04:18 PM
How do I detect that I'm banned from a channel upon connecting to bnet and attempting to join the default channel?

All my bot says is that ive been redirected to the channel The Void... My apologies if this seems too simplish. Thanks in advance for any and all assistance.
Title: Re: Simple: How to detect that I'm banned from channel?
Post by: topaz on July 21, 2006, 04:50 PM
Set your bot to join the product-specified channels, and then send a join to your channel.
Title: Re: Simple: How to detect that I'm banned from channel?
Post by: Don Cullen on July 21, 2006, 04:55 PM
So in short, there's no way to detect being banned upon directly entering the default channel?
Title: Re: Simple: How to detect that I'm banned from channel?
Post by: Hero on July 21, 2006, 07:34 PM
When you enter bnet, if your banned from a channel it should say you are (EID_ERROR or EID_INFO), and if you still try to enter the channel I'm guessing it would only make sense to send you into the void.
Title: Re: Simple: How to detect that I'm banned from channel?
Post by: Spht on July 21, 2006, 07:40 PM
Sounds like you're using SID_JOINCHANNEL (http://bnetdocs.valhallalegends.com/content.php?Section=m&Code=34) force join which will always put you in a channel even if the one you supplied isn't accessible.  This is what the actual Blizzard clients use to get you in chat.

Use what Bnetdocs calls "no-create join" and you will get EID_CHANNELFULL / EID_CHANNELDOESNOTEXIST / EID_CHANNELRESTRICTED back appropriately if the channel is inaccessible.

Send a text join and you will also get back appropriate errors as EID_ERROR, from which you can determine if the reason is a ban.
Title: Re: Simple: How to detect that I'm banned from channel?
Post by: Don Cullen on July 22, 2006, 08:54 AM
I get back 'channel is restricted'. Is there any way to be able to tell whether the user has been banned from channel, or whether the channel (if its a clan channel) has been set to private?
Title: Re: Simple: How to detect that I'm banned from channel?
Post by: Spht on July 22, 2006, 10:29 AM
Quote from: Kyro on July 22, 2006, 08:54 AM
Is there any way to be able to tell whether the user has been banned from channel

Yes, I already explained that.

Quote from: Kyro on July 22, 2006, 08:54 AMor whether the channel (if its a clan channel) has been set to private?

Yes, you get "You do not have permission to view that channel." error instead of "(If you are trying to search for a user, use the /whois command.)" when you try to /who a private channel.
Title: Re: Simple: How to detect that I'm banned from channel?
Post by: Don Cullen on July 22, 2006, 10:45 AM
In other words, no easy way to do it. Thanks.
Title: Re: [Solved] Simple: How to detect that I'm banned from channel?
Post by: Hero on July 22, 2006, 10:55 PM
Actually it's pretty easy.
Title: Re: [Solved] Simple: How to detect that I'm banned from channel?
Post by: Don Cullen on July 22, 2006, 11:12 PM
I meant using the force channel enter packet. I was using &H2, but since that doesn't return an error, I had to switch to normal channel enter packet so I could trap the error. I dislike using the normal packet mainly because if a channel is empty, I want it to be created automatically like it does with &H2. It's okay, I set up code to trap the nonexistent channel error so it'd automatically send a force channel join packet to create the channel. Just wanted to do it in one shot instead of two.