Valhalla Legends Forums Archive | Battle.net Bot Development | enterchat and joinchannel packets

AuthorMessageTime
soccerist
I was comparing some packets on bnetdocs and the ones I logged for brood war. I was wondering if anyone knew more about the login sequence.

On bnetdocs, there's a packet SID_JOINCHANNEL, that joins a channel after enterchat. Looking at my logs, it looks as if bw never sends this, but instead bw first requests (and receives) available channels and then automatically gets put into a channel. (no need to manually join one). Also, I've noted that typing /join <channel> doesn't use the SID_JOINCHANNEL either. It just sends it as if it were a mere chat message. How is this SID_JOINCHANNEL packet supposed to work?

My second question has to do with the SID_ENTERCHAT packet. Does the server always send this back? I get it back in my logs, but I just wanted to confirm this.


Can anyone clear these questions up for me? THx
April 24, 2004, 12:55 AM
Noodlez
SID_JOINCHANNEL is always sent, Brood War doesn't use the channel listing for joining upon connection, it places you in BW USA-1(something like that). You probably aren't seeing SID_JOINCHANNEL.
April 24, 2004, 1:31 AM
Lenny
Brood War sends SID_JOINCHANNEL after login....

[quote]
Packet ID: 0x0C
Direction: Client -> Server (Sent)
Format:
(DWORD)       Flags
(STRING)       Channel

Remarks: Joins a channel after entering chat.
[/quote]

The Flags value is 0x01 for joining a product specific channel such as Brood War USA-1 (Channel value does not matter)

