S>C 0x09 SID_GETADVLISTEX

Transport Layer:Transmission Control Protocol (TCP)
Application Layer:Battle.net v1 TCP Messages (SID)
Message Id:0x09
Message Name:SID_GETADVLISTEX
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) Number of games

If count is 0:
   (UINT32) Status

Otherwise, games are listed thus:
   For each list item:
      (UINT32) Game settings
      (UINT32) Language ID
      (UINT16) Address Family (Always AF_INET)
      (UINT16) Port
      (UINT32) Host's IP
      (UINT32) sin_zero (0)
      (UINT32) sin_zero (0)
      (UINT32) Game status
      (UINT32) Elapsed time (in seconds)
      (STRING) Game name
      (STRING) Game password
      (STRING) Game statstring

Remarks

Returns a list of available games and their information. Values vary depending on product.

  • The Game settings field is a combination of values.

    • WarCraft III (WAR3/W3XP): combine the below settings
      • Game type (mask 0x000000FF, unique)
        • 0x00000001: Custom
        • 0x00000009: Ladder
      • Public/private (mask 0x00000800, unique)
        • 0x00000000: Public game
        • 0x00000800: Private game
      • Map author ID (mask 0x00006000, combinable)
        • 0x00002000: Blizzard
        • 0x00004000: Custom
      • Battle/scenario (mask 0x00018000, unique)
        • 0x00000000: Battle
        • 0x00010000: Scenario
      • Map size (mask 0x000E0000, combinable)
        • 0x00020000: Small
        • 0x00040000: Medium
        • 0x00080000: Huge
      • Observers (mask 0x00070000, unique)
        • 0x00100000: Allowed observers ("Full Observers" and "Referees" options)
        • 0x00200000: Observers on defeat
        • 0x00400000: No observers
    • StarCraft and WarCraft II (STAR/SEXP/SSHR/JSTR/W2BN): combine the game type and sub-type values.
      • Game type (mask 0x000000FF, unique)
        • 0x00000001: Custom (WAR3/W3XP)
        • 0x00000002: Melee
        • 0x00000003: Free For All
        • 0x00000004: One vs One
        • 0x00000005: Capture the Flag
        • 0x00000006: Greed
        • 0x00000007: Slaughter
        • 0x00000008: Sudden Death
        • 0x00000009: Ladder
        • 0x00000010: Iron Man Ladder (W2BN)
        • 0x0000000A: Use Map Settings
        • 0x0000000B: Team Melee
        • 0x0000000C: Team Free For All
        • 0x0000000D: Team Capture the Flag
        • 0x0000000F: Top vs. Bottom
      • Game sub-type (mask 0xFFFF0000, unique): depends on the game type for what goes here.
        • For Greed (0x06):
          • 0x00010000: 2500 resources
          • 0x00020000: 5000 resources
          • 0x00030000: 7500 resources
          • 0x00040000: 10000 resources
        • For Slaughter (0x07):
          • 0x00010000: 15 minutes
          • 0x00020000: 30 minutes
          • 0x00030000: 45 minutes
          • 0x00040000: 60 minutes
        • For Ladder (0x09):
          • 0x00000000: Disconnects do not count as loss
          • 0x00010000: Disconnects count as loss
        • For Team Melee (0x0B), Team Free For All (0x0C), and Team Capture the Flag (0x0D):
          • 0x00010000: 2 teams
          • 0x00020000: 3 teams
          • 0x00030000: 4 teams
        • For Top vs. Bottom (0x0F):
          • 0x00010000: 1 v 7
          • 0x00020000: 2 v 6
          • 0x00030000: 3 v 5
          • 0x00040000: 4 v 4
          • 0x00050000: 5 v 3
          • 0x00060000: 6 v 2
          • 0x00070000: 7 v 1
        • For anything else, no sub-type is defined.
    • Diablo (DRTL/DSHR): used to specify a "level range". This ensures that clients receive a list of games containing players whose experience is similar to their own.
      • 0x00000000: Level 1
      • 0x00000001: Level 2 or 3
      • 0x00000002: Level 4 or 5
      • 0x00000003: Level 6 or 7
      • 0x00000004: Level 8 or 9
      • 0x00000005: Level 10 - 12
      • 0x00000006: Level 13 - 16
      • 0x00000007: Level 17 - 19
      • 0x00000008: Level 20 - 24
      • 0x00000009: Level 25 - 29
      • 0x0000000A: Level 30 - 34
      • 0x0000000B: Level 35 - 39
      • 0x0000000C: Level 40 - 47
      • 0x0000000D: Level 48 - 50
  • The Address Family, Port, Host's IP, and sin_zero fields form a sockaddr_in structure.

  • The Game status field varies by product.

    • WarCraft III (WAR3/W3XP):
      • 0x00000010: Public
      • 0x00000011: Private
    • Other products:
      When there are no entries returned, the Status field uses this list of results, as well.
      • 0x00000000: OK
      • 0x00000001: Game doesn't exist
      • 0x00000002: Incorrect password
      • 0x00000003: Game full
      • 0x00000004: Game already started
      • 0x00000005: Spawned CD-Key not allowed
      • 0x00000006: Too many server requests
  • The Game name field is UTF-8 encoded.

  • The Game password field is always empty on WarCraft III.

  • The Game statstring field contains more information that is very specific to each product.

    • WarCraft III (WAR3/W3XP):

      This field still conforms to being a null-terminated string by encoding the data such that there are no null characters within.
      The first 9 UINT8s are characters representing hexadecimal integers (0 through 9 and a through f).

      After this, the rest of the data is encoded in a manner in order to contain nulls when decoded, but be stored within this null-terminated string.
      The encoding is described here, but that forum is long dead...

      Data:
      • (CHAR) Number of free slots (ex: 7 for 7 free slots)
      • (CHAR) [8] Host counter (reversed hexadecimal integer, ex: 20000000 for second time this host has hosted during his session)
      • Encoded data:
        • (UINT32) Map flags (combine the below settings):
        • Game speed (mask 0x00000003, unique):
          • 0x00000000: Slow
          • 0x00000001: Normal
          • 0x00000002: Fast
        • Visibility setting (mask 0x00000F00, unique):
          • 0x00000100: Hide Terrain
          • 0x00000200: Map Explored
          • 0x00000400: Always Visible
          • 0x00000800: Default
        • Observers setting (mask 0x40003000, unique):
          • 0x00000000: No Observers
          • 0x00002000: Observers on Defeat
          • 0x00003000: Full Observers
          • 0x40000000: Referees
        • Other advanced host settings (mask 0x07064000, combinable):
          • 0x00004000: Teams Together (team members are placed at neighbored starting locations)
          • 0x00060000: Lock Teams
          • 0x01000000: Full Shared Unit Control
          • 0x02000000: Random Hero
          • 0x04000000: Random Races
        • (UINT8) Map null 1
        • (UINT8) Map width (playable area)
        • (UINT8) Map null 2
        • (UINT8) Map height (playable area)
        • (UINT8) Map null 3
        • (UINT32) Map CRC
        • (STRING) Map path
        • (STRING) Game host name
        • (UINT8) Map unknown (possibly a STRING with just the null terminator)
        • (UINT8) [20] Unknown (probably a SHA1 hash)
    • StarCraft and WarCraft II (STAR/SEXP/SSHR/JSTR/W2BN):

      These use a comma-delimited list of values. The fields have different formats, but they are either null strings (use default value), decimal integers (0 through 9), hexadecimal integers (0 through 9 and a through f), or plaintext strings. The encoding Latin1 is recommended for correct viewing; map names may be in UTF-8 or anything else, but will still be decoded as Latin1 by the client.

      The parameters are split into 12 parts, where some products may omit them, they're all in the same order.

      STAR/SEXP: 1,2,3,4,5,6,7,8,9,10,11,12

      JSTR/SSHR/W2BN: 1,2,3,4,5,6,8,9,10,12 (7 and 11 fields skipped)

      Numbered parts:
      1. Saved game
        1. Null: This game is not a save.
        2. Hex Integer: This is a saved game. The hex integer is a UINT32 (STAR/SEXP) or UINT16 (W2BN), and is probably a checksum of the save file.
      2. Map size
        1. Null: 128x128
        2. Two Digit Integer: Width and Height of the map, divided by 32. Ex: If this field is 43, then the size is "4*32x3*32" = "128x96".
      3. Max players
        1. Null: 8 Player Map
        2. Integer: Number of players allowed on the map, plus 10. Ex: 16 = 6 players
      4. Speed
        • STAR/SEXP/SSHR/JSTR products:
          • 0: Slowest
          • 1: Slower
          • 2: Slow
          • 3: Normal
          • 4/Null: Fast
          • 5: Faster
          • 6: Fastest
        • W2BN product:
          • 0: Slowest
          • 1: Even Slower
          • 2: Slower
          • 3: Slow
          • 4: Normal
          • 5/Null: Fast
          • 6: Faster
          • 7: Even Faster
          • 8: Fastest
      5. Approval
        • 0/Null: Not approved
        • 1: Blizzard approved
        • 2: Ladder approved
        • 3: PGL approved
        • 4: KBK approved
        • 5: CompUSA approved
      6. Game type
        • 2: Melee
        • 3: Free For All
        • 4: One vs One
        • 5: Capture the Flag
        • 6: Greed
        • 7: Slaughter
        • 8: Sudden Death
        • 9: Ladder
        • a: Use Map Settings
        • b: Team Melee (STAR/SEXP)
        • c: Team Free For All (STAR/SEXP)
        • d: Team Capture the Flag (STAR/SEXP)
        • f: Top vs Bottom
        • 10: Iron Man Ladder (W2BN)
        • 20: PGL (STAR/SEXP)
      7. Unknown (STAR/SEXP only)
        1. This field has only been observed to be Null.
      8. Game sub-type, based on game type
        • Melee, Free for All, One vs One, Capture the Flag, Sudden Death, Use Map Settings, PGL
          • 1: None
        • Greed
          • 1: 2500 Resources
          • 2: 5000 Resources
          • 3: 7500 Resources
          • 4: 10000 Resources
        • Slaughter
          • 1: 15 Minutes
          • 2: 30 Minutes
          • 3: 45 Minutes
          • 4: 60 Minutes
        • Ladder
          • 1: None
          • 2: Disconnect Counts as a Loss
        • Team Melee, Team Free for All, Team Capture the Flag
          • 1: 2 Teams
          • 2: 3 Teams
          • 3: 4 Teams
        • Top vs Bottom, where "X" below equals number of players in the max players field minus this value.
          • 1: 1 v X
          • 2: 2 v X
          • 3: 3 v X
          • 4: 4 v X
          • 5: 5 v X
          • 6: 6 v X
          • 7: 7 v X
          • Ex: If 6 max players and 2 in this field, then TvB is "2 vs 6 - 2" = "2 vs 4".
      9. CD-Key Checksum
        • This is a hex integer UINT32 checksum of the creator's CD-Key as generated by call to #502 in Storm.dll (SStrHash).
      10. Tileset (StarCraft)/Game settings (WarCraft II):
        • STAR/SEXP/SSHR/JSTR products use this field for the map tileset:
          • 0/Null: Badlands
          • 1: Space Platform
          • 2: Installation
          • 3: Ashworld
          • 4: Jungle
          • 5: Desert
          • 6: Arctic
          • 7: Twilight
        • W2BN product use this field for additional game settings as well as map tileset, use masks:
          • Game options (mask 0x00F00, combinable):
            • 0x00200: One Peon
            • 0x00400: Fixed Order
          • Resources (mask 0x23000, unique):
            • 0x00000: Default
            • 0x01000: Low
            • 0x02000: Medium
            • 0x03000: High
            • 0x20000: Random
          • Map tileset (mask 0x1C000, unique):
            • 0x00000: Default
            • 0x04000: Forest
            • 0x08000: Winter
            • 0x0C000: Wasteland
            • 0x14000: Random
            • 0x1C000: Orc Swamp
      11. Replay (STAR/SEXP only)
        • 0/Null: This game is not a replay.
        • 1: Game replay.
      12. Creator/Map
        • Format: Host name + (UINT8) 0x0D + Map name + (UINT8) 0x0D
    • Diablo (DRTL/DSHR):

      This game uses a 3-part (UINT8) 0x0D -delimited statstring in the following pattern:
      1. Difficulty setting:
        • 0: Normal
        • 1: Nightmare
        • 2: Hell
      2. Host name: The name of the game's creator.
      3. Creator statstring: The statstring of the game's creator. See Chat Statstrings for DRTL/DSHR.
    • Diablo II (D2DV/D2XP) game statstrings are either a null string or contain a single digit, usually a 1 or a 2. No information has yet been documented on it.
| Edited: Leaky

Comments

Ribose

Updated for WarCraft III, thanks to RealityRipple.