• Welcome to Valhalla Legends Archive.
 

enterchat and joinchannel packets

Started by soccerist, April 23, 2004, 07:55 PM

Previous topic - Next topic

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

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.

Lenny

#2
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.

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
The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.

soccerist

#3
Quote from: Lenny on April 23, 2004, 08:57 PM

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

Cool, thanks.  I'll that out and do a little experimentation.  I'm curious as to how you got those flag values though.

Tuberload

Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

soccerist

#5
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?

UserLoser.

Quote from: soccerist on April 24, 2004, 06:40 AM
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?

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.

MyndFyre

Quote from: soccerist on April 24, 2004, 06:40 AM
Also, another question, how does this packet differ from just sending 0x0E: SID_CHATCOMMAND of "/join <channel>" later on?

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.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

soccerist

Ah, I see.  

Thanks very much guys.   :D

Skywing

#9
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.

Soul Taker

Quote from: Skywing on April 25, 2004, 12:46 PM
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.
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.

MyndFyre

Quote from: Soul Taker on April 25, 2004, 01:35 PM
Quote from: Skywing on April 25, 2004, 12:46 PM
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.
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.

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.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Skywing

#12
Quote from: Soul Taker on April 25, 2004, 01:35 PM
Quote from: Skywing on April 25, 2004, 12:46 PM
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.
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.
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.

tA-Kane

Quote from: Skywing on April 25, 2004, 12:46 PMAfter 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
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!
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com