The Flags value is 0x02 for joining a specified channel, the Channel value is the specified channel
April 24, 2004, 1:57 AM
soccerist
[quote author=Lenny link=board=17;threadid=6443;start=0#msg56539 date=1082771861]

The Flags value is 0x01 for joining a product specific channel such as Brood War USA-1 (Channel value does not matter)

The Flags value is 0x02 for joining a specified channel, the Channel value is the specified channel
[/quote]

Cool, thanks. I'll that out and do a little experimentation. I'm curious as to how you got those flag values though.
April 24, 2004, 2:39 AM
Tuberload
http://camel.ik0ns.com:86/wiki/index.php/BNCS_0x0C
April 24, 2004, 6:58 AM
soccerist
Interesting. According to that camel.ik0ns.com site, I don't really see the difference in the flag 0x00 and 0x02. 0x02 will let you join full channels?

Also, another question, how does this packet differ from just sending 0x0E: SID_CHATCOMMAND of "/join <channel>" later on?
April 24, 2004, 11:40 AM
UserLoser.
[quote author=soccerist link=board=17;threadid=6443;start=0#msg56579 date=1082806859]
Interesting. According to that camel.ik0ns.com site, I don't really see the difference in the flag 0x00 and 0x02. 0x02 will let you join full channels?

Also, another question, how does this packet differ from just sending 0x0E: SID_CHATCOMMAND of "/join <channel>" later on?
[/quote]

0x00 will tell you if the channel is restricted, full, or does not exist. If the channel does not exist, you would then send the packet back with flag 0x2, and that "creates" the channel.
April 24, 2004, 7:33 PM
Myndfyr
[quote author=soccerist link=board=17;threadid=6443;start=0#msg56579 date=1082806859]
Also, another question, how does this packet differ from just sending 0x0E: SID_CHATCOMMAND of "/join <channel>" later on?
[/quote]

When you're not "in chat," you can't send /join <channel>. So, at the very least, you are forced into using 0x0c when you first enter chat.
April 24, 2004, 8:53 PM
soccerist
Ah, I see.

Thanks very much guys. :D
April 24, 2004, 11:32 PM
Skywing
To clarify, /whois and the like will not mark you as logged on if you haven't sent SID_ENTERCHAT, and sending any chat-related messages at this point will cause you to get banned.

After sending SID_ENTERCHAT but before sending SID_JOINCHANNEL, a message something like this will be displayed if somebody uses whois on you:

username is using client in server

You cannot join a channel without using SID_JOINCHANNEL at this point; /join and /channel don't work unless you are already in a channel. This is (presumably) to prevent people from joining channels while they are playing a game with Blizzard's clients.
April 25, 2004, 5:46 PM
Soul Taker
[quote author=Skywing link=board=17;threadid=6443;start=0#msg56856 date=1082915210]
To clarify, /whois and the like will not mark you as logged on if you haven't sent SID_ENTERCHAT, and sending any chat-related messages at this point will cause you to get banned.

After sending SID_ENTERCHAT but before sending SID_JOINCHANNEL, a message something like this will be displayed if somebody uses whois on you:

username is using client in server

You cannot join a channel without using SID_JOINCHANNEL at this point; /join and /channel don't work unless you are already in a channel. This is (presumably) to prevent people from joining channels while they are playing a game with Blizzard's clients.
[/quote]
I don't think that would be the reason, because you can just opt to never leave chat when you join games, and continue to chat in channels at the same time as being in a game.
April 25, 2004, 6:35 PM
Myndfyr
[quote author=Soul Taker link=board=17;threadid=6443;start=0#msg56864 date=1082918133]
[quote author=Skywing link=board=17;threadid=6443;start=0#msg56856 date=1082915210]
To clarify, /whois and the like will not mark you as logged on if you haven't sent SID_ENTERCHAT, and sending any chat-related messages at this point will cause you to get banned.

After sending SID_ENTERCHAT but before sending SID_JOINCHANNEL, a message something like this will be displayed if somebody uses whois on you:

username is using client in server

You cannot join a channel without using SID_JOINCHANNEL at this point; /join and /channel don't work unless you are already in a channel. This is (presumably) to prevent people from joining channels while they are playing a game with Blizzard's clients.
[/quote]
I don't think that would be the reason, because you can just opt to never leave chat when you join games, and continue to chat in channels at the same time as being in a game.
[/quote]

How is that? Not in any game client, certainly. Perhaps in a bot that doesn't follow the Bncs protocol correctly by not sending SID_LEAVECHAT before joining a game.
April 25, 2004, 6:38 PM
Skywing
[quote author=Soul Taker link=board=17;threadid=6443;start=0#msg56864 date=1082918133]
[quote author=Skywing link=board=17;threadid=6443;start=0#msg56856 date=1082915210]
To clarify, /whois and the like will not mark you as logged on if you haven't sent SID_ENTERCHAT, and sending any chat-related messages at this point will cause you to get banned.

After sending SID_ENTERCHAT but before sending SID_JOINCHANNEL, a message something like this will be displayed if somebody uses whois on you:

username is using client in server

You cannot join a channel without using SID_JOINCHANNEL at this point; /join and /channel don't work unless you are already in a channel. This is (presumably) to prevent people from joining channels while they are playing a game with Blizzard's clients.
[/quote]
I don't think that would be the reason, because you can just opt to never leave chat when you join games, and continue to chat in channels at the same time as being in a game.
[/quote]
I don't think that you will be able to do that without using a third party client or hacking one of Blizzard's clients. Those cases are outside the scope of my statement.
April 26, 2004, 6:17 AM
tA-Kane
[quote author=Skywing link=board=17;threadid=6443;start=0#msg56856 date=1082915210]After sending SID_ENTERCHAT but before sending SID_JOINCHANNEL, a message something like this will be displayed if somebody uses whois on you:

username is using client in server[/quote]Note that this only works when you have already sent SID_JOINCHANNEL at least once. If you send SID_ENTERCHAT, but do not send SID_JOINCHANNEL, Battle.net will ignore any text you send (or, at the very least, any /whoami commands you send). So, to get the "oddball" whois response, you must send SID_ENTERCHAT, SID_JOINCHANNEL, SID_LEAVECHAT, and then that's when you may /whois yourself.

Also note that these "oddball" whois messages do not have a period at the end of the message.

My bot uses this method to identify what the server calls itself, which is useful for knowing what your gateway is according to people on other gateways (such as identifying your "normal" gateway according to WarCraft 3 users, and vice versa). Take these examples:

You are MacBinaryBot, using Starcraft in USEast
You are tA-Kane, using WarCraft III in Azeroth

Or, as visible from other users:
MacBinaryBot is using Starcraft in USEast
tA-Kane is using WarCraft III in Azeroth

MacBinaryBot would see tA-Kane@Azeroth, and tA-Kane would see MacBinaryBot@USEast.

This is especially useful when two different people have the same account name on two different gateways, yet you want to use the same bot database for both gateways! For example, when user "SomeUser" on USEast enters the channel, you could automatically append "@USEast" to the user's name, and the user's properties (in particular, their accessable commands) are then separate from, say for example, "SomeUser" on the USWest gateway. A very nice feature, in my opinion!
April 26, 2004, 9:00 AM

Search