Valhalla Legends Forums Archive | Battle.net Bot Development | Re: SCGP (Starcraft Game Protocol) Spec

AuthorMessageTime
Ringo
I wouldn't normaly post this sort of infomation, but with starcraft2 just around the corner, and sc/bw pretty dead these days, I figger it's pretty harmless.
This infomation is for educational useage only.

This post will contain the basics infomation on the UDP header that starcraft uses for its game traffic.
The post below this one, will contain a list of command 0 messages.
The post below that one, will contain a list of command 1 messages.
Below that, a list of command 2 messages.

This is how I have formatted the documentation:
(BYTE) -- 8 bit integer
(WORD) -- 16 bit integer
(DWORD) -- 32 bit integer
(STRING) -- Null terminated string
(BYTE[X]) -- Array of bytes, where X is the amount of bytes (1 based)
(VOID) -- Variable lengh block of data

This documentation may not be explained (or spelt) very well, so if you have any questions, spot any errors or have things to add, feel free to post them!





[size=6]Header[/size]
[color=yellow]
(DWORD) 0x00
(WORD) Checksum
(WORD) Lengh of message (Discluding the 1st dword)
(WORD) Sent Counter
(WORD) Recv Counter
(BYTE) Packet Command
(BYTE) Packet ID (command 0 only)
(BYTE) Player ID
(BYTE) Status
[/color]

[size=6]Commands[/size]
Command 0:
The data appends the header, the headers packet ID value, is the id of the packet.

Command 1:
The packet ID and its data appends the header. The packet ID is at offset 0x10
The packet ID in the header, is always zero.

Command 2:
Like command 1, the packet appends the header.
How ever, command 2 packets are bufferd and sent every X interval.
appending the header is a que of messages (1 or more)
Each has a unique lengh, and a select few are variable.

[size=6]Status[/size]
Status:
0x00 = Normal Traffic
0x01 = Verification
0x02 = Resend request
0x04 = Callback

Verification:
Used to verify count's.

Resend:
Used to request a given count/packet be resend, due to a brakes in the UDP stream.
For command 2, its possible to have a byte appending the header -- This byte will be an ID of another player in the game. You should respond to such requests with a call back for that player. See callbacks (below)

Call Back:
Used to check up counts between other players.
For example, if player 0 sends a resend request to player 1, but appends player 2's ID behind it, based on the count, player 1 will send player 0 that packet he sent to player 2, including the packet data, but will use the callback status in the responce, as well as filling the player ID value in the header, to that of player 2.
Commonly used in command2 traffic.
For example, if player 0 and 1 has good synq and player 0 and 2 have good synq, but player 1 and 2 are lagging, player 0 will know he has to wait for them to catch up, aka "waiting for player".

