• Welcome to Valhalla Legends Archive.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - bLueStar

#1
I have no idea how to handle an in-game packet when the resend field is something else than 0.

The seq1 and seq2 of the resend packet determine which one to resend and thats all i know.
Sometime the packet to resend doesnt even exist. And the resend field happen to be more than 1, with 1 byte in the datas .. wtf ??

and another question. that resend thing only happen in lag/packet doesnt reach right ??
#2
Heres some juicy info

Quote from: 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)



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

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