S>C 0x0F SID_CHATEVENT

Transport Layer:Transmission Control Protocol (TCP)
Application Layer:Battle.net v1 TCP Messages (SID)
Message Id:0x0F
Message Name:SID_CHATEVENT
Direction:Server to Client
Used By:Starcraft Original, Starcraft Broodwar
Starcraft Shareware, Starcraft Japanese
Diablo Retail, Diablo Shareware
Diablo II, Diablo II Lord of Destruction
Warcraft II BNE, Warcraft III Reign of Chaos
Warcraft III The Frozen Throne
Message Format:
(does not include protocol header)
(UINT32) Event ID
(UINT32) User's Flags
(UINT32) Ping
(UINT32) IP Address *
(UINT32) Account number *
(UINT32) Registration Authority *
(STRING) Username
(STRING) Text **

Remarks

Contains all chat events.

* These fields are defunct and should always be received as value 0x00000000 or a debugging value such as 0xbaadf00d (see this article on Wikipedia for more info).

** For STAR/SEXP/SSHR/JSTR, this field is UTF-8 encoded. For all other clients, it is ISO 8859-1 encoded. It must also be no longer than 255 characters; official clients should only be able to send 224 characters (including the null-terminator).

Event IDs:

0x01 EID_SHOWUSER: User in channel
0x02 EID_JOIN: User joined channel
0x03 EID_LEAVE: User left channel
0x04 EID_WHISPER: Recieved whisper
0x05 EID_TALK: Chat text
0x06 EID_BROADCAST: Server broadcast
0x07 EID_CHANNEL: Channel information
0x09 EID_USERFLAGS: Flags update
0x0A EID_WHISPERSENT: Sent whisper
0x0D EID_CHANNELFULL: Channel full
0x0E EID_CHANNELDOESNOTEXIST: Channel doesn't exist
0x0F EID_CHANNELRESTRICTED: Channel is restricted
0x12 EID_INFO: Information
0x13 EID_ERROR: Error message
0x15 EID_IGNORE: Notifies that a user has been ignored (DEFUNCT)
0x16 EID_ACCEPT: Notifies that a user has been unignored (DEFUNCT)
0x17 EID_EMOTE: Emote

EID_SHOWUSER:

  • This is sent for each user who is already in a channel when you join it, as opposed to EID_JOIN, which is sent when a user joins a channel you have already joined. It is also sent when logged on using D2XP/D2DV and a user requires an update to their statstring - for example, by logging a different character onto a realm.
  • The text value is the user's statstring.

EID_JOIN:

  • This is sent when a user enters the channel you are currently in.
  • The text value is the user's statstring.

EID_LEAVE:

  • This is sent when a user exits the channel you are currently in.
  • The text value is an empty string.

EID_WHISPER:

  • This is sent when a user whispers you.

EID_TALK:

  • This is sent when a user (excluding self) in chat speaks.

EID_BROADCAST:

  • This is sent when a server announcement is being made globally.
  • The username supplied for this event is now always Battle.net. Historically, the username was the name of the Battle.net Administrator who sent the broadcast.

EID_CHANNEL:

  • The flags field for this event is used and indicates what special conditions exist for the channel in question. See Battle.net Flags for more information.

EID_USERFLAGS:

  • This is sent to inform the client of an update to one or more user's flags.
  • Battle.net usually sends this event for every user in the channel, even if only one user's flags have changed. This behavior can be exploited to detect invisible users, by performing an action (such as an unsquelch) to provoke a flags update. Users included in the flags update whose presence has not been indicated by EID_JOIN or EID_SHOWUSER can then be added to the userlist as invisible. Care should be taken, however, to account for the possibility that an asynchronous send error has occurred. Should an EID_JOIN or EID_SHOWUSER event occur for an invisible user, they should be marked as a normal user, not readded to the userlist.
  • Some 3rd party server implementations also use this for dynamic ping updates.

EID_WHISPERSENT:

  • The Flags and Ping fields in this packet is equal to the originating user - the one who sent the whisper. In other words, EID_WHISPERSENT contains your flags & ping, not those of the person you whispered.

EID_CHANNELDOESNOTEXIST:

  • See info on NoCreate Join in SID_JOINCHANNEL.
  • It is probably safe to assume that the text and user data for this message follows that of EID_CHANNELRESTRICTED.

EID_CHANNELRESTRICTED:

  • This is sent when attempting to join a channel which your client is not allowed to join.
  • The text field contains the channel name.
  • The user data is your own.

EID_INFO:

  • This is information supplied by Battle.net. This text is displayed in different colors depending on the client.
  • The user data in this event is usually that of the user that triggered the event. For example the response to the /whoami command will come from yourself, but a ban message will come from the operator who issued the ban.

EID_ERROR:

  • This is error information supplied by Battle.net. This text is usually displayed by clients in red.
  • The user data in this event usually follows the same rules as EID_INFO.

EID_EMOTE:

  • This is sent when any user (including self) uses the emote feature in chat.
| Edited: joe[x86]

Comments

Heinermann

Event IDs:

[0x15] EID_IGNORE: (Starcraft) notifies that a user has been ignored
[0x16] EID_ACCEPT: (Starcraft) notifies that a user has been unignored

Caaaaarrrrlll

Where's your packet logs for these Event ID's?

Heinermann

They are defunct and were tested through packet interception and modification.

I was testing each event for a universal text display (recv hook) in Starcraft and discovered it there.

Sixen

Added EID_IGNORE and EID_ACCEPT.

Heinermann

Enum in wc3tft beta:

0x04 CHATEVENT_ID_WHISPER
0x05 CHATEVENT_ID_TALK
0x06 CHATEVENT_ID_BROADCAST
0x0A CHATEVENT_ID_WHISPERSENT
0x12 CHATEVENT_ID_INFORMATION
0x17 CHATEVENT_ID_EMOTE
default CHATEVENT_ID_ERROR

There's an event 0x0B in Diablo Beta, unable to test it out or find out what it does

Sixen

Random stuff... Color codes for each game:

WC3: |c
|c00ff0000red |c0000ff00green |c000000ffblue |r0

D2: ÿc
ÿc11 ÿc22 ÿc33 ÿc44 ÿc55 ÿc66 ÿc77 ÿc88 ÿc99 ÿc00

SC: Á
ÁQQ ÁRR ÁZZ ÁYY ÁVV ÁTT ÁW0