[size=6]Checksum[/size]
The checksum value, is of the whole packet buffer, from the lengh value onwards.
Take the following packet, as an example:
[code]
00 00 00 00 28 C4 10 00 00 00 01 00 00 01 FF 00    ....(...........
01 00 00 00                                        ....
[/code]
The data that is checksum'ed is as followed:
[code]
00 00 00 00 28 C4 XX XX XX XX XX XX XX XX XX XX    ....(...........
XX XX XX XX                                        ....
[/code]
Some easy-to-read VB6 code showing how the checksum is generated:
Note: BufLen is the last byte of the packet buffer, offset 6 would be where the lengh value starts in the header.
[code]
    Dim A           As Long
    Dim B           As Long
    Dim C           As Long
    For i = (BufLen) To 6 Step -1
        B = B + Buf(i)
        If (B > &HFF) Then B = B - &HFF
        A = A + B
    Next i
    C = (B * 256) Or (A Mod 255)
    A = &HFF - ((C And &HFF) + (C \ 256)) Mod &HFF
    B = (A + (C \ 256))
    B = &HFF - (B Mod &HFF)
    B = B Or (A * 256)
CheckSum = B And &HFFFF&
[/code]
November 3, 2008, 10:29 AM
Ringo
[size=6]0x01[/size]
SCGP_REQUESTJOIN [C>H]
[color=yellow]
(DWORD) 0x01
[/color]
Sent to host's to start up the join game process.
Host's should respond by sending command 0, packet 0x02.


[size=6]0x02[/size]
SCGP_REQUESTJOINOK [H>C]
[color=yellow]
(DWORD) 0x01
[/color]
Sent to joining players, in responce to command 0, 0x01.


[size=6]0x03[/size]
SCGP_REQUESTJOIN2 [C>H]
[color=yellow]
(DWORD) 0x01
[/color]
Sent to the host in responce to command 0, packet 0x02.
You should also send command 0, packet 0x07 after this one.


[size=6]0x04[/size]
SCGP_PING [C>C]
[color=yellow]
Blank
[/color]
Sent to other players to time their latency, and verify they exist.
Sent every 20seconds.


[size=6]0x05[/size]
SCGP_PONG [C>C]
[color=yellow]
Blank
[/color]
Sent to other in responce to command 0, packet 0x04.
From this, you can calculate the time between 0x04/0x05 to derive the ping of a player.


[size=6]0x06[/size]
SCGP_PLAYER  [H>C]
[color=yellow]
(DWORD) Unknown
(DWORD) Player ID
(BOOLEAN) IsHost
(DWORD) 0x00
(DWORD) Command 2 packet counter
(WORD) Sin_Family
(WORD) Sin_Port
(DWORD) Sin_addr
(DWORD) Sin_Zero - 0x00
(DWORD) Sin_Zero - 0x00
(STRING) Account Name
(STRING) Stat's String
[/color]
Notify's player's of other players in the game, their IP, player number, account and account stats.
This packet is sent to you for each player in the game, other than you're self.
If this is about the hosting player, then the sockaddr_in structure and the account stats will be null.


[size=6]0x07[/size]
SCGP_ENTER [C>H]
[color=yellow]
(STRING) Account name
(STRING) Stats string
(STRING) Game Password
[/color]
Sent to the host after command 0, packet 0x03, to request entry into the game.
If it fails, the host will respond with command 0, 0x0A. Otherwise the host will send you the game data, starting with command 0, packet 0x08.


[size=6]0x08[/size]
SCGP_GAMEDATA [H>C]
[color=yellow]
(DWORD) You're player ID
(DWORD) Max players
(DWORD) Command 2 packet count
(DWORD) Unknown
(DWORD) Game Uptime in seconds
(STRING) Game Name
(STRING) Game Stats String
(STRING) Game Password
[/color]
This supplys you with all the display info, about the given game.
For example, the max number of slots, the game speed etc.


[size=6]0x09[/size]
SCGP_GAMETYPE [H>C]
[color=yellow]
(BYTE) Game Type
(BYTE) League ID
(WORD) Penalty Index
(WORD) Penalty Value
(BYTE[24]) Configeration for said game type
[/color]
This tells you everything you need to know about a given game type and how the game is to be played.
For example, if the game will be useing the map settings, if players teams will be bound (like team melee) and all the other things you can expect from all the other game types and more.
iirc, this game type data can be found in the mpq's.
For example: patch_rt.mpq\Templates\Top Vs. Bottom(1).got
This data can also be sent to clients via the battle.net server, when they logon. Like for example, if they are a WCG player.


[size=6]0x0A[/size]
SCGP_JOINFAIL [H>C]
[color=yellow]
Blank
[/color]
Sent in responce to command 0, packet 0x07, notifying you, that you're request to join the game was rejected.
For example: if you're game password is incorrect.


[size=6]0x0B[/size]
SCGP_QUIT [C>C]
[color=yellow]
(DWORD) Command 2 packet count
(DWORD) 0x40000001
[/color]
Notify's all other players, that the sender has quit the game.
The command 2 count, is used to verify exacly when the player quit.
This should be sent to each player in the game, 3 time's.


[size=6]0x0C[/size]
SCGP_QUITVERIFY? [C>C]?
[color=yellow]
(DWORD) Unknown
(DWORD) Command 2 packet count
(DWORD) Unknown
[/color]
I haven't looked into this packet at all yet, but somthing tells me that it has somthing to do with other player's quitting or dropping.


[size=6]0x0E[/size]
SCGP_GAMESTATE? [H>C]
[color=yellow]
(DWORD) State?
[/color]
I'm pretty sure this tell's players that the game state has changed. For example, game has players, game is full, game has started etc.


[size=6]0x0F[/size]
SCGP_STATSCODE [H>C]
[color=yellow]
(DWORD) Stats Code
[/color]
Notifys a joining player, what stats code to use for this game.
This value is then sent to battle.net in the end game report.
For example:
0x00 = Melee
0x01 = Ladder
0x02 = Iron
0x05 = Kbk etc
Again, iirc, this value is gotten from the .got files, or sent to a client from battle.net for custom game types (like WCG)
November 3, 2008, 10:29 AM
Ringo
[size=6]0x00[/size]
SCGP_GAMECHAT [C>C]
[color=yellow]
(BYTE) 0x00
(STRING) Chat message
[/color]
Sent to talk to other ingame players.
Note: This packet is used for playing the game only.
If you want to talk to players in the game room, you must use command 1, 0x4A.

[size=6]0x49[/size]
SCGP_PLAYERJOIN [H>C]
[color=yellow]
(DWORD) Player ID
[/color]
Notifys other players, that this player has now join'ed the game.
For example, starcraft would display "X has joined the game" and then /stats them, in responce to this.
This is not sent for players who were already in the game.


[size=6]0x4A[/size]
SCGP_ROOMDATA [H>C]
[color=yellow]
(WORD) Map Titleset
(WORD) Map Width
(WORD) Map Height
(BYTE[12]) OWNR
(BYTE[12]) SIDE
(BYTE[12]) OWNR Default
(BYTE[8]) FORC
(BYTE[4]) FORC Flag
(BYTE[8]) RACE
[/color]
The titleset, width and hight, are used by the client and not goten from the map -- these 3 values are used on failth.
Valid titlesets:
0x00 = Badlands
0x01 = Space Platform
0x02 = Installation
0x03 = Ashworld
0x04 = Jungle
0x05 = Desert
0x06 = Arctic
0x07 = Twilight
The OWNR value's are the base room slot value's. They are modifyed values from the map to fit the given game type/room settings etc.
The OWNR default is simply that, the default values from the map file.
The 12 bytes is for each possible player (1 to 12)
See command 2, 0x3E for a list of these values.
The SIDE tells you the race for each player. Thses are modifyed SIDE values from the map file, to fit the given game configeration.
1 SIDE byte for each possible player (1 to 12)
see command 2, 0x3E for a list of SIDE values.
The FORC tells you the force/team index of each player.
For example, 0x00 would mean no team (like melee) and 0x01 to 0x04 means this player/slot belongs to this team.
The FORC Flag gives you the settings for each force.
0x01 = Random start locations
0x02 = Allies
0x04 = Allie victory
0x08 = Shared Vision
The RACE tells you if a player can change their race *I think*. I'm not to sure about the RACE part, but i'm pretty sure thats what it does. For example, disables a player from changing their race.


[size=6]0x4B[/size]
SCGP_TEAMNAME [H>C]
[color=yellow]
(BYTE[30]) Force 1 Name
(BYTE[30]) Force 2 Name
(BYTE[30]) Force 3 Name
(BYTE[30]) Force 4 Name
[/color]
Afaik, This is only sent to joining player's, in Use map setting games, so they can display the name of the teams, before they have downloaded the map.
Each block of 30 bytes is infact a null-terminated string.


[size=6]0x4C[/size]
SCGP_ROOMCHAT [C>C]
[color=yellow]
(STRING) Chat message
[/color]
Sent to talk to other players in the game room.
Note: If you're no longer in the game room, and are playing the game, you must use command 1, packet 0x00 to talk to other players.


[size=6]0x4E[/size]
SCGP_REJECT [H>C]
[color=yellow]
(BYTE) Event
[/color]
Notifys a player of an event.
0x01 = You have been banned.
0x02 = Game creater has closed all avalible slots.
0x03 = Game host has left the game.
0x04 = Unable to join the game.
0x05 = Save game file not found.
0x06 = Unable to write scenario file.
0x07 = Invalid game version.
0x08 = Invalid client version.
0x09 = Unable to authenticate map.
Other = You have been booted.


[size=6]0x4F[/size]
SCGP_MAP [C>C]
[color=yellow]
(WORD) Lengh of payload (discluding this value)
(WORD) Event
Event 0x00:
    (WORD) 0x100
    (DWORD) File Position
Event 0x01:
    (DWORD) File Lengh
    (DWORD) File Checksum
    (STRING) File Name
Event 0x02:
    (BYTE) Player ID
    (DWORD) File Position
Event 0x03:
    Blank
Event 0x04:
    (BYTE) 0x00
    (DWORD) File Position
    (WORD) Data Block Lengh
    (VOID) File Data Block
Event 0x05:
    (BYTE) 0x00
    (DWORD) File Position
[/color]
This packet is used to manage map downloading.
Some important things to note:
Players don't just download the map from the host. The host can request other ingame players send it, if they already have it.
Data blocks are send in blocks of 128 bytes at a time, but you can get away with 256 blocks with out issue.
[color=yellow]Event 0x00 [C>H]:[/color]
Tells the host if you have the map or not.
For example, the map positon tells the host where to start sending the file from.
If you already have the map, then the Map position should be the lengh of the file.
[color=yellow]Event 0x01 [H>C]:[/color]
Asks a player if they have the given map.
Player's should respond to this, with event 0x00.
[color=yellow]Event 0x02 [H>C]:[/color]
Tells the recving player, to send the map to another player.
[color=yellow]Event 0x03 [H>C]:[/color]
I'm not to sure about this one.
This is send to a player who has just finished sending the map to another player, and also when the game is starting.
[color=yellow]Event 0x04 [C>C]:[/color]
used to send a block of the map to another player.
Recving players should verify the block of data, by sending event 0x05.
Any brakes in the UDP stream should be managed with standard resend requests.
[color=yellow]Event 0x05 [C>C]:[/color]
Verifys the position of the map you are currently at.
This should be sent as a respone to event 0x04.


[size=6]0x50[/size]
SCGP_CANTTHINKOFANAME [H>C]
[color=yellow]
blank
[/color]
Player's should respond to this, by sending command 2, 0x40.
It's sent to joiner's as part of the join process, alot with/after command 1, 0x4A.
November 3, 2008, 10:30 AM
Ringo
[size=6]0x05[/size]
SCGP_NULL [C>C]
[color=yellow]
Blank
[/color]
Sent in the stream, when theres nothing else to be sent.

[size=6]0x3C[/size]
SCGP_GAMESTART [H>C]
[color=yellow]
Blank
[/color]
Game is starting.


[size=6]0x3D[/size]
SCGP_DOWNLOAD [C>C]
[color=yellow]
(BYTE) Download Percent
[/color]
Notifys other player's of you're current download percent.
This should be sent in 1 second intervals when you're download percent has changed.


[size=6]0x3E[/size]
SCGP_SLOTUPDATE [H>C]
[color=yellow]
(BYTE) Slot Index
(BYTE) Player Index
(BYTE) Slot State
(BYTE) Race
(BYTE) Team Index
[/color]
Notifys player's of a given game room slot's status.
State's:
0x00 = slot doesnt exist
0x02 = slot is Taken/Human
0x03 = Slot is Rescuable
0x05 = slot is Computer
0x06 = slot is Open
0x07 = slot is Neutral
0x08 = slot is Closed
Race's
0x00 = Zerg
0x01 = Terran
0x02 = Protoss
0x03 = Independent
0x04 = Neutral
0x06 = Random
Note: Stats of Rescuable and Neutral are not shown.


[size=6]0x3F[/size]
SCGP_HUMAN [H>C]
[color=yellow]
(BYTE) 0x00
(BYTE) 0x00
(BYTE) 0x00
(WORD) A
(WORD) B
[/color]
I'm not really sure what this message means.
The value's A and B (and probly the null values) are carbon copys of the values a player sends in command 2, packet 0x40.


[size=6]0x40[/size]
SCGP_MYSHIT [C>C]
[color=yellow]
(DWORD) 0x00
(DWORD) 0x00
(WORD) A
(WORD) B
(BYTE) 0x00
(DWORD) Uniqueness
[/color]
I'm not sure what the A and B values in this message mean, how ever, it seems the host sends them to other players in command 2, packet 0x3F.



[size=6]0x41[/size]
SCGP_CHANGERACE [C>C]
[color=yellow]
(BYTE) Slot Index
(BYTE) Race
[/color]
Request's the race of a given slot be changed.
If changing you're own race, the slot index must be 0x08.
See command 2, packet 0x3E for a list of races.


[size=6]0x42[/size]
SCGP_CHANGETEAMA [C>C]
[color=yellow]
(BYTE) Team Index
[/color]
Request's you be moved to the given team.
Note: This packet is used for none-use map setting games.
To move team in a UMS game, use command 2, packet 0x43.

[size=6]0x43[/size]
SCGP_CHANGETEAMB [C>C]
[color=yellow]
(BYTE) Team Index
[/color]
Request's you be moved to the given team or a new slot with in you're team.
If you are already in the given team, you will be moved to the next avalible slot in you're team.
Note: This packet is used for map setting games only.
To move team in a none-UMS game, use command 2, packet 0x42.


[size=6]0x44[/size]
SCGP_CHANGESLOTSTATE [H>C]
[color=yellow]
(BYTE) Slot Index
(BYTE) State
[/color]
Changes a given slot index to a new state:
0x00 = Computer
0x01 = Open
0x02 = Closed


[size=6]0x45[/size]
SCGP_SLOTSWITCH [H>C]
[color=yellow]
(BYTE) Slot Index From
(BYTE) Slot Index To
[/color]
Switchs 2 slot's. Used in top vs bottom game's, when a host moves a player to another team.


[size=6]0x48[/size]
SCGP_SEED [H>C]
[color=yellow]
(DWORD) Seconds since 1/1/1970
(BYTE) 0x08
(BYTE) 0x08
(BYTE) 0x08
(BYTE) 0x08
(BYTE) 0x08
(BYTE) 0x08
(BYTE) 0x08
(BYTE) 0x08
[/color]
Sent in the cross over between game room and game play.
Seeds game randomization, like for example: Who gets what start location/color/race etc.


For more command 2 messages, see here:
https://davnit.net/bnet/vL/index.php?topic=12107.msg130894#msg130894
November 3, 2008, 10:30 AM
Yegg
Excellent work, Ringo.
November 3, 2008, 7:57 PM
MysT_DooM
sob
November 3, 2008, 11:20 PM
Ringo
[quote author=Yegg link=topic=17702.msg180192#msg180192 date=1225742241]
Excellent work, Ringo.
[/quote]

Thanks :)
Hopefully, it will spark abit of life back into bnet bot development.
I persionaly have lost most of my interest in it.
SCGP can be pretty fun at times tho.
Hmm, I think I should have posted this in the bnet bnet bot development references board. I will leave it up to the mods to decide if its worth it.
November 4, 2008, 5:25 AM
Yegg
I tried getting back into it, and still really wish I could. But due to financial issues, I'm working 62-65 hours a week (not counting breaks) and I'm also taking college classes. The free time that I do have is spent resting.
November 4, 2008, 5:46 AM
xpeh
Wow this is just amazing. It's just a thing i waited for.

I made a sniffer decoder for this, it partially works. I spend almost a day for it, now it shows packet headers and string packet type. I also have a beta decoder for bnet protocol. It's easy to extend and is written in xml for Analyzer network sniffer. Write if you are interested.

What do you think about posting it to bnetdocs.com? I remember a similar site, where you can make comments for every packet. It were much easier to discuss and edit as all in one thread.
January 14, 2009, 7:54 PM
Sixen
Not sure why I never posted here, but hawt Ringo.

[quote="xpeh"]I made a sniffer decoder for this, it partially works. I spend almost a day for it, now it shows packet headers and string packet type. I also have a beta decoder for bnet protocol. It's easy to extend and is written in xml for Analyzer network sniffer. Write if you are interested.[/quote]

/interested
January 15, 2009, 12:44 AM
xpeh
I think we shall add some typical sequences.

For example, what should you send in order client shows you are in lobby?
January 15, 2009, 3:53 AM
xpeh
Did i understand correctly,

2nd post is about command 0, 3rd - command 1 and 4th - about command 2 codes?

Why do you call it 'command'?

How lond is 'boolean' in some packet?
January 15, 2009, 4:04 AM
Ribose
[quote author=xpeh link=topic=17702.msg181208#msg181208 date=1231992285]
Did i understand correctly,

2nd post is about command 0, 3rd - command 1 and 4th - about command 2 codes?
[/quote]
Looks like it.
[quote author=xpeh link=topic=17702.msg181208#msg181208 date=1231992285]
Why do you call it 'command'?
[/quote]
He made it up. What would you call it?
[quote author=xpeh link=topic=17702.msg181208#msg181208 date=1231992285]
How lond is 'boolean' in some packet?
[/quote]
long*
Four bytes. It's a DWORD with value 0x00 (false) or 0x01 (true).
January 15, 2009, 8:54 PM
xpeh
[quote author=Ribose link=topic=17702.msg181219#msg181219 date=1232052875]
[quote author=xpeh link=topic=17702.msg181208#msg181208 date=1231992285]
Did i understand correctly,

2nd post is about command 0, 3rd - command 1 and 4th - about command 2 codes?
[/quote]
Looks like it.
[/quote]
I have to update my decoder.

[quote author=Ribose link=topic=17702.msg181219#msg181219 date=1232052875]
[quote author=xpeh link=topic=17702.msg181208#msg181208 date=1231992285]
Why do you call it 'command'?
[/quote]
He made it up. What would you call it?
[/quote]

Without more information about why he called it so i can say nothing.

Can some1 write what packets i must send and wait for to join a game? VB is not my strong side.
January 15, 2009, 10:31 PM
Ringo
[quote author=xpeh link=topic=17702.msg181224#msg181224 date=1232058668]
[quote author=Ribose link=topic=17702.msg181219#msg181219 date=1232052875]
[quote author=xpeh link=topic=17702.msg181208#msg181208 date=1231992285]
Did i understand correctly,

2nd post is about command 0, 3rd - command 1 and 4th - about command 2 codes?
[/quote]
Looks like it.
[/quote]
I have to update my decoder.

[quote author=Ribose link=topic=17702.msg181219#msg181219 date=1232052875]
[quote author=xpeh link=topic=17702.msg181208#msg181208 date=1231992285]
Why do you call it 'command'?
[/quote]
He made it up. What would you call it?
[/quote]

Without more information about why he called it so i can say nothing.

Can some1 write what packets i must send and wait for to join a game? VB is not my strong side.
[/quote]
Why does it matter so much, what it's called. I persionaly call it "Packet Type", but seems as most people call it "command" on a flat out average, I called it that, so not to cause confusion.

If you read the info of all the above packets, it tells you what ones are used when entering agame, iirc.
Better yet, just packet log a client joining agame.

being good at VB or not, has nothing to do with anything related to this topic tbh, idk what you're getting at there.

I'm just wondering tho, what is you're "strong side" when it comes to computer programming language? are you actualy doing any "Bot Development", or are you just getting "Bot Support", and expressing "Bot Opinions"? :p
January 16, 2009, 1:14 PM
xpeh
All 3.

So, i got some suggestions.

There are at least 3 packet identifier fields - first dword is not always 0, and your so-called "command" and "type" (i would perefer calling it type and subtype, if you don't suggest other, like in 802.11)

Type 2 subtype 5 (scgp_none) - imho it have to be called scgp_syncronize, because if you dont continiously anwer this packets, you get dropped. If you answer these packets, but don't answer others, host in game you joined is able to start game, then after some time he'll get the drop window and is unable to press drop button, as assumed by Python_Max, unless he disconnects from internet.

Maybe this is the reason because my simple bot didn't work - i didn't parsed these packets, and i wasn't showed in lobby.

Do you actually want to upload it to bnetdocs?
January 31, 2009, 4:45 AM
Ringo
[quote author=xpeh link=topic=17702.msg181500#msg181500 date=1233377140]
There are at least 3 packet identifier fields - first dword is not always 0
[/quote]
If the 1st dword is not zero, then it's not a SCGP packet.

[quote author=xpeh link=topic=17702.msg181500#msg181500 date=1233377140]
Type 2 subtype 5 (scgp_none) - imho it have to be called scgp_syncronize, because if you dont continiously anwer this packets, you get dropped. If you answer these packets, but don't answer others, host in game you joined is able to start game, then after some time he'll get the drop window and is unable to press drop button, as assumed by Python_Max, unless he disconnects from internet.
[/quote]
I'm not to sure what you mean, or getting at here.
You don't send type/command 2, packet id 5, ingame.
It's sent only in the game room, when there is no other data in the que buffer.
There is no "answer" to it.
Once the game starts and gets going tho, iirc, the client sends 0x37 each *beat*.
You can however, send them once the game starts, if you're a bot and Just want to idle through the game.
January 31, 2009, 5:17 AM
xpeh
[quote author=Ringo link=topic=17702.msg181502#msg181502 date=1233379057]
[quote author=xpeh link=topic=17702.msg181500#msg181500 date=1233377140]
There are at least 3 packet identifier fields - first dword is not always 0
[/quote]
If the 1st dword is not zero, then it's not a SCGP packet.
[/quote]
Then what kind of packet are they? They still exist.


[quote author=Ringo link=topic=17702.msg181502#msg181502 date=1233379057]
[quote author=xpeh link=topic=17702.msg181500#msg181500 date=1233377140]
Type 2 subtype 5 (scgp_none) - imho it have to be called scgp_syncronize, because if you dont continiously anwer this packets, you get dropped. If you answer these packets, but don't answer others, host in game you joined is able to start game, then after some time he'll get the drop window and is unable to press drop button, as assumed by Python_Max, unless he disconnects from internet.
[/quote]
I'm not to sure what you mean, or getting at here.
You don't send type/command 2, packet id 5, ingame.
It's sent only in the game room, when there is no other data in the que buffer.
There is no "answer" to it.
Once the game starts and gets going tho, iirc, the client sends 0x37 each *beat*.
You can however, send them once the game starts, if you're a bot and Just want to idle through the game.
[/quote]
It doesn't happen - AFAIR game client got a "drop" window very soon. I "played" 1x1 with your bot.

As i saw in sniffer log, client always answer to it with scgp_none with corresponding counters, at least in lobby.

Also, how many different counters are there? At least type 0 and type 2 have different one.

What is iirc?



What do i make wrong?
[code]                                                        #  sentctr    rcvdctr
my $sc_hz      =      "\x03\x00\x00\x00\x00\x00\x00\x00";
                      # |  unknown    |chksum | length | sentctr  | rcvdctr    |cmd|typ|plr|sts|
my $sc_requestjoin =  "\x00\x00\x00\x00\x28\xC4\x10\x00"."\x00\x00"."\x01\x00"."\x00\x01\xFF\x00\x01\x00\x00\x00";

my $sc_requestjoin2 =  "\x00\x00\x00\x00\x40\xA8\x10\x00"."\x01\x00"."\x02\x00"."\x00\x03\xFF\x00\x01\x00\x00\x00";
my $sc_enter =
                      "\x00\x00\x00\x00\xF4\xED\x35\x00"."\x02\x00"."\x02\x00"."\x00\x07\xFF\x00".
                      "nick\0".
                      "PXES 1038 0 157 0 0 1038 0 0 PXES\0\0";

my $sc_pong =          "\x00\x00\x00\x00\x69\x7A\x0C\x00"."\x03\x00"."\x07\x00"."#\x00\x05\x01\x00";

# now send it all in this order

swrite($sc_hz);
swrite($sc_requestjoin);
swrite($sc_requestjoin);
swrite($sc_requestjoin);
swrite($sc_requestjoin2);
swrite($sc_enter);
swrite($sc_pong);


[/code]
The game client doesn't see me.


What means verification flag?


Btw, i don't see any bbcodes panel here.
January 31, 2009, 5:48 AM
Ringo
[quote author=xpeh link=topic=17702.msg181504#msg181504 date=1233380909]
Then what kind of packet are they? They still exist.
[/quote]
Yes, but they are not SCGP packets.
They should be listed on bnet docs.

[quote author=xpeh link=topic=17702.msg181504#msg181504 date=1233380909]
It doesn't happen - AFAIR game client got a "drop" window very soon. I "played" 1x1 with your bot.

As i saw in sniffer log, client always answer to it with scgp_none with corresponding counters, at least in lobby.

Also, how many different counters are there? At least type 0 and type 2 have different one.

What is iirc?
[/quote]
Starting agame (melee, anyway) works fine with this SCGP bot for me.
But like i've said, command 2, packet 5 is not used out side of the game room.
Command 2 packets do not get responded to.
Each player sends any packets qued in their buffer every 250ms in the game room, and about 219ms once the game has started.
If you do have to respond to anything, you simply add the responce to you're command 2 send buffer, so it can be sent next time around.
When that time comes, in the game room, if there is no data in the command 2 send buffer, you send 0x05.

Theres a count for each packet command, for each player.
Command 2, you will probly notice, the counts need to be in synq with all other players.
Thats why all players are pretty much on the same command 2 counts. (or should be, at least)

[quote author=xpeh link=topic=17702.msg181504#msg181504 date=1233380909]
The game client doesn't see me.


What means verification flag?
[/quote]
Because you're not fully joining the game.
From what I can see, you are sending enough infomation to get the game room data -- that is when you actualy join the game.

Pretty sure i've said what the verification flag is used for (if you're talking about what I think you're talking about)
January 31, 2009, 6:33 AM
xpeh
[quote author=Ringo link=topic=17702.msg181512#msg181512 date=1233383590]
[quote author=xpeh link=topic=17702.msg181504#msg181504 date=1233380909]
Then what kind of packet are they? They still exist.
[/quote]
Yes, but they are not SCGP packets.
They should be listed on bnet docs.
[/quote]
Are they? I haven't seen any SC protocol info.

[quote author=Ringo link=topic=17702.msg181512#msg181512 date=1233383590]
When that time comes, in the game room, if there is no data in the command 2 send buffer, you send 0x05.
[/quote]
So this is not a "nop" command,  that can be just ignored, like SID_PING. So it can be called SCGP_LOBBYSYNC or something else.

[quote author=Ringo link=topic=17702.msg181512#msg181512 date=1233383590]
[quote author=xpeh link=topic=17702.msg181504#msg181504 date=1233380909]
The game client doesn't see me.


What means verification flag?
[/quote]
Because you're not fully joining the game.
From what I can see, you are sending enough infomation to get the game room data -- that is when you actualy join the game.
[/quote]
So why it doesn't work?

[quote author=Ringo link=topic=17702.msg181512#msg181512 date=1233383590]
Pretty sure i've said what the verification flag is used for (if you're talking about what I think you're talking about)
[/quote]
Decypher pls.
January 31, 2009, 6:45 AM
Ringo
[quote author=xpeh link=topic=17702.msg181514#msg181514 date=1233384327]
Are they? I haven't seen any SC protocol info.
[/quote]
They are used by all UDP battle.net clients iirc. (if I recall)

[quote author=xpeh link=topic=17702.msg181514#msg181514 date=1233384327]
So this is not a "nop" command,  that can be just ignored, like SID_PING. So it can be called SCGP_LOBBYSYNC or something else.
[/quote]
Like SID_NULL would be a better example, hence why I called it SCGP_NULL or w/e I called it. (Does it really matter, or are you just trolling?)

[quote author=xpeh link=topic=17702.msg181514#msg181514 date=1233384327]
[quote author=Ringo link=topic=17702.msg181512#msg181512 date=1233383590]
Because you're not fully joining the game.
From what I can see, you are sending enough infomation to get the game room data -- that is when you actualy join the game.
[/quote]
So why it doesn't work?
[/Quote]
I just told you.. you're only sending the 1st few packets, to get the game room infomation.
Thats like BNCS 0x50.
Now you actualy have to join the game (see clsSCGP.txt, or a packet log of starcraft)

[quote author=xpeh link=topic=17702.msg181514#msg181514 date=1233384327]
[quote author=Ringo link=topic=17702.msg181512#msg181512 date=1233383590]
Pretty sure i've said what the verification flag is used for (if you're talking about what I think you're talking about)
[/quote]
Decypher pls.
[/quote]
UDP is lossy, clients need to verify counts.
If you mean the status value, being 0x01, then it verifys packet counts.
It's only used in command 0x00/0x01 protocol iirc.
January 31, 2009, 7:17 AM
xpeh
[quote author=Ringo link=topic=17702.msg181517#msg181517 date=1233386254]
Like SID_NULL would be a better example, hence why I called it SCGP_NULL or w/e I called it. (Does it really matter, or are you just trolling?)
[/quote]
Maybe you are just not interested in good protocol documentation? It were nice if the name of packet shows its meaning.
Afaik SID_NULL can be just ignored, can it? And you don't need syncronisation on BNET protocol.

[quote author=Ringo link=topic=17702.msg181512#msg181512 date=1233383590]
I just told you.. you're only sending the 1st few packets, to get the game room infomation.
Thats like BNCS 0x50.
Now you actualy have to join the game (see clsSCGP.txt, or a packet log of starcraft)
[/Quote]
126 kb vbasic code.. No thx.
I send SCGP_ENTER, is it not enough? As it's name says, it must enter a game, no?

[quote author=Ringo link=topic=17702.msg181512#msg181512 date=1233383590]
UDP is lossy, clients need to verify counts.
If you mean the status value, being 0x01, then it verifys packet counts.
It's only used in command 0x00/0x01 protocol iirc.
[/quote]
So how it acts exactly?


And what the hell is iirc?
January 31, 2009, 10:47 AM
MysT_DooM
Dunno if you checked these links out, but they might help
https://davnit.net/bnet/vL/index.php?topic=12107.0
http://www.DarkBlizz.org/Forum/index.php?topic=40.0
February 1, 2009, 12:02 AM
Ringo
[quote author=xpeh link=topic=17702.msg181522#msg181522 date=1233398862]
Maybe you are just not interested in good protocol documentation? It were nice if the name of packet shows its meaning.
Afaik SID_NULL can be just ignored, can it? And you don't need syncronisation on BNET protocol.
[/quote]
I really don't get what you find so hard to undertand.
type 2, packet 5 has nothing to do at all, with sync, as stated a number of times already.
like SID_NULL, it can be ignored.
If you don't understand what the packet does based on its name, read the description.
This is nothing more than a simple guildline for packets and their descriptions.

[quote author=xpeh link=topic=17702.msg181522#msg181522 date=1233398862]
126 kb vbasic code.. No thx.
[/quote]
If you're not willing to read the code I released, or compare the documentation with packet logs, then gtfo.


[quote author=xpeh link=topic=17702.msg181522#msg181522 date=1233398862]
[quote author=Ringo link=topic=17702.msg181512#msg181512 date=1233383590]
UDP is lossy, clients need to verify counts.
If you mean the status value, being 0x01, then it verifys packet counts.
It's only used in command 0x00/0x01 protocol iirc.
[/quote]
So how it acts exactly?
[/quote]
Es verifys Paket zählt.
Schauen Sie einfach in ein Paket anmelden, um zu sehen, wie.
Aber wenn Sie wissen, etwas über das Protokoll an alle, werden Sie wissen, gibt es nur einen Weg, das ist möglich.
February 1, 2009, 7:14 AM
xpeh
[quote author=Ringo link=topic=17702.msg181548#msg181548 date=1233472456]
[quote author=xpeh link=topic=17702.msg181522#msg181522 date=1233398862]
Maybe you are just not interested in good protocol documentation? It were nice if the name of packet shows its meaning.
Afaik SID_NULL can be just ignored, can it? And you don't need syncronisation on BNET protocol.
[/quote]
I really don't get what you find so hard to undertand.
type 2, packet 5 has nothing to do at all, with sync, as stated a number of times already.
like SID_NULL, it can be ignored.
If you don't understand what the packet does based on its name, read the description.
This is nothing more than a simple guildline for packets and their descriptions.
[/quote]
I haven't thought that it can be ignored. Are you really sure it can?

[quote author=Ringo link=topic=17702.msg181548#msg181548 date=1233472456]
[quote author=xpeh link=topic=17702.msg181522#msg181522 date=1233398862]
126 kb vbasic code.. No thx.
[/quote]
If you're not willing to read the code I released, or compare the documentation with packet logs, then gtfo.
[/quote]
So i showed you my packets, why don't it work? I see, you don't really want to help.

[quote author=Ringo link=topic=17702.msg181548#msg181548 date=1233472456]
Es verifys Paket zählt.
Schauen Sie einfach in ein Paket anmelden, um zu sehen, wie.
Aber wenn Sie wissen, etwas über das Protokoll an alle, werden Sie wissen, gibt es nur einen Weg, das ist möglich.
[/quote]
It verifys packet counts.
Just look at a package Sign in to see how.
But if you know anything about the protocol at all, you know, there is only one way, it is possible.
--
It verifys packet count.
Log in to see if we look at the package.
However, if you know of all the agreements, you know, there is only one way, this is possible.
February 1, 2009, 9:01 AM
Ringo
Is this some lame attempt of getting me to answer the same questions over and over ???
I even translated an answer to german, since its possible you simply don't understand english.
[quote]
So i showed you my packets, why don't it work? I see, you don't really want to help.
[/quote]
I see you don't really want to listen, I've told you at least 2 times why and you're still asking me why it doesn't work.

Troll much?
February 1, 2009, 9:35 AM
xpeh
Since you probably don't know any other language, please notice: don't use google translate unless you are really sure that it prodces good readable output.

The only thing you answered is to read sniffer output (you mean i didn't?) or to read vbasic code (i'm not a VB user, as you obviously know).

I think you are the troll of us 2.
February 1, 2009, 9:47 AM
Ringo
[quote author=xpeh link=topic=17702.msg181556#msg181556 date=1233481632]
The only thing you answered is to read sniffer output (you mean i didn't?) or to read vbasic code (i'm not a VB user, as you obviously know).
[/quote]
Yes, i've told you (and now telling you again), what you were sending, was only the start, there is much more to send.
To see what else is sent, you need to review some packet logs.
If you don't understand any packets you are seeing, read the protocol spec, posted in this topic, for a description of each packet.
It will soon become clear what is sent in responce to what, etc.

[quote author=xpeh link=topic=17702.msg181556#msg181556 date=1233481632]
I think you are the troll of us 2.
[/quote]
I acutaly lol'ed at this.



Since there is small chance, you are not trolling, let me brake down a packet dumb for you;
Note, this is a 1.11 or 1.12 packet dump, but shouldn't make any differnce.

[code]
14  :0  192.168.0.4:6112  20  RecvFrom 
0000  00 00 00 00 28 C4 10 00 00 00 01 00 00 01 FF 00    ....(...........
0010  01 00 00 00                                        ....

15  192.168.0.4:6112  :0  20  SendTo 
0000  00 00 00 00 33 B7 10 00 01 00 01 00 00 02 00 00    ....3...........
0010  01 00 00 00                                        ....

16  :0  192.168.0.4:6112  20  RecvFrom 
0000  00 00 00 00 28 C4 10 00 00 00 01 00 00 01 FF 00    ....(...........
0010  01 00 00 00                                        ....

17  :0  192.168.0.4:6112  20  RecvFrom 
0000  00 00 00 00 28 C4 10 00 00 00 01 00 00 01 FF 00    ....(...........
0010  01 00 00 00                                        ....

18  :0  192.168.0.4:6112  20  RecvFrom 
0000  00 00 00 00 40 A8 10 00 01 00 02 00 00 03 FF 00    ....@...........
0010  01 00 00 00                                        ....

19  :0  192.168.0.4:6112  57  RecvFrom 
0000  00 00 00 00 7E 9D 35 00 02 00 02 00 00 07 FF 00    ....~.5.........
0010  54 65 63 68 48 65 6C 70 65 72 00 50 58 45 53 20    TechHelper.PXES
0020  30 20 30 20 30 20 30 20 30 20 30 20 30 20 30 20    0 0 0 0 0 0 0 0
0030  50 58 45 53 00 31 32 33 00                         PXES.123.
[/code]
A client is requesting to join the game.


[code]
21  192.168.0.4:6112  :0  98  SendTo 
0000  00 00 00 00 71 17 5E 00 02 00 03 00 00 08 00 00    ....q.^.........
0010  01 00 00 00 08 00 00 00 1F 00 00 00 05 00 00 00    ................
0020  07 00 00 00 62 62 6E 31 32 33 00 2C 2C 2C 36 2C    ....bbn123.,,,6,
0030  31 2C 32 2C 2C 31 2C 61 66 35 36 35 63 39 2C 34    1,2,,1,af565c9,4
0040  2C 2C 42 65 74 61 2D 50 6C 6F 67 67 65 72 0D 47    ,,Beta-Plogger.G
0050  72 65 65 6E 20 56 61 6C 6C 65 79 73 0D 00 31 32    reen Valleys..12
0060  33 00                                              3.

22  192.168.0.4:6112  :0  66  SendTo 
0000  00 00 00 00 22 C3 3E 00 03 00 03 00 00 06 00 00    ....".>.........
0010  32 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00    2...............
0020  1F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0030  00 00 00 00 42 65 74 61 2D 50 6C 6F 67 67 65 72    ....Beta-Plogger
0040  00 00                                              ..

23  192.168.0.4:6112  :0  20  SendTo 
0000  00 00 00 00 A3 36 10 00 04 00 03 00 00 0F 00 00    .....6..........
0010  00 00 00 00                                        ....

24  192.168.0.4:6112  :0  48  SendTo 
0000  00 00 00 00 78 09 2C 00 05 00 03 00 00 09 00 00    ....x.,.........
0010  02 00 01 00 00 00 00 00 01 01 01 02 02 00 03 01    ................
0020  00 01 00 00 00 00 00 32 00 00 00 00 00 00 00 00    .......2........
[/code]
The host sends that player the game infomation, like who else is in the game.

[code]
25  192.168.0.4:6112  :0  17  SendTo 
0000  00 00 00 00 45 6A 0D 00 1D 00 1F 00 02 00 00 00    ....Ej..........
0010  05                                                 .

26  192.168.0.4:6112  :0  17  SendTo 
0000  00 00 00 00 48 66 0D 00 1E 00 1F 00 02 00 00 00    ....Hf..........
0010  05                                                 .

27  192.168.0.4:6112  :0  16  SendTo 
0000  00 00 00 00 4D 99 0C 00 06 00 03 00 00 04 00 00    ....M...........

29  192.168.0.4:6112  :0  17  SendTo 
0000  00 00 00 00 4B 62 0D 00 1F 00 1F 00 02 00 00 00    ....Kb..........
0010  05                                                 .
[/code]
The host also starts up the command 2 stream with that player, and sends a command 0 ping packet (0x04)

[code]
30  :0  192.168.0.4:6112  16  RecvFrom 
0000  00 00 00 00 69 7A 0C 00 03 00 07 00 00 05 01 00    ....iz..........
[/code]
The player answers the ping with a pong.

[code]
32  :0  192.168.0.4:6112  16  RecvFrom 
0000  00 00 00 00 64 7F 0C 00 04 00 07 00 00 04 01 00    ....d...........
[/code]
The player also now sends a ping to the host

[code]
33  192.168.0.4:6112  :0  16  SendTo 
0000  00 00 00 00 62 80 0C 00 07 00 05 00 00 05 00 00    ....b...........
[/code]
The host answers the ping, with a pong.

[code]
34  :0  192.168.0.4:6112  17  RecvFrom 
0000  00 00 00 00 59 52 0D 00 1F 00 20 00 02 00 01 00    ....YR.... .....
0010  05                                                 .

35  :0  192.168.0.4:6112  17  RecvFrom 
0000  00 00 00 00 5C 4E 0D 00 20 00 20 00 02 00 01 00    ....\N.. . .....
0010  05                                                 .
[/code]
The player also now starts streaming with the host/other players

[code]
36  192.168.0.4:6112  :0  79  SendTo 
0000  00 00 00 00 F8 C8 4B 00 00 00 00 00 01 00 00 00    ......K.........
0010  4A 04 00 00 01 00 01 06 06 06 06 06 06 06 06 00    J...............
0020  00 00 00 06 06 06 06 06 06 06 06 00 00 00 00 06    ................
0030  06 06 06 06 06 06 06 00 00 00 00 01 01 01 01 01    ................
0040  01 01 01 01 00 00 00 01 01 01 01 01 01 01 01       ...............

37  192.168.0.4:6112  :0  17  SendTo 
0000  00 00 00 00 8A 16 0D 00 01 00 00 00 01 00 00 00    ................
0010  50                                                 P
[/code]
The host now sends that player infomation about the game room settings etc.

[code]
42  :0  192.168.0.4:6112  16  RecvFrom 
0000  00 00 00 00 5F 82 0C 00 08 00 08 00 00 00 01 01    ...._...........

44  :0  192.168.0.4:6112  16  RecvFrom 
0000  00 00 00 00 36 B6 0C 00 02 00 02 00 01 00 01 01    ....6...........
[/code]
The client now verifys their command 0 and command 1 counts, to see if all packets got through/any need to be resent.

[code]
45  :0  192.168.0.4:6112  34  RecvFrom 
0000  00 00 00 00 12 33 1E 00 23 00 23 00 02 00 01 00    .....3..#.#.....
0010  40 00 00 00 00 00 00 00 00 01 00 05 00 00 8A D7    @...............
0020  9F 0B                                              ..
[/code]
The player now sends command 2, packet 0x40.
You will see after looking at a few packet logs, this is infact triggerd by the command 1, packet 0x50.


[code]
49  192.168.0.4:6112  :0  21  SendTo 
0000  00 00 00 00 50 51 11 00 02 00 00 00 01 00 00 00    ....PQ..........
0010  49 01 00 00 00                                     I....
[/code]
The host now tells the player, and all other players, that the player has joined the game.
This should trigger the "X has joined the game" message, and players to /astat the player.

[code]
50  192.168.0.4:6112  :0  50  SendTo 
0000  00 00 00 00 A2 55 2E 00 03 00 00 00 01 00 00 00    .....U..........
0010  4F 1F 00 01 00 F5 9C 03 00 9E 9E 77 2A 28 38 29    O..........w*(8)
0020  47 72 65 65 6E 20 56 61 6C 6C 65 79 73 2E 73 63    Green Valleys.sc
0030  6D 00                                              m.
[/code]
The host now asks the player if they have the map.

[code]
56  192.168.0.4:6112  :0  82  SendTo 
0000  00 00 00 00 28 A6 4E 00 26 00 26 00 02 00 00 00    ....(.N.&.&.....
0010  3D 64 3E 07 FF 06 06 00 3E 06 FF 06 06 00 3E 05    =d>.....>.....>.
0020  FF 06 06 00 3E 04 FF 06 06 00 3E 03 FF 06 06 00    ....>.....>.....
0030  3E 02 FF 06 06 00 3E 01 01 02 06 00 3E 00 00 02    >.....>.....>...
0040  06 00 3F 01 00 00 01 00 05 00 3F 00 00 00 01 00    ..?.......?.....
0050  05 00                                              ..
[/code]
The host also now tells the player/other players, whos where in the game room.

[code]
57  :0  192.168.0.4:6112  27  RecvFrom 
0000  00 00 00 00 3C B8 17 00 00 00 04 00 01 00 01 00    ....<...........
0010  4F 08 00 00 00 00 01 F5 9C 03 00                   O..........
[/code]
The player says they have the map.

[code]
60  192.168.0.4:6112  :0  16  SendTo 
0000  00 00 00 00 25 CA 0C 00 01 00 01 00 01 00 00 01    ....%...........
[/code]
The host verifys the command 1 packet counts with the player, to make sure none were lost.
If any were, the player is expected to send a command 1, resend request.

[code]
65  :0  192.168.0.4:6112  18  RecvFrom 
0000  00 00 00 00 C4 36 0E 00 29 00 29 00 02 00 01 00    .....6..).).....
0010  3D 64                                              =d
[/code]
The player tells everyone in the game, that their download is at 100%.

February 1, 2009, 12:26 PM
xpeh
SCTV Proxy
(similar to HLTV)

Is it possible?
February 10, 2009, 8:47 AM
BreW
[quote author=xpeh link=topic=17702.msg181607#msg181607 date=1234255630]
SCTV Proxy
(similar to HLTV)

Is it possible?

[/quote]
Well, I know of a certain SCRGTD.
February 10, 2009, 11:15 PM
chyea
[quote author=brew link=topic=17702.msg181608#msg181608 date=1234307710]
[quote author=xpeh link=topic=17702.msg181607#msg181607 date=1234255630]
SCTV Proxy
(similar to HLTV)

Is it possible?

[/quote]
Well, I know of a certain SCRGTD.
[/quote]

What about G4TV?
February 10, 2009, 11:21 PM
xpeh
Wat's that?

No, i'm not talking about video broadcasting.

It's just a proxy, that act's like a spectator (observer) for the server and like a server for clients watching game.

http://www.slipgate.de/download/HLTV-Readme.txt
February 11, 2009, 5:05 AM
BreW
Well why didn't you say so? We couldn't guess what HLTV is. To me, it was nothing but a seemingly random acronym. I think you need to explicate yourself a little better next time.

Yes, this is possible. Ringo's made something like that once. Perhaps you should use the forum search function to find the associated thread...
February 11, 2009, 8:27 PM
xpeh
I thought anyone knows what HLTV is :) Except he is fixed on bnet :)

What should i search for? Can you probably give me a link? "something like that" - i wonder what is it.
February 12, 2009, 5:55 AM
l2k-Shadow
i think ashur from bwprogrammers attempted something like this as well but gave up on the project. It was called BWTV. www.bwprogrammers.com is no longer active, but google should come up with some leads.
February 12, 2009, 6:00 AM
xpeh
What i want to do is slightly different. I want to operate only with network traffic, so it's no need of downloading any client software, and frees me from anal slavery of memory patchers, dying with every new SC patch.

Those who are familiar with SC game protocol, Ringo, how you think, is it possible?
February 12, 2009, 10:50 AM
l2k-Shadow
make the tv program join a game, in turn it transmits all the packets from that game into your custom bnet server. clients who wanna watch login to that server and then they can choose which game to ob, then the tv program will just relay all packets from the game its observing into the game your client is in. like a big middle man. that could work i believe.
February 13, 2009, 5:10 AM
chyea
Perhaps the person could just join the game, ally both parties and watch????!!!!??!
February 13, 2009, 5:33 AM
xpeh
[quote author=l2k-Shadow link=topic=17702.msg181625#msg181625 date=1234501813]
make the tv program join a game, in turn it transmits all the packets from that game into your custom bnet server. clients who wanna watch login to that server and then they can choose which game to ob, then the tv program will just relay all packets from the game its observing into the game your client is in. like a big middle man. that could work i believe.
[/quote]
I mean this. But there is no need for another server. Just create another game.

"Relay it's packets" - not really correct. I can't just relay all packet, generally it's right, but i need to handle some packets + some situations like client lags without affecting others (main sense of the idea).
February 13, 2009, 6:27 AM
xpeh
[quote author=chyea link=topic=17702.msg181626#msg181626 date=1234503196]
Perhaps the person could just join the game, ally both parties and watch????!!!!??!
[/quote]
1. How many persons could watch the game?
2. What if one of obses lags and you even don't know who? Or he just don't have lan latency on Iccup?
3. What if one of observers annoys in some kind?

If you have something like HLTV with one-way traffic, you can allow other to spectate without any sorrow (except you have very limited upload bandwidth or pay much for traffic :)).

These reasons are so obvious that i wonder that you asked that.
February 13, 2009, 8:10 PM
xpeh
bump
March 23, 2009, 5:52 AM
Ringo
Somone was asking for this function, So I thought I would post it here.
Its used for command 0x01, packet 0x4F, event 0x01.
It generates the checksum of the map, for verifying it's the correct version of the map etc.

VB6:
[code]
Private dword_50D2B0(255)   As Long

Private Sub Form_Load()
    Call FillArray(dword_50D2B0(), _
                   &H0, &H77073096, &HEE0E612C, &H990951BA, &H76DC419, &H706AF48F, &HE963A535, &H9E6495A3, &HEDB8832, &H79DCB8A4, &HE0D5E91E, &H97D2D988, &H9B64C2B, &H7EB17CBD, &HE7B82D07, &H90BF1D91, &H1DB71064, &H6AB020F2, &HF3B97148, &H84BE41DE, &H1ADAD47D, &H6DDDE4EB, &HF4D4B551, &H83D385C7, &H136C9856, &H646BA8C0, &HFD62F97A, &H8A65C9EC, &H14015C4F, &H63066CD9, &HFA0F3D63, &H8D080DF5, &H3B6E20C8, &H4C69105E, &HD56041E4, &HA2677172, &H3C03E4D1, &H4B04D447, &HD20D85FD, &HA50AB56B, &H35B5A8FA, &H42B2986C, &HDBBBC9D6, &HACBCF940, &H32D86CE3, &H45DF5C75, &HDCD60DCF, &HABD13D59, &H26D930AC, &H51DE003A, &HC8D75180, &HBFD06116, &H21B4F4B5, &H56B3C423, &HCFBA9599, &HB8BDA50F, &H2802B89E, &H5F058808, &HC60CD9B2, &HB10BE924, &H2F6F7C87, &H58684C11, &HC1611DAB, &HB6662D3D, &H76DC4190, &H1DB7106, &H98D220BC, &HEFD5102A, &H71B18589, &H6B6B51F, &H9FBFE4A5, &HE8B8D433, &H7807C9A2, &HF00F934, &H9609A88E, &HE10E9818, &H7F6A0DBB, &H86D3D2D, _
                   &H91646C97, &HE6635C01, &H6B6B51F4, &H1C6C6162, &H856530D8, &HF262004E, &H6C0695ED, &H1B01A57B, &H8208F4C1, &HF50FC457, &H65B0D9C6, &H12B7E950, &H8BBEB8EA, &HFCB9887C, &H62DD1DDF, &H15DA2D49, &H8CD37CF3, &HFBD44C65, &H4DB26158, &H3AB551CE, &HA3BC0074, &HD4BB30E2, &H4ADFA541, &H3DD895D7, &HA4D1C46D, &HD3D6F4FB, &H4369E96A, &H346ED9FC, &HAD678846, &HDA60B8D0, &H44042D73, &H33031DE5, &HAA0A4C5F, &HDD0D7CC9, &H5005713C, &H270241AA, &HBE0B1010, &HC90C2086, &H5768B525, &H206F85B3, &HB966D409, &HCE61E49F, &H5EDEF90E, &H29D9C998, &HB0D09822, &HC7D7A8B4, &H59B33D17, &H2EB40D81, &HB7BD5C3B, &HC0BA6CAD, &HEDB88320, &H9ABFB3B6, &H3B6E20C, &H74B1D29A, &HEAD54739, &H9DD277AF, &H4DB2615, &H73DC1683, &HE3630B12, &H94643B84, &HD6D6A3E, &H7A6A5AA8, &HE40ECF0B, &H9309FF9D, &HA00AE27, &H7D079EB1, &HF00F9344, &H8708A3D2, &H1E01F268, &H6906C2FE, &HF762575D, &H806567CB, &H196C3671, &H6E6B06E7, &HFED41B76, &H89D32BE0, &H10DA7A5A, _
                   &H67DD4ACC, &HF9B9DF6F, &H8EBEEFF9, &H17B7BE43, &H60B08ED5, &HD6D6A3E8, &HA1D1937E, &H38D8C2C4, &H4FDFF252, &HD1BB67F1, &HA6BC5767, &H3FB506DD, &H48B2364B, &HD80D2BDA, &HAF0A1B4C, &H36034AF6, &H41047A60, &HDF60EFC3, &HA867DF55, &H316E8EEF, &H4669BE79, &HCB61B38C, &HBC66831A, &H256FD2A0, &H5268E236, &HCC0C7795, &HBB0B4703, &H220216B9, &H5505262F, &HC5BA3BBE, &HB2BD0B28, &H2BB45A92, &H5CB36A04, &HC2D7FFA7, &HB5D0CF31, &H2CD99E8B, &H5BDEAE1D, &H9B64C2B0, &HEC63F226, &H756AA39C, &H26D930A, &H9C0906A9, &HEB0E363F, &H72076785, &H5005713, &H95BF4A82, &HE2B87A14, &H7BB12BAE, &HCB61B38, &H92D28E9B, &HE5D5BE0D, &H7CDCEFB7, &HBDBDF21, &H86D3D2D4, &HF1D4E242, &H68DDB3F8, &H1FDA836E, &H81BE16CD, &HF6B9265B, &H6FB077E1, &H18B74777, &H88085AE6, &HFF0F6A70, &H66063BCA, &H11010B5C, &H8F659EFF, &HF862AE69, &H616BFFD3, &H166CCF45, &HA00AE278, &HD70DD2EE, &H4E048354, &H3903B3C2, &HA7672661, &HD06016F7, &H4969474D, &H3E6E77DB, _
                   &HAED16A4A, &HD9D65ADC, &H40DF0B66, &H37D83BF0, &HA9BCAE53, &HDEBB9EC5, &H47B2CF7F, &H30B5FFE9, &HBDBDF21C, &HCABAC28A, &H53B39330, &H24B4A3A6, &HBAD03605, &HCDD70693, &H54DE5729, &H23D967BF, &HB3667A2E, &HC4614AB8, &H5D681B02, &H2A6F2B94, &HB40BBE37, &HC30C8EA1, &H5A05DF1B, &H2D02EF8D)
End Sub

Private Sub FillArray(ByRef varArray() As Long, ParamArray varValue() As Variant)
    Dim i       As Long
    For i = 0 To UBound(varValue)
        varArray(i) = varValue(i)
    Next i
End Sub
Private Function sub_410430(B() As Byte, Lengh As Long, Seed As Long) As Long
    Dim i       As Long
    Dim R       As Long
    R = Seed
    For i = 0 To (Lengh - 1)
        If (R And &H80000000) Then
            R = ((((R And &H7FFFFFFF) \ 256) Or &H800000) Xor dword_50D2B0((R Xor B(i)) And &HFF))
        Else
            R = ((R \ 256) Xor dword_50D2B0((R Xor B(i)) And &HFF))
        End If
    Next i
    sub_410430 = R
End Function
[/code]


C:
[code]
__int32 dword_50D2B0[] = {0x0, 0x77073096, 0xEE0E612C, 0x990951BA, 0x76DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0xEDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x9B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x1DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x6B6B51F, 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0xF00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x86D3D2D,
                   0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x3B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x4DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0xD6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0xA00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A,
                   0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x26D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x5005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0xCB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0xBDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
   0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D};




__int32 __stdcall sub_410430(__int32 buffer, __int32 *len, __int32 *seed)
{
  __int32 r = *seed;
  __int32 a = *len;
  if ( a )
  {
    do
    {
      r = ((unsigned __int32)r >> 8) ^ dword_50D2B0[(unsigned __int8)(r ^ *(__int8 *)buffer++)];
    }
    while ( --a );
  }
  return r;
}
[/code]

I'm abit drunk, so code is about sloppy :p

I used this map are a test map@
\old ladder\(8)Green Valleys.scm
Checksum = 0x2A779E9E

You just dump the raw file data into the function, and it returns the checksum.
ie;
sub_410430(filebuffer, lengh, 0xFFFFFFFF)
April 9, 2009, 8:19 AM
xpeh
Maybe it's some modification of CRC32? Can you check this out?
April 10, 2009, 4:28 PM
xpeh
What is seed?

Is it the same checksum that client sends to server in statstring?
July 7, 2009, 10:37 PM
islanti
[quote author=Ringo link=topic=17702.msg182264#msg182264 date=1239265180]
Somone was asking for this function, So I thought I would post it here.
Its used for command 0x01, packet 0x4F, event 0x01.
It generates the checksum of the map, for verifying it's the correct version of the map etc.

I'm abit drunk, so code is about sloppy :p

I used this map are a test map@
\old ladder\(8)Green Valleys.scm
Checksum = 0x2A779E9E

You just dump the raw file data into the function, and it returns the checksum.
ie;
sub_410430(filebuffer, lengh, 0xFFFFFFFF)
[/quote]

That looks awfully like CRC32...
July 9, 2009, 5:34 AM
xpeh
Maybe someone hears me, i have a feeling i write into space...
Can you post test file, the seed and it's checksum? I probably have another version of this map.
July 14, 2009, 11:48 AM

Search