Valhalla Legends Forums Archive | BnetDocs Research and Discussion | Request for Research: The Starcraft Game Protocol

AuthorMessageTime
Arta
BnetDocs lacks any information whatsoever on this protocol, sometimes named CLS. If anybody is interested in researching this area, and possibly becoming the editor responsible for maintaining the information published on BnetDocs, they should get in touch.
July 6, 2005, 2:20 PM
Kp
I have no interest in contributing my information, but I can tell you why it's sometimes dubbed CLS.  Starcraft and Diablo both use Storm.dll for constructing and transmitting their messages, so notation developed in reversing Diablo is sometimes carried over to Starcraft.  Adron dubbed one of the fields in the storm header "class" for reasons I do not know.  That field differentiates among storm control messages, asynchronous events, and synchronous events.  Hence, a "class 2" refers to any message which has a 2 in the class field of the header, or any traffic which it would make sense to place in that slot.  Starcraft commands are mostly transferred in the synchronous stream, which accounts both for the delay between click and action, and the game's ability to remain synchronized even in highly lossy conditions.
July 6, 2005, 11:26 PM
Ringo
Thats a interesting descution, i was talking to archangle about it yesderday.

My old bot supports most of the protocol, and iv never needed to call storm functions..
Unless i missed somthing, could you please explain more?
(Or do you mean the UDP checksum fuinctions?)
Im kinda lost by what you mean.
July 6, 2005, 11:47 PM
Myndfyr
I believe he's talking about the Diablo I and Starcraft game protocols, not D2GS.
July 6, 2005, 11:58 PM
UserLoser.
[quote author=Ringo link=topic=12107.msg119342#msg119342 date=1120693665]
Thats a interesting descution, i was talking to archangle about it yesderday.

My old bot supports most of the protocol, and iv never needed to call storm functions..
Unless i missed somthing, could you please explain more?
(Or do you mean the UDP checksum fuinctions?)
Im kinda lost by what you mean.

[/quote]

One point of writing a bot is to not use Blizzard's clients, therefore, like you said, you wouldn't be using Storm.dll for any message handling/building since you do it all your self.  I'm not sure what you mean exactly, but the UDP checksum function used in this protocol is somewhere in Storm.dll
July 7, 2005, 12:00 AM
Ringo
Ah, i get what he means now.
My mistake, thanks.

July 7, 2005, 12:03 AM
Archangel
Skywing:

[quote]
The header you are working with is specific to the Storm UDP protocol
and is ot ever assembled or viewed by the game protocol module itself.  Thus
only ontrol messages for the Storm UDP protocol use the command field.

The way this is laid out can be represented something like this:

-----------------
-- Storm Header--
-----------------
-- Data Payload -
-----------------

Storm.dll receives the data off the wire, and interprets class 0
control messages directly, instead of passing them on to the game (except
perhaps in the form of high level callbacks, such as a "player joined the game"
callback or event).

For non-class0 messages, the data payload is passed uninterpreted on to
the game protocol parser itself, whether that be in Diablo.exe,
Starcraft.exe,
etc:

-----------------
-- Data Payload -
-----------------

Since the main game module never sees the Storm header, command ids for
other than the internal control class can't be stored there.

Note that I am logically equating Storm.dll and the Storm network
service provider (SNP) as the same module.  In reality, the SNP is responsible
for sending and receiving the game data off of the wire, whether that be a
UDP socket or an IPX socket, or just an internal loopback (e.g. standard.snp).

Class 1 is used for messages that do not need to be synchronized with
the game state, such as chat commands.  Thus, class 1 commands can be sent
and received at any time.

Class 2 is used for messages that do need to be synchronized with the
game state, such as unit orders.  Thus, class 2 commands can only be sent
once each game turn (as a result they are typically queued internally inside
the game protocol module until the next turn is transmitted).

At this time I do not have a list of Starcraft game protocol commands
in other than source code form, which I am not prepared to distribute.
[/quote]
July 7, 2005, 2:59 PM
Archangel
Lets post the very 1st thing that is needed to know:
Packet Format:
(DWORD) 0x00
(WORD) Checksum
(WORD) Length
(WORD) Sent
(WORD) Recved
(BYTE) Command Class
(BYTE) Command
(BYTE) Sender ID
(BYTE) Resend
(VOID) Packet

[If i am wrong, i am looking for corrections]
July 8, 2005, 1:28 AM
Archangel
The UDP Checksum [Visual Basic]:

[code]
Private Function RShift(ByVal pnValue As Long, ByVal pnShift As Long) As Double
On Error Resume Next
    RShift = CDbl(pnValue \ (2 ^ pnShift))
End Function

Private Function LShift(ByVal pnValue As Long, ByVal pnShift As Long) As Double
On Error Resume Next
    LShift = CDbl(pnValue * (2 ^ pnShift))
End Function

Private Function SubCheckSum(ByVal buf As String, ByVal length As Integer) As Long
    Dim sum1, sum2
    Dim i As Integer, iY As Integer
        For iY = 0 To length - 1
            i = length - iY
            sum2 = sum2 + Asc(Mid(buf, i, 1))
            If sum2 > &HFF Then
                sum2 = sum2 - &HFF
            End If
            sum1 = sum1 + sum2
        Next iY
        SubCheckSum = (LShift((sum2 And &HFF), 8)) Or ((sum1 Mod &HFF) And &HFF)
End Function

Private Function UDPCheckSum(buf As String) As Integer
    Dim subsum As Long, length As Integer
    Dim a As Long, b As Long, Ret As Integer
        CopyMemory length, ByVal Mid$(buf, 3, 2), 2
        length = length - 2
        subsum = SubCheckSum(Mid$(buf, 3), length)
        a = &HFF - ((subsum And &HFF) + (RShift(subsum, 8))) Mod &HFF
        b = CLng((((&HFF - (a + RShift(subsum, 8)) Mod &HFF) And &HFF) Or LShift(a, 8)))
        CopyMemory Ret, b, 2
        UDPCheckSum = Ret
End Function
[/code]
July 14, 2005, 5:20 PM
PiaNKA
[quote author=Archangel link=topic=12107.msg119564#msg119564 date=1120786120]
Lets post the very 1st thing that is needed to know:
Packet Format:
(DWORD) 0x00
(WORD) Checksum
(WORD) Length
(WORD) Sent
(WORD) Recved
(BYTE) Command Class
(BYTE) Command
(BYTE) Sender ID
(BYTE) Resend
(VOID) Packet

[If i am wrong, i am looking for corrections]
[/quote]

Ahem, we discussed if you were to release anything that we'd done, my name was to be on it as well and you might as well post the rest of the research.
July 20, 2005, 9:25 PM
Quarantine
He didn't put his name on it, as it was a contribution by him and him being a co-author I don't see the problem is. You want your name on a structure battle.net wrote, amazing.
July 20, 2005, 9:38 PM
UserLoser.
[quote author=PiaNKA link=topic=12107.msg121407#msg121407 date=1121894734]
[quote author=Archangel link=topic=12107.msg119564#msg119564 date=1120786120]
Lets post the very 1st thing that is needed to know:
Packet Format:
(DWORD) 0x00
(WORD) Checksum
(WORD) Length
(WORD) Sent
(WORD) Recved
(BYTE) Command Class
(BYTE) Command
(BYTE) Sender ID
(BYTE) Resend
(VOID) Packet

[If i am wrong, i am looking for corrections]
[/quote]

Ahem, we discussed if you were to release anything that we'd done, my name was to be on it as well and you might as well post the rest of the research.
[/quote]

I thought Adron came up with the names to each part, then released it publically?

[If I am wrong, I am looking for a correction]
July 20, 2005, 11:26 PM
Archangel
[quote author=PiaNKA link=topic=12107.msg121407#msg121407 date=1121894734]
[quote author=Archangel link=topic=12107.msg119564#msg119564 date=1120786120]
Lets post the very 1st thing that is needed to know:
Packet Format:
(DWORD) 0x00
(WORD) Checksum
(WORD) Length
(WORD) Sent
(WORD) Recved
(BYTE) Command Class
(BYTE) Command
(BYTE) Sender ID
(BYTE) Resend
(VOID) Packet

[If i am wrong, i am looking for corrections]
[/quote]

Ahem, we discussed if you were to release anything that we'd done, my name was to be on it as well and you might as well post the rest of the research.
[/quote]

The reseach got your name in it, i wont go posting your name in every post i make lol.
But you are right.
That info is on Piankas & ArchAngel research. sorry ^^

UserLoser? Why dont you post usefull stuff?
July 21, 2005, 4:26 AM
shout
[quote author=Archangel link=topic=12107.msg121504#msg121504 date=1121920011]
UserLoser? Why dont you post usefull stuff?
[/quote]

Because UserLoser is a god, he needs not go out of his way for mere mortals.

I have packetlogged quite a few packets using WPEPro that do not follow this format at all, could it be something about WPEPro? The ones I captured seemed to have something like this:

[code]
(WORD) Length
(WORD) 0x00
(DWORD) Unknown, ID?
(VOID) Packet
[/code]

By the way I was using a LAN game to capture them, not Battle.net.
July 21, 2005, 4:29 AM
PiaNKA
Sorry, wasn't trying to be bitchy, I just figured you'd put the rest of the stuff up there.

UL: Not that I had ever come across :-\
July 21, 2005, 4:20 PM
Ringo
I was re-doing a few things to my chat bot today, one of witch was to refresh my ingame UDP support for all older clients, mainly to check for changes in the latest patch's.
Why i was doing this, i decided to document some of the command2 packets as i went long.

Hope this comes in helpfull to anyone adding SC/BW UDP ingame protocol to there bot:
(Feel free to correct mistakes, and unknowns)


[EDIT]: oops, incoming packet header format for command 2:
[color=yellow]
00 00 00 00 92 11 0D 00 9E 03 9E 03 02 00 05 00

(DWORD) Null Padding - 00 00 00 00
(WORD) UDP Checksum - 92 11
(WORD) Packet Lengh (Discludes null-padding) - 0D 00
(WORD) Sent Packets To Player - 9E 03
(WORD) Recv Packets From Player - 9E 03
(BYTE) Packet Type/command - 02
(BYTE) Unused - 00
(BYTE) Senders Player ID - 05
(BYTE) Status - 00
(VOID) Packets
[/color]





[size=6]0x09[/size]
In Game - Unit Click/Selection
Lengh = 2 + (2nd byte * 2)
[color=yellow]
09 01 5D 0E
(BYTE) Num of Units selected
~For each unit selected~
(WORD) Unit ID
[/color]
This packet notifys ALL other ingame players of new unit selections.



[size=6]0x0A[/size]
In Game - Add Unit To Selection
Lengh = 2 + (2nd byte * 2)
[color=yellow]
0A 01 2C 0E
(BYTE) Num of Units selected
~For each unit selected~
(WORD) Unit ID
[/color]
This packet notifys ALL other ingame players of new units being add to the selection buffer.



[size=6]0x0C[/size]
In Game - Building being constructed/now Landing
Lengh = 8
[color=yellow]
0C 1F 09 00 5C 00 9C 00
(BYTE) Unknown
(WORD) Map Square X
(WORD) Map Square Y
(WORD) Building's Unique Code
[/color]
This packet notifys ALL other ingame players when a peon is commanded to build a building, or when a building is commanded to land on the map.



[size=6]0x14[/size]
In Game - Move Selected Units
Lengh = 10
[color=yellow]
14 8E 00 75 0F 00 00 E4 00 00
(WORD) Location X
(WORD) Location Y
(WORD) Unit ID
(WORD) Unknown - 0xE4
(BYTE) Unknown - 0x00
[/color]
This packet notifys ALL other ingame players when you click to move your selected units to a location to the map/another unit.
If the unit ID field is null, then the location is map, otherwise it should specify the unit ID your now moveing your selected units to, in witch case the correct action would automaticly be triggerd. (like mine a mineral for IE)



[size=6]0x15[/size]
In Game - Selected Units Action
Lengh = 11
[color=yellow]
15 76 00 37 0B 59 0E E4 00 4F 00
(WORD) Location X
(WORD) Location Y
(WORD) Unit ID
(WORD) Unknown - 0xE4
(WORD) Unit Action
[/color]
This packet notifys ALL other ingame players when you trigger a action command and then uses it to command your selected units in your unit buffer to do there *Action* on the targeted map/other unit.
Unit ID Field will be null if it was targeted on the map and not a unit.



[size=6]0x18[/size]
In Game - Cancel Selected Building
Lengh = 1
[color=yellow]
18
Blank
[/color]
This packet notifys ALL other ingame players that you canceled a selected building from building.



[size=6]0x19[/size]
In Game - Cancel Unit Morphing
Lengh = 1
[color=yellow]
19
Blank
[/color]
This packet notifys ALL other ingame players that you Canceled the selected Zerg Egg from morphing into a unit.



[size=6]0x1A[/size]
In Game - Stop Selected Units
Lengh = 2
[color=yellow]
1A 00
(BYTE) Unknown - 0x00 (Action?)
[/color]
This packet notifys ALL other ingame players that the units in your selected unit buffer have been commanded to stop what they are doing.



[size=6]0x1E[/size]
In Game - Selected Units Return
Lengh = 2
[color=yellow]
1E 00
(BYTE) Unknown - 0x00 (Action?)
[/color]
This packet notifys ALL other ingame players that the units in your selected unit buffer have been commanded to return there cargo.



[size=6]0x1F[/size]
In Game - Build Unit
Lengh = 3
[color=yellow]
1F 40 00
(WORD) Unit's Unique Code
[/color]
This packet notifys ALL other ingame players that the building in your selected unit buffer has been commanded to build a unit.



[size=6]0x20[/size]
In Game - Cancel Build Unit
Lengh = 3
[color=yellow]
20 01 00
(WORD) Unit Slot
[/color]
This packet notifys ALL other ingame players that the building in your selected unit buffer has been commanded to Stop building a unit.
The WORD In this packet notifys you what number in the queue the unit was, witch got canceled.



[size=6]0x21[/size]
In Game - Cloak Unit
Lengh = 2
[color=yellow]
21 00
(BYTE) Unknown - 0x00
[/color]
This packet notifys ALL other ingame players that the units in your selected unit buffer are being commanded to Cloak.



[size=6]0x22[/size]
In Game - Uncloak Unit
Lengh = 2
[color=yellow]
22 00
(BYTE) Unknown - 0x00
[/color]
This packet notifys ALL other ingame players that your units on your selected unit buffer are being commanded to Uncloak.



[size=6]0x23[/size]
In Game - Morph Selected Unit's
Lengh = 3
[color=yellow]
23 29 00
(WORD) Unit's Unique Code
[/color]
This packet notifys ALL other ingame players that your units in your selected unit buffer are being commanded to morph into new unit's.



[size=6]0x25[/size]
In Game - Unsiege Tank
Lengh = 2
[color=yellow]
25 00
(BYTE) Unknown - 0x00
[/color]
This packet notifys ALL other ingame players that your tanks in your selected unit buffer are being commanded to unsiege.



[size=6]0x26[/size]
In Game - Siege Tank
Lengh = 2
[color=yellow]
26 00
(BYTE) Unknown - 0x00
[/color]
This packet notifys ALL other ingame players that your tanks in your selected unit buffer are being commanded to siege.



[size=6]0x27[/size]
In Game - Add To Unit's Build Queue
Lengh = 1
[color=yellow]
27
Blank
[/color]
This packet notifys ALL other ingame players that you have add unit thingys to your unit.
Like scabs, intersepters etc etc.
(0x20 would notify of cancel)



[size=6]0x29[/size]
In Game - Unload a selected unit
Lengh = 3
[color=yellow]
29 0B 0E
(WORD) Unit ID
[/color]
This packet notifys ALL other ingame players that you have selected a single unit to be unloaded from a dropship/overlord/shuttle etc.



[size=6]0x2A[/size]
In Game - Morph Archon
Lengh = 1
[color=yellow]
2A
Blank
[/color]
This packet notifys ALL other ingame players that your High Templars in your selected unit buffer are being morphed into Archons.



[size=6]0x2C[/size]
In Game - Burrow Units
Lengh = 2
[color=yellow]
2C 00
(BYTE) Unknown - 0x00
[/color]
This packet notifys ALL other ingame players that your supporting-zerg units in your selected unit buffer are being commanded to Burrow.



[size=6]0x2D[/size]
In Game - UnBurrow Units
Lengh = 2
[color=yellow]
2D 00
(BYTE) Unknown - 0x00
[/color]
This packet notifys ALL other ingame players that your supporting-zerg units in your selected unit buffer are being commanded to Unburrow.



[size=6]0x2F[/size]
In Game - Building Liftoff
Lengh = 5
[color=yellow]
2F E0 0E 30 05
(BYTE) Unknown
(BYTE) Unknown
(BYTE) Unit ID? - unknown ;/
(BYTE) Unknown (always lowish number)
[/color]
This packet notifys ALL other ingame players that your building in your selected unit buffer has lifted off.



[size=6]0x30[/size]
In Game - Upgrade Type 1
Lengh = 2
[color=yellow]
30 01
(BYTE) Upgrade Type 1
[/color]
This packet notifys ALL other ingame players that your building in your selected unit buffer has been commanded to Upgrade to the next level.



[size=6]0x31[/size]
In Game - Cancel Upgrade Type 1
Lengh = 1
[color=yellow]
31
Blank
[/color]
This packet notifys ALL other ingame players that your building in your selected unit buffer has been commanded to cancel the Upgrade.



[size=6]0x32[/size]
In Game - Upgrade Type 2
Lengh = 2
[color=yellow]
32 0F
(BYTE) Upgrade Type 2
[/color]
This packet notifys ALL other ingame players that your building in your selected unit buffer has been commanded to Upgrade.



[size=6]0x33[/size]
In Game - Cancel Upgrade Type 2
Lengh = 1
[color=yellow]
33
Blank
[/color]
This packet notifys ALL other ingame players that your building in your selected unit buffer has been commanded to cancel the Upgrade.



[size=6]0x35[/size]
In Game - Morph Zerg Building
Lengh = 3
[color=yellow]
35 92 00
(WORD) Building's Unique Code
[/color]
This packet notifys ALL other ingame players that your zerg-building in your selected unit buffer has been commanded to morph into the upgraded version.



[size=6]0x36[/size]
In Game - Stim Selected Units
Lengh = 1
[color=yellow]
36
Blank
[/color]
This packet notifys ALL other ingame players that your infentory in your selected unit buffer have been commanded to stim.



[size=6]0x3C[/size]
Game Room Start Game
Lengh = 1
[color=yellow]
3C
Blank
[/color]
This Packet Notifys other clients that the host has started the game.



[size=6]0x3E[/size]
Game Room Slots
Lengh = 6 (5th byte maybe?)
[color=yellow]
3E 07 FF 08 06 00
3E 06 FF 08 06 00
3E 05 05 02 06 00
3E 04 04 02 06 00
3E 03 03 02 06 00
3E 02 02 02 06 00
3E 01 01 02 06 00
3E 00 00 02 06 00
(BYTE) Game Room Slot Number
(BYTE) Player ID (In this slot)
(BYTE) Forgot this one
(BYTE) Players Race
(BYTE) Unknown - 0x00
[/color]
This packet notifys you of whos where in the game room.
[size=3]Races:[/size]
0x00 = Zerg
0x01 = Terran
0x02 = Protoss
0x06 = Random



[size=6]0x41[/size]
Players race change?
Lengh = 3
[color=yellow]
41 08 06
(BYTE) unknown - 0x08
(BYTE) Players Race
[/color]
This packet notifys you of other players race's and race change's in the game room.
[size=3]Races:[/size]
0x00 = Zerg
0x01 = Terran
0x02 = Protoss
0x06 = Random



[size=6]0x5A[/size]
In Game - Morph Dark Archon
Lengh = 1
[color=yellow]
5A
Blank
[/color]
This packet notifys ALL other ingame players that your Dark Templars in your selected unit buffer are being morphed into Dark Archons.
October 13, 2005, 5:33 PM
Ringo
[color=yellow]
0x00 = Terran - Marine
0x01 = Terran - Ghost
0x02 = Terran - Vulture
0x03 = Terran - Goliath
0x04 =
0x05 = Terran - Tank
0x06 =
0x07 = Terran - SCV
0x08 = Terran - Wraith
0x09 = Terran - Science Vessel
0x0A =
0x0B = Terran - Dropship
0x0C = Terran - BattleCruiser
0x0D =
0x0E = Terran - Nuke
0x0F =
0x10 =
0x11 =
0x12 =
0x13 =
0x14 =
0x15 =
0x16 =
0x18 =
0x19 =
0x1A =
0x1B =
0x1C =
0x1D =
0x1E =
0x1F =
0x20 = Terran - Firebat
0x21 =
0x22 = Terran - Medic
0x23 =
0x24 =
0x25 = Zerg - Zergling
0x26 = Zerg - Hydralisk
0x27 = Zerg - Ultralisk
0x28 =
0x29 = Zerg - Drone
0x2A = Zerg - Overlord
0x2B = Zerg - Muta
0x2C = Zerg - Guardian
0x2D = Zerg - Queen
0x2E = Zerg - Defiler
0x2F = Zerg - Scourge
0x30 =
0x31 =
0x32 =
0x33 =
0x34 =
0x35 =
0x36 =
0x37 =
0x38 =
0x39 =
0x3A = Terran - Valkyrie
0x3B =
0x3C = Protoss - Corsair
0x3D = Protoss - Dark Templar
0x3E = Zerg - Devourer
0x3F =
0x40 = Protoss - Probe
0x41 = Protoss - Zealot
0x42 = Protoss - Dragoon
0x43 = Protoss - High Templar
0x44 =
0x45 = Protoss - Shuttle
0x46 = Protoss - Scout
0x47 = Protoss - Arbiter
0x48 = Protoss - Carrier
0x49 =
0x4A =
0x4B =
0x4C =
0x4D =
0x4E =
0x4F =
0x50 =
0x51 =
0x52 =
0x53 = Protoss - Reaver
0x54 = Protoss - Observer
0x55 =
0x56 =
0x57 =
0x58 =
0x59 =
0x5A =
0x5B =
0x5C =
0x5D =
0x5E =
0x5F =
0x60 =
0x61 =
0x62 =
0x63 =
0x64 =
0x65 =
0x66 =
0x67 = Zerg - Lurker
0x68 =
0x69 =
0x6A = Terran - Command Center
0x6B = Terran - Comsat Station (CC addon)
0x6C = Terran - Nuclear Silo (CC addon)
0x6D = Terran - Supply Depot
0x6E = Terran - Refinery
0x6F = Terran - Barracks
0x70 = Terran - Academy
0x71 = Terran - Factory
0x72 = Terran - Starport
0x73 = Terran - Controll Tower (Starport addon)
0x74 = Terran - Science Facility
0x75 = Terran - Covert Ops (Science Facility addon)
0x76 = Terran - Physics Lab (Science Facility addon)
0x77 =
0x78 = Terran - Machine Shop (Factory addon)
0x79 =
0x7A = Terran - Engineering Bay
0x7B = Terran - Armory
0x7C = Terran - Turret
0x7D = Terran - Bunker
0x7E =
0x7F =
0x80 =
0x81 =
0x82 =
0x83 = Zerg - Hatchery
0x84 = Zerg - Lair
0x85 = Zerg - Hive
0x86 = Zerg - Nydus Canal
0x87 = Zerg - Hydralisk Den
0x88 = Zerg - Defiler Mound
0x89 = Zerg - Greater Spire
0x8A = Zerg - Queens Nest
0x8B = Zerg - Evoulion Chamber
0x8C = Zerg - Ultralist Cavern
0x8D = Zerg - Spire
0x8E = Zerg - Spawning Pool
0x8F = Zerg - Creep Colony
0x90 = Zerg - Spore Colony
0x91 =
0x92 = Zerg - Sunken Colony
0x93 =
0x94 =
0x95 = Zerg - Extractor (Gas)
0x96 =
0x97 =
0x98 =
0x99 =
0x9A = Protoss - Nexus
0x9B = Protoss - Robotics Facility
0x9C = Protoss - Pylon
0x9D = Protoss - Assimilator (gas)
0x9F = Protoss - Observatory
0xA0 = Protoss - Gateway
0xA2 = Protoss - Photon Cannon
0xA3 = Protoss - Citadel Of Adun
0xA4 = Protoss - Cybernetics Core
0xA5 = Protoss - Templar Archives
0xA6 = Protoss - Forge
0xA7 = Protoss - Stargate
0xA9 = Protoss - Fleet Beacon
0xAA = Protoss - Arbiter Tribunal
0xAB = Protoss - Robotics Support Bay
0xAC = Protoss - Shield Battery


[/color]
October 13, 2005, 5:36 PM
Ringo
[color=yellow]
0x06 = *Move* to map location
0x08 = *Attack Move* on unit
0x0E = *Attack Move* to map
0x12 = *Attack* on map
0x13 = *Attack* on unit
0x1B = *Infest Command Center* on burning CC only
0x22 = *Repair* on mechanical unit only
0x27 = *Set Rally Point* on unit
0x28 = *Set Rally Point* on map
0x43 = *Recharge Shields* on unit/map
0x4F = *Gather* on mineral/Gas
0x5E = *Load* on unit (Drop ships)
0x70 = *Unload All* on unit/map (Drop ships)
0x71 = *Yamato Gun* on unit only
0x73 = *Lock Down* on mechanical unit only
0x77 = *Dark Swarm* on unit/map
0x78 = *Parasite* on unit only
0x79 = *Spawn Broodlings* on non-robotic unit only
0x7A = *EMP Shockwave* on unit/map
0x7E = *Nuke* on unit/map
0x89 = *Recall* on unit/map
0x8B = *Comsat Scan Sweep* on unit/map
0x8D = *Defencive Matrix* on unit only
0x8E = *Psionic Storm* on unit/map
0x8F = *Irradiate* on non-building unit only
0x90 = *Plague* on unit/map
0x91 = *Consume* on unit only
0x92 = *Ensnare* on unit/map
0x93 = *Stasis* on unit/map
0x94 = *Hallucination* on unit only
0x98 = *Patrol* on unit/map
0xB1 = *Heal* on non-mechanical ground unit/map
0xB4 = *Restoration* on unit/map
0xB5 = *Disruption Web* on unit/map
0xB6 = *Mind Controll* on unit only
0xB9 = *Optical Flare* on unit only
0xBA = *Mealstorm* on unit/map
0xB8 = *Feed back* on unit only
[/color]
October 13, 2005, 5:36 PM
Ringo
[color=Yellow]
0x00 = Terran - Stim Pack (Infantry)
0x01 = Terran - Lock Down (Ghost)
0x02 = Terran - EMP Shockwave (Science Vessel)
0x03 = Terran - Spider Mines (Vulture)
0x04 =
0x05 = Terran - Siege Mode (Tank)
0x06 =
0x07 = Terran - Irradiate (Science Vessel)
0x08 = Terran - Yamato Gun (BattleCruiser)
0x09 = Terran - Cloaking Field (Wraith)
0x0A = Terran - Personnel Cloaking (Ghost)
0x0B = Zerg - Burrowing
0x0C =
0x0D = Zerg - Spawn Broodlings (Queen)
0x0E = Terran - Optical Flare (Medic)
0x0F = Zerg - Plague (Defiler)
0x10 = Zerg - Consume (Defiler)
0x11 = Zerg - Ensnare (Queen)
0x12 =
0x13 =
0x14 =
0x15 =
0x16 =
0x17 =
0x18 = Terran - Restoration (Medic)
0x19 =
0x1A =
0x1B =
0x1C =
0x1D =
0x1E =
0x1F =
0x20 = Zerg - Lurker Aspect (Hyralist)



[/color]
October 13, 2005, 5:37 PM
Ringo
Terran:
[color=yellow]
0x00 = Terran - Infantry Armor
0x01 = Terran - Ground Armor
0x07 = Terran - Infantry Wepons
0x08 = Terran - Ground Wepons
0x10 = Terran - Marine Attack Range
0x11 = Terran - Vulture Movment
0x13 = Terran - Science Vessel +50 Energy
0x14 = Terran - Ghost Sight Range
0x15 = Terran - Ghost +50 Energy
0x16 = Terran - Wraith +50 Energy
0x33 = Terran - Medic +50 Energy
0x36 = Terran - Goliath Attack Range
[/color]



Protoss:
[color=yellow]
0x05 = Protoss - Ground Armor
0x06 = Protoss - Air Armor
0x0D = Protoss - Ground Wepons
0x0E = Protoss - Air Weapons
0x0F = Protoss - Plasma Shields
0x13 = Protoss - Psionic Storm
0x14 = Protoss - Hallucination
0x15 = Protoss - Recall
0x16 = Protoss - Stasis
0x19 = Protoss - Disruption Web
0x1B = Protoss - Mind Controll
0x1F = Protoss - MealStorm
0x21 = Protoss - Dragoon Attack Range
0x22 = Protoss - Zealot Speed
0x23 = Protoss - Scarab Damage
0x24 = Protoss - Reaver Capacity
0x25 = Protoss - Shuttle Movment
0x26 = Protoss - Observer Sight Range
0x27 = Protoss - Observer Movment
0x28 = Protoss - High Templar +50 Energy
0x29 = Protoss - Scout Sight Range
0x2A = Protoss - Scout Movment
0x2B = Protoss - Carrier Capacity
0x2C = Protoss - Arbiter +50 Energy
0x2F = Protoss - Corsair +50 Energy
0x31 = Protoss - Dark Archon +50 Energy
[/color]



Zerg:
[color=yellow]
0x03 = Zerg - Carapace (Zerg Shields)
0x04 = Zerg - Air Armor
0x0A = Zerg - Melee Wepons
0x0B = Zerg - Missile Wepons
0x0C = Zerg - Air Wepons
0x18 = Zerg - Overlord Transporting
0x19 = Zerg - Overlord Sight Range
0z1A = Zerg - Overlord Movment
0x1B = Zerg - Zergling Movment
0x1C = Zerg - Zergling Attack Speed
0x1D = Zerg - Hydralist Movment
0x1E = Zerg - Hydralist Attack Range
0x1F = Zerg - Queen +50 Energy
0x20 = Zerg - Defiler +50 Energy
0x25 = Zerg - Ultralist Movment
0x34 = Zerg - Ultralist Armor

[/color]
October 13, 2005, 5:38 PM
Arta
Neat, thanks :)
October 13, 2005, 6:14 PM
rabbit
The last byte in 0x3E is the map % download (I think).  I still have to check this out more, but I'm fairly sure.
October 13, 2005, 9:59 PM
JoeTheOdd
[quote]0x41
Players race change?
Lengh = 3

41 08 06
(BYTE) unknown - 0x08
(BYTE) Players Race

This packet notifys you of other players race's and race change's in the game room.
Races:
0x00 = Zerg
0x01 = Terran
0x02 = Protoss
0x06 = Random[/quote]

Theory on the 0x08: the players position in the room. Has to say it somewhere.

[quote]0x3E
Game Room Slots
Lengh = 6 (5th byte maybe?)

3E 07 FF 08 06 00
3E 06 FF 08 06 00
3E 05 05 02 06 00
3E 04 04 02 06 00
3E 03 03 02 06 00
3E 02 02 02 06 00
3E 01 01 02 06 00
3E 00 00 02 06 00
(BYTE) Game Room Slot Number
(BYTE) Player ID (In this slot)
(BYTE) Forgot this one
(BYTE) Players Race
(BYTE) Unknown - 0x00[/quote]

0xFF in (BYTE) Player ID means that a player isn't in that slot, I asume?
October 14, 2005, 12:52 AM
Ringo
[quote author=Arta[vL] link=topic=12107.msg130901#msg130901 date=1129227266]
Neat, thanks :)
[/quote]
np :)

[quote author=rabbit link=topic=12107.msg130911#msg130911 date=1129240755]
The last byte in 0x3E is the map % download (I think).  I still have to check this out more, but I'm fairly sure.
[/quote]
cool, i will look into it if you/somone else doesnt first.

[quote author=Joe link=topic=12107.msg130941#msg130941 date=1129251150]
[quote]0x41
Players race change?
Lengh = 3

41 08 06
(BYTE) unknown - 0x08
(BYTE) Players Race

This packet notifys you of other players race's and race change's in the game room.
Races:
0x00 = Zerg
0x01 = Terran
0x02 = Protoss
0x06 = Random[/quote]

Theory on the 0x08: the players position in the room. Has to say it somewhere.
[/quote]

I think that byte is static (always 0x08), theres also a command 0 packet that gets sent along with this one, i think 0x0E, but i cant remember with out checking.


[quote]0x3E
Game Room Slots
Lengh = 6 (5th byte maybe?)

3E 07 FF 08 06 00
3E 06 FF 08 06 00
3E 05 05 02 06 00
3E 04 04 02 06 00
3E 03 03 02 06 00
3E 02 02 02 06 00
3E 01 01 02 06 00
3E 00 00 02 06 00
(BYTE) Game Room Slot Number
(BYTE) Player ID (In this slot)
(BYTE) Forgot this one
(BYTE) Players Race
(BYTE) Unknown - 0x00

0xFF in (BYTE) Player ID means that a player isn't in that slot, I asume?
[/quote]
ye, i was player ID 0x05 (6th player) in that instance i think*, in a 6 player game.
October 14, 2005, 5:25 AM
JoeTheOdd
So then an 0xFF denotes that the slot is closed? Then I suppose an 0x00 would be that there is no player in the slot.
October 14, 2005, 3:43 PM
MysT_DooM

(BYTE) Slot Packet ID - [color=limegreen]3E[/color]
(BYTE) GameSlot ID
(BYTE) Player ID[color=red]*[/color]
(BYTE) Slot Status[color=red]**[/color]
(BYTE) Player Race Selection
(BYTE) Force[color=red]***[/color]
(BYTE) Unknown ID - [color=limegreen]3F[/color]
(BYTE) Player ID
(WORD) Null
(WORD) [color=limegreen]01 00[/color]
(WORD) [color=limegreen]05 00[/color]

[color=red]*[/color]
When no player is there it is 0xFF

[color=red]**[/color]
Not Used  0x00 (Meaning for example, you're in Lost Temple and there are only 4 slots allowed, the other 4 0x3E's won't even be used)
Human      0x02
Computer  0x05
Empty      0x06
Closed      0x08

[color=red]***[/color]
No Force  0x00
Force 1    0x01
Force 2    0x02
etc..
February 4, 2007, 8:16 PM
IceOnMe
[quote author=MysT_DooM link=topic=12107.msg163964#msg163964 date=1170620161]

(BYTE) Slot Packet ID - [color=limegreen]3E[/color]
(BYTE) GameSlot ID
(BYTE) Player ID[color=red]*[/color]
(BYTE) Slot Status[color=red]**[/color]
(BYTE) Player Race Selection
(BYTE) Force[color=red]***[/color]
(BYTE) Unknown ID - [color=limegreen]3F[/color]
(BYTE) Player ID
(WORD) Null
(WORD) [color=limegreen]01 00[/color]
(WORD) [color=limegreen]05 00[/color]

[color=red]*[/color]
When no player is there it is 0xFF

[color=red]**[/color]
Not Used   0x00 (Meaning for example, you're in Lost Temple and there are only 4 slots allowed, the other 4 0x3E's won't even be used)
Human      0x02
Computer  0x05
Empty       0x06
Closed      0x08

[color=red]***[/color]
No Force  0x00
Force 1    0x01
Force 2    0x02
etc..

[/quote]

I agree with you ..

when use "team vs bottom"  the last bytes of 0x3e will be 0x01 or 0x02
and the decription of slot status is also correct and a great job

I'd like to ask what function does 0x3f and 0x3d which appears ahead 0x3e have.

my packets here:
[quote]
32 b7 4e 00 12 00 13 00 02 00 00 00  // which known to us as the header
[color=yellow]3d 64[/color]   //I'm wondering whether to separate 3d 64 from the upper bytes

3e 07 ff 06 06 02
3e 06 ff 06 06 02
3e 05 ff 06 06 02
3e 04 ff 06 06 02 
3e 03 ff 06 06 01
3e 02 ff 06 06 01
3e 01 01 02 06 01
3e 00 00 02 06 01

[color=yellow]3f 01 00 00 01 00 05 00
3f 00 00 00 01 00 05 00 [/color]
[/quote]

I am new here, and i am eager to learn from all of you.:)
February 7, 2007, 7:22 AM
Ringo
Well, what you are looking at, is the message the host will send to each player when the game room changes, such as a player changes race, slot, team, quits etc

It generaly goes, to each player:
0x3E for all 8 possible slots
0x3F for each player

Packet 0x3D:
[code]
(BYTE) Packet ID - 0x3D
(BYTE) Map Download Percent (1 to 100, other wise invisible)
[/code]

Packet 0x3E:
[code]
(BYTE) Packet ID - 0x3E
(BYTE) Game Room Slot Index
(BYTE) Player ID (In this slot, 0 to 7, 0xFF = none)
(BYTE) Slot Status
        '0x00 = slot doesnt exist
        '0x02 = slot is Taken by player
        '0x05 = slot is Computer
        '0x06 = slot is Empty
        '0x08 = slot is Closed
(BYTE) Players Race
        '0x00 = Zerg
        '0x01 = Terran
        '0x02 = Protosss
        '0x06 = Random
(BYTE) Ownership Team (the team/force index of this game room slot)
[/code]

Packet 0x3F:
[code]
(BYTE) Packet ID - 0x3F
(BYTE) Player ID
(WORD) Unused - 0x00
(WORD) Const - 0x01
(WORD) Const - 0x05
[/code]

The reassion they are sent together, is because of the way command 2 works.
Command 2 Data should be bufferd and sent each game tick (about every 250ms)

Hope this helps
February 7, 2007, 3:27 PM
IceOnMe
Thanks for your helpful reply.

I'd like to propose another question: How to collect game results in both BN mode and LAN game mode?

I have made many tests but failed to figure it out, need help ???
February 9, 2007, 4:41 PM
Ringo
[quote author=IceOnMe link=topic=12107.msg164406#msg164406 date=1171039283]
Thanks for your helpful reply.

I'd like to propose another question: How to collect game results in both BN mode and LAN game mode?

I have made many tests but failed to figure it out, need help ???
[/quote]
Im not to sure about LAN games, but the end game BN results are in 0x2C SID_GAMERESULTS

If your working with the game client its self, you need to capture the packets that SC sends and recv's.
I think* Adron made a winsock hook active X control that can be found by searching this forum.
That should be quick and easy for this.
February 9, 2007, 5:51 PM
MysT_DooM
well i started again on this project and I have a unknown label in my 0x06 notes and was wondering if any of you guys knew what it might be.

What i reckon it might be is the amount of times or speed (like send me every x seconds)  ...well nm thats the purpose of the command seq counter....so hmmm...no idea

[quote]
[Host sends this]

UDPPKT_WhosWho(0x06) C -> S

(DWORD) Null
(WORD)  UDP Checksum of Packet
(WORD)  Length
(WORD)  Sent
(WORD)  Recv
(BYTE)  Command (Always &H0)
(BYTE)  Packet ID      (&H6)
(WORD)  Host ID (&H0)
[color=orange](DWORD) Unknown[/color]
(DWORD) Player ID
(DWORD) [?]Host Location[?] or is Host &H1 [?]
(DWORD) Null
(DWORD) Command SEQ Counter (Same from 0x08)
(WORD)  Unknown
(WORD)  Port
(DWORD) IP
(DWORD) Null
(DWORD) Null
(STRING) Player Name
(WORD) Null Ending
[/quote]

[quote]
SEND-> 0000   00 00 00 00 E4 72 37 00 03 00 03 00 00 06 00 00    .....r7.........
SEND-> 0010   [color=orange]2B 00 00 00 [/color] 00 00 00 00 01 00 00 00 00 00 00 00    +...............
SEND-> 0020   27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    '...............
SEND-> 0030   00 00 00 00 74 68 69 65 66 00 00                   ....thief..

SEND-> 0000   00 00 00 00 19 B8 36 00 03 00 03 00 00 06 00 00    ......6.........
SEND-> 0010   [color=orange]2A 00 00 00 [/color] 00 00 00 00 01 00 00 00 00 00 00 00    *...............
SEND-> 0020   12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
SEND-> 0030   00 00 00 00 4D 79 73 74 00 00                      ....Myst..

SEND-> 0000   00 00 00 00 44 27 37 00 03 00 03 00 00 06 00 00    ....D'7.........
SEND-> 0010   [color=orange]2B 00 00 00 [/color] 00 00 00 00 01 00 00 00 00 00 00 00    +...............
SEND-> 0020   33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    3...............
SEND-> 0030   00 00 00 00 54 68 69 65 66 00 00                   ....Thief..
[/quote]
April 20, 2007, 1:54 AM
MysT_DooM
upon further review seems like a corelation between the size of the packet and that unknown data
April 22, 2007, 6:04 PM
iago
Hope this helps:

[code]struct message {
unsigned long udptype;
unsigned short checksum;
unsigned short len;
unsigned short pos1;
unsigned short pos2;
unsigned char cls;
unsigned char cmd;
unsigned char sender;
unsigned char resend;
char data[];
};
[/code]

I'm not entirely sure on what the fields mean, but they roughly correspond to TCP fields (seq, ack, etc.) as well as the priority of the packet.

And by the way, hex is denoted by prepending 0x or appending h, as in 0x123 or 123h. That whole "&h" business is ewwy.
April 22, 2007, 6:17 PM
MysT_DooM
yeh thats the baseline structure of the udp packet, but still wondering if someone knows the what the data means, the first dword in char data[]; for this specific packet. (the first 2 Unknowns are not rly unknown, i know wat there purpose is, i just couildnt figure out a name for it at the time so thats why i wrote unknown, the unknown im talking bout is the one highlighted in orange)

starting to think it has something to do with the length, after a few packet logs with different username lengths and diff maps. just wondering b4 i go further. most likly is something to do with length; just looking for second opinions
April 22, 2007, 9:12 PM
Ringo
I think* it is used to work out the start-locations and/or color of a player (or all players), based on there asigned player ID/Index.
Its been awhile, and I cant find anything on it in any old projects, but I pretty sure that is what it is.
(If im not getting confused with that command 2, 0x40somthing packet that is issued when the game starts :P)
April 29, 2007, 10:29 PM
MysT_DooM
ur confused :P

The value is the same when logged using different lengthd usernames to shrink/expand the length of packet and the value changes appropreiatly.
so a log with a 3 digit usernames would all have same value, 4digit usernames all smae value , etc etc
So it has something to do with length.
April 29, 2007, 10:41 PM
Ringo
Ah, yeah I am :P
Your right, its a lengh dword, from offset 0x17 (that dword/start of packet payload) to the end of the packet.
April 29, 2007, 10:50 PM
Heinermann
In comparison to the Replay Opcode format, the packet opcodes, I have observed to be the same.

Opcodes: http://www.maplantis.org/index.php?pg=wiki;id=99
Orders: http://www.maplantis.org/index.php?pg=wiki;id=104
Units: http://www.maplantis.org/index.php?pg=wiki;id=101
Technologies: http://www.maplantis.org/index.php?pg=wiki;id=102
Upgrades: http://www.maplantis.org/index.php?pg=wiki;id=103

Slot Owner
    * 00 - Inactive
    * 01 - Passive (Enemy)
    * 02 - Occupied by Human Player
    * 03 - Rescue Passive
    * 04 - Unused
    * 05 - Computer
    * 06 - Human (Open Slot)
    * 07 - Neutral
    * 08 - Closed

Race
    * 00 - Zerg
    * 01 - Terran
    * 02 - Protoss
    * 03 - Unused (Independent)
    * 04 - Unused (Neutral)
    * 05 - User Selectable
    * 06 - Random (Forced in UMS[not actually random], Random in melee)
    * 07 - Inactive


Also I'm assuming there are packets for

1. Making game public.
2. Booting/Banning a player.
3. Clicking Start in the Mission Briefing.
4. Sending Text.
5. Team Melee stuff.
July 12, 2007, 3:33 PM
MysT_DooM
[quote author=Heinermann link=topic=12107.msg170932#msg170932 date=1184254407]

Also I'm assuming there are packets for


4. Sending Text.

[/quote]

yep

[code]

S>C & C>S  InGame Chat
(DWORD)  Null
(WORD)  UDP Checksum of Packet
(WORD)  Length
(WORD)  Sent
(WORD)  Recv
(BYTE)  Command (Command 1)
(BYTE)  Packet ID (&H0)
(WORD)  Player ID
(WORD)  Unused
(STRING) Message

            00 00 ..
00 00 7F D2 2B 00 23 00 1B 00 01 00 00 00 00 00 57 68 79 20 77 6F ....+.#.........Why wo
75 6C 64 20 49 20 63 61 72 65 20 6F 66 20 62 6F 74 73 20 3C 2E 3C uld I care of bots <.<
00   .


    00 00 ..
00 00 54 9C 1A 00 1D 00 13 00 01 00 00 00 00 B5 4D 79 73 74 20 69 ..T.............Myst i
73 20 65 6D 6F 00   is emo.
[/code]


[code]
C>S S>C In GameRoom Chat
(DWORD)  Null
(WORD)  UDP Checksum of Packet
(WORD)  Length
(WORD)  Sent
(WORD)  Recv
(BYTE)  Command (Command 1)
(BYTE)  Packet ID (&H0)
(WORD)  Player ID
(WORD) Unknown (Seems to be always 00 4C)
(STRING) Message

    00 00 ..
00 00 2E BD 1A 00 05 00 01 00 01 00 00 00 4C 68 65 6C 6C 6F 20 62 ..............Lhello b
61 64 61 73 73 00   adass.

00 00                                                    ..
00 00 2D 38 11 00 03 00 05 00 01 00 01 00 4C 64 61 6D 00  ..-8..........Ldam.

    00 00 ..
00 00 91 8B 1A 00 06 00 06 00 01 00 02 00 4C 64 75 64 65 20 50 75 ..............Ldude Pu
62 20 73 75 78 00   b sux.
[/code]

and

[quote author=Heinermann link=topic=12107.msg170932#msg170932 date=1184254407]
Also I'm assuming there are packets for

1. Making game public.

5. Team Melee stuff.
[/quote]
As for the making game public, just dont have a pw in your 0x1C (TCP)

And for Team Melee that would be decided in the "statstring" area of your 0x1C by the GameType section of that, team melee i would think means Top vs Bottom so it would be "f".
November 14, 2007, 2:15 AM
Leaky
[quote](DWORD)  Null
(WORD)  UDP Checksum of Packet
(WORD)  Length
(WORD)  Sent
(WORD)  Recv
(BYTE)  Command (Command 1)
(BYTE)  Packet ID (&H0)
(WORD)  Player ID
(WORD)  Unused
(STRING) Message[/quote]
you keep getting the header incorrect...

[code]
(DWORD)  UDP Class
(WORD)  UDP Checksum of Packet
(WORD)  Length
(WORD)  Sent
(WORD)  Recv
(BYTE)  Command
(BYTE)  Packet ID
(WORD)  Player ID
(WORD)  Resend
(STRING) Message[/code]

the header was already established a while back :P no need to rename parts of it
November 20, 2007, 4:02 AM
Leaky
[quote author=MysT_DooM link=topic=12107.msg168172#msg168172 date=1177034087]
well i started again on this project and I have a unknown label in my 0x06 notes and was wondering if any of you guys knew what it might be.

What i reckon it might be is the amount of times or speed (like send me every x seconds)  ...well nm thats the purpose of the command seq counter....so hmmm...no idea

[quote]
[Host sends this]

UDPPKT_WhosWho(0x06) C -> S

(DWORD) Null
(WORD)  UDP Checksum of Packet
(WORD)  Length
(WORD)  Sent
(WORD)  Recv
(BYTE)  Command (Always &H0)
(BYTE)  Packet ID      (&H6)
(WORD)  Host ID (&H0)
[color=orange](DWORD) Unknown[/color]
(DWORD) Player ID
(DWORD) [?]Host Location[?] or is Host &H1 [?]
(DWORD) Null
(DWORD) Command SEQ Counter (Same from 0x08)
(WORD)  Unknown
(WORD)  Port
(DWORD) IP
(DWORD) Null
(DWORD) Null
(STRING) Player Name
(WORD) Null Ending
[/quote]

[quote]
SEND-> 0000   00 00 00 00 E4 72 37 00 03 00 03 00 00 06 00 00    .....r7.........
SEND-> 0010   [color=orange]2B 00 00 00 [/color] 00 00 00 00 01 00 00 00 00 00 00 00    +...............
SEND-> 0020   27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    '...............
SEND-> 0030   00 00 00 00 74 68 69 65 66 00 00                   ....thief..

SEND-> 0000   00 00 00 00 19 B8 36 00 03 00 03 00 00 06 00 00    ......6.........
SEND-> 0010   [color=orange]2A 00 00 00 [/color] 00 00 00 00 01 00 00 00 00 00 00 00    *...............
SEND-> 0020   12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
SEND-> 0030   00 00 00 00 4D 79 73 74 00 00                      ....Myst..

SEND-> 0000   00 00 00 00 44 27 37 00 03 00 03 00 00 06 00 00    ....D'7.........
SEND-> 0010   [color=orange]2B 00 00 00 [/color] 00 00 00 00 01 00 00 00 00 00 00 00    +...............
SEND-> 0020   33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    3...............
SEND-> 0030   00 00 00 00 54 68 69 65 66 00 00                   ....Thief..
[/quote]
[/quote]


[quote]
[Host sends this]

UDPPKT_WhosWho(0x06) C -> S

(DWORD) Null
(WORD)  UDP Checksum of Packet
(WORD)  Length
(WORD)  Sent
(WORD)  Recv
(BYTE)  Command (Always &H0)
(BYTE)  Packet ID      (&H6)
(WORD)  Host ID (&H0)
[color=orange](DWORD) Unknown[/color]
(DWORD) Player ID
(DWORD) [?]Host Location[?] or is Host &H1 [?]
(DWORD) Null
(DWORD) Command SEQ Counter (Same from 0x08)
(WORD)  Unknown
(WORD)  Port
(DWORD) IP
(DWORD) Null
(DWORD) Null
(STRING) Player Name
(WORD) Null Ending
[/quote]

you've got those switched

should be

[code]
[Host sends this]

UDPPKT_WhosWho(0x06) C -> S

(DWORD) Length - Length of packet data (not including header)
(DWORD) Player ID
(BOOLEAN) Is Host?
(DWORD) **Unknown
(DWORD) Command 2 Sequence Counter -- Recieved
(WORD) Family - always 0x02 AF_INET
(WORD) Port
(DWORD) IP Address
(DWORD) SIN_ZERO(0)
(DWORD) SIN_ZERO(1)
(STRING) Username
(STRING) Stat String
[/code]


that's the actual packet data, and the header is the same standard one.
November 20, 2007, 4:09 AM
Heinermann
I have updated the wiki on command class 1 and 2 data.

http://www.maplantis.org/index.php?pg=wiki;id=99
December 6, 2007, 5:47 PM
bLueStar
Heres some juicy info

[quote author=bLueStar]
########################################################
## JOIN GAME SEQUENCE - DATA SENT THROUGH UDP TO HOST ##
########################################################

HEADER :
(DWORD) Null Padding          
(WORD) Data Checksum            
(WORD) Data Length            
(WORD) Seq. 1                    
(WORD) Seq. 2                  
(BYTE) CLS                    
(BYTE) Command              
(BYTE) Player ID            
(BYTE) Resend                
(VOID) Data



************************************************************************************************************************************************
* NOTES:
*
* The type (STRING) always end with 0x00 even when the string is empty.
*      
* CLS can be either 0, 1 or 2.      
* Theres a Seq1 and a Seq2 for the 3 kind of CLS.      
*          
* Seq1 start at 0 and Seq2 start at 1 for CLS 0
*        
* When you send a packet : Send the datas and then increase the Seq1 of the aimed CLS by one.                                            
* When you receive a packet : The Seq2 of the aimed CLS become the Seq1 received + 1                                                    
* When you receive the SERVER GAME INFO packet, the Seq1 of the CLS 2 become "CurrentClass2Sequence" found in SERVER GAME INFO structure.
* This sequence number (Seq1 and Seq2) are used to synchronize each players/packets. The host give you what Seq2 was when you joined.    
* The host will be the first to send you a CLS 2 packet so the Seq2 of CLS 2 will become his Seq1 + 1.                                  
************************************************************************************************************************************************



DETAILED JOIN SEQUENCE :

1) Send : CLIENT GAME JOIN REQUEST (SEND 3 TIME THE EXACT SAME PACKET AND INCREASE THE SEQUENCE ONLY ONCE)
2) Receive : SERVER GAME JOIN REPLY
3) Send : CLIENT UNKNOWN (RESPONSE TO "SERVER GAME JOIN REPLY" ?)
4) Send : CLIENT PLAYER INFO
5) Receive : SERVER GAME INFO
For each playerCount in SERVER GAME INFO {
6) Receive : SERVER PLAYERS INFO
}
7) Receive : SERVER END OF PLAYER INFO ??
8) Receive : SERVER GAME SETTING INFO
9) Send : Reply to SERVER GAME SETTING INFO with an empty CLS 0, CMD 4 packet
10) Receive : CLS 0, CMD 4 packet
11) Send : Reply to last packet with an empty CLS 0, CMD 5 packet

Begin of CLS 2 Synchronization






------------------------------------------------------------------------------------------------------------------



Title: CLIENT GAME JOIN REQUEST
Direction: C>S
Class: 00
Command: 01
Player ID: FF <---- you still dont know your player ID
Resend: 00
Data:
(DWORD) Unknown - Always 0x00000001



------------------------------------------------------------------------------------------------------------------



Title: SERVER GAME JOIN REPLY
Direction: C<S
Class: 00
Command: 02
Player ID: 00
Resend: 00
Data:
(DWORD) Result - Always 0x00000001 (maybe to confirm that this is a listening starcraft game)



------------------------------------------------------------------------------------------------------------------



Title: CLIENT UNKNOWN (RESPONSE TO "SERVER GAME JOIN REPLY" ?)
Direction: C>S
Class: 00
Command: 03
Player ID: FF <---- you still dont know your player ID
Resend: 00
Data:
(DWORD) Unknown - Always 0x00000001



------------------------------------------------------------------------------------------------------------------



Title: CLIENT PLAYER INFO
Direction: C>S
Class: 00
Command: 07
Player ID: FF <---- you still dont know your player ID
Resend: 00
Data:
(STRING) Username
(STRING) StatsFromProduct
(STRING) Unknown - Always empty



------------------------------------------------------------------------------------------------------------------



Title: SERVER GAME INFO
Direction: C<S
Class: 00
Command: 08
Player ID: 00
Resend: 00
Data:
(DWORD) PlayersCount (Computer doesn't count)
(DWORD) UsableSlotsCount
(DWORD) CurrentClass2Sequence
(DWORD) Unknown - Always 0x00000004
(DWORD) GameTimeElapsed (in seconds)
(STRING) GameName
(STRING) GameStats
(STRING) Unknown - Always empty



------------------------------------------------------------------------------------------------------------------



Title: SERVER PLAYERS INFO
Direction: C<S
Class: 00
Command: 06
Player ID: 00
Resend: 00
Data:
(DWORD) DataSize
(DWORD) playerID
(DWORD) isHost
(DWORD) Unknown - Always 0x00000000
(DWORD) CurrentClass2Sequence
(WORD) Unknown - 0x0002 when not host
(WORD) PlayerPort - 0x0000 if host
(DWORD) PlayerIP - 0x00000000 if host
(DWORD) Unknown - Always 0x00000000
(DWORD) Unknown - Always 0x00000000
(STRING) Username
(STRING) StatsString - Empty if host



------------------------------------------------------------------------------------------------------------------



Title: SERVER END OF PLAYER INFO ??
Direction: C<S
Class: 00
Command: 0F
Player ID: 00
Resend: 00
Data:
(DWORD) Unknown - Always 0x00000000



------------------------------------------------------------------------------------------------------------------



Title: SERVER GAME SETTING INFO
Direction: C<S
Class: 00
Command: 09
Player ID: 00
Resend: 00
Data:
(WORD) GameType - (0x02 = Melee, 0x03 = FFA, 0x04 = 1v1, 0x05 = CTF, 0x06 = Greed, 0x07 = Slaughter, 0x08 = Sudden Death, 0x0A = UMS, 0x0B = Team Melee, 0x0C = Team FFA, 0x0D = Team CTF, 0x0F = TvB)

If GameType = Greed
(WORD) Unknown - Always 0x0001
(WORD) Ressource
If GameType = Slaughter
(WORD) Unknown - Always 0x0001
(WORD) Minutes
If GameType = Team Melee OR GameType = Team FFA OR GameType = Team CTF
(WORD) Unknown - NumberOfTeams - 1 ??
(WORD) NumberOfTeams
If GameType = TvB
(WORD) MatchUp - determine the amount of players in Home Team
(WORD) MatchUp - same...wtf?
Else
(WORD) Unknown - Always 0x0001
(WORD) Unknown - Always 0x0000


(WORD) Unknown - Always 0x0000
(BYTE) Unknown - (Logged : 0x01)
(BYTE) Unknown - (Logged : 0x01)
(BYTE) Unknown - (Logged : 0x01)
(BYTE) Unknown - (Logged : 0x02)
(BYTE) Unknown - (Logged : 0x02)
(BYTE) Unknown - (Logged : 0x00)
(BYTE) Unknown - (Logged : 0x01)
(BYTE) Unknown - (Logged : 0x01)
(BYTE) Unknown - (Logged : 0x00)
(BYTE) Unknown - (Logged : 0x01)
(BYTE) Unknown - (Logged : 0x00)
(BYTE) Unknown - (Logged : 0x00) <---- same value as "Minutes" when GameType = Slaughter
(DWORD) Unknown - (Logged : 0x00000032)
(DWORD) Unknown - (Logged : 0x00000000)
(DWORD) Unknown - (Logged : 0x00000000)



------------------------------------------------------------------------------------------------------------------[/quote]

Anyone can help with SERVER GAME SETTING INFO??? Unknown datas has nothing to do with slots states/races/players in the game, could it be the default slot race ??
June 18, 2009, 7:46 AM
Heinermann
http://code.google.com/p/vgce/source/browse/trunk/docs/Blizzard/Starcraft/packets2.txt
Still slightly outdated.

Notes:
Command class 1 is SNetSendMessage and SNetReceiveMessage via storm.
Command class 2 is SNetSendTurn and SNetReceiveTurns.
Command class 3 is unknown, but used by SNet135. (SNet135 is not used by Starcraft or older Blizzard games, even though storm.dll exports this entry. Someone please check if it is used in WC3 or WoW.)
Command class 0 is used for everything else.

SNetJoinGame uses command IDs 1(const size 4), 2(const size 4), 4(variable size?), 7(variable size?), and 12(const size 12).
SNetSetGameMode uses command ID 14(const size 4).
SNetLeaveGame uses command ID 11(const size 8).
SNetDropPlayer uses command ID 12(const size 12).
SNetInitializeProvider uses command IDs 3(const size 4), 5(variable size?), 6(variable size?), 8(variable size?), 9(variable size?), and 15(const size 4).
SNetGetOwnerTurnsWaiting and some others use command ID 13 (const size 4).

[quote]Anyone can help with SERVER GAME SETTING INFO??? Unknown datas has nothing to do with slots states/races/players in the game, could it be the default slot race ??[/quote]
Try this:
[code]
u16         GameTemplate_gameType;
u16         GameTemplate_subType;
u16         GameTemplate_subTypeDisplay;
u16         GameTemplate_subTypeLabel;
u8          GameTemplate_victoryConditions
               {
                   0x00 = "Map Default",
                   0x01 = "Melee",
                   0x02 = "Highest Score",
                   0x03 = "Resources",
                   0x04 = "CTF",
                   0x05 = "Sudden Death",
                   0x06 = "Slaughter",
                   0x07 = "One on One"
               };
u8          GameTemplate_resourceType
               {
                   0x00 = "Map Default",
                   0x01 = "Fixed Value",
                   0x02 = "Low",
                   0x03 = "Medium",
                   0x04 = "High",
                   0x05 = "Income"
               };
u8          GameTemplate_useStandardUnitStats;
u8          GameTemplate_fogOfWarUnused;
u8          GameTemplate_startingUnits
               {
                   0x00 = "Map Default",
                   0x01 = "Workers Only",
                   0x02 = "Workers and Center"
               };
u8          GameTemplate_useFixedPositions;
u8          GameTemplate_restrictionFlags
               {
                   0x01 = "Allow Computer Players",
                   0x02 = "Allow Single Player"
               };
u8          GameTemplate_alliesAllowed;
u8          GameTemplate_teams;
u8          GameTemplate_cheats;
u8          GameTemplate_tournamentMode;
u32         GameTemplate_victoryConditionValue;
u32         GameTemplate_resourcesValue;
u32         GameTemplate_unused;
u8          extraUnused;[/code]

Units, orders, upgrades, techs, etc. Can all be found in modding tools(DATEdit) and websites(Staredit.net).
October 26, 2009, 2:12 PM

Search