Jump to content

RA95 3.03 WOL GAMERES/statistics packet info


Iran

Recommended Posts

Here I'll attempt to document the complete workings of the RA95 3.03 WOL GAMERES/statistics packet works. I'll use info from CCHyper's database and info from the PVPGN wiki. Doing this cause FunkyFr3sh needs this info and the PVPGN wiki is missing info.

 

I'll work on this thread tomorrow

 

First 4 bytes are the packet size as 32-bit integer.

 

Designed for 1vs1 player games but also saves house specific data for up to 8 players, aligned on 4 bytes, first 4 bytes are packet size. Data in network format. The game internally calls every tag and its data a "field", a field looks like this:

 

-4 bytes for the ASCII ID

-2 bytes (one WORD) for field type

-2 bytes (one WORD)  for length

-data based on length specified

-OPTIONAL junk to keep 32-bit alignment

 

An example is:

F R M T 00 06 00 04 [00 00 00 02] 

 

ASCII ID = "F R M T", field type is 00 06 (0x6), length is 00 04 (0x4) and the data based on that length is a 4 byte 00 00 00 02 which is network format for 0x2)

 

Game settings etc:

 

SDFX -> Sudden Disconnect From X, WOL specific, can be either 1 or 0. When 1 there was a sudden disconnect from the other player.

 

S D F X 00 02 00 01 [01] 00 00 00 (1 -> so sudden disconnect from the other player)

 

IDNO -> Game ID Number

 

I D N O 00 06 00 04 [00 00 00 00]

 

NUMP ->  Number of human players at the start of the game

 

N U M P 00 06 00 04[ 00 00 00 02] (0x2)

 

REMN -> Number of REMAINING human players

 

R E M N 00 06 00 04 [00 00 00 02]

 

TRNY -> Tourney or not, 1 or 0

 

T R N Y 00 06 00 04 [00 00 00 00] (normal game)

T R N Y 00 06 00 04 [00 00 00 01] (turnament)

 

CRED -> Starting Credits

 

C R E D 00 06 00 04 [00 00 27 10]  (0x2710, 10,000 starting credits)

 

BASE -> Bases, ON or OFF

 

B A S E 00 07 00 03 [4F 4E 00] 00  ("ON", 4F 4E is ASCII for "ON" third byte is a NULL terminator and 4th byte (00) isn't used)

 

TIBR -> Ore Regenerates, ON or OFF

 

T I B R 00 07 00 03 [4F 4E 00] 00 ("ON", same explanation as giving by BASE just above)

 

CRAT -> Crates Enabled, ON or OFF

 

C R A T 00 07 00 04 [4F 46 46 00] ("OFF", 4F 46 46 is ASCII for "OFF", 4th byte is null terminator (00))

 

AIPL -> Number of AI Players

 

A I P L 00 06 00 04 [00 00 00 01] (one AI player)

 

SHAD -> Shroud Regrows, ON or OFF

 

S H A D 00 07 00 04 [4F 46 46 00] ("OFF")

 

FLAG -> CTF Enabled, ON or OFF

 

F L A G 00 07 00 04 [4F 46 46 00] ("OFF")

 

UNIT -> Starting Units

 

U N I T 00 06 00 04 [00 00 00 0a] (0x0A = 10 starting units)

 

TECH -> Tech Level

 

T E C H 00 06 00 04 [00 00 00 0A]

 

SCEN -> Scenario name (NOT file name, the full map name), C-style string

 

S C E N 00 07 00 13 [41 20 50 61 74 68 20 42 65 79 6f 6e 64 20 28 4c 67 29 00] 00 (size is 0x13 = 19, C-style string so last byte is a terminator byte 00 and then there's a junk 00 byte for alignment)

 

ADR1 -> IP Address of the first player? (with spawner can be incorrect or always is)

 

A D R 1 00 07 00 0F [31 37 33 2E 32 31 2E 31 31 34 2E 31 36 37 00] 00 (size is variable, in this case it's 0x0F including the NULL terminator (00), aditional 00 for padding)

 

ADR2 -> IP Address of the second player? (with spawner can be incorrect or always is)

 

Same format as by ADR1, except ADR2 is used as ID for the field.

 

PING -> Ping (with spawner is missing, only included with WOL games when connection is lost)

 

NOTE: Doesn't work with spawner, only WOL and this will only be sent if connection was lost. The end result should be formatted like ""%d/5 %d/5", where '%d' is an integer(0/5 0/5) not sure what the meaning is but it's probably a ping rating. Not sure if 0/5 or 5/5 is best rating and how PING is determined (e.g. possibly by querying the WOL master server)

 

P I N G 00 07 00 08 [30 2F 35 20 30 2F 35 00] (length 8 C-style string including NULL terminator (00) byte, in this case it's "0/5 0/5")

 

CMPL -> Game Result (for this client), with the following possible results (taken from C&C95):

 

64 = game is draw

6 = player 1 disconnect (also when player aborts in options menu ingame)

5 = player 1 resigned (doesn't seem to be used, when player resignes the 'lost' value is used)

4 = player 1 lost

3 = player 2 disconnect  (also when player aborts in options menu ingame)

2 = player 2 resigned (doesn't seem to be used, when player resignes the 'lost' value is used)

1 = player 2 lost

0 = connection lost

-1 (0xFF) = Host left?

 

C M P L 00 01 00 01 [03] 00 00 00  (3 in this case, which means player 2 disconnected)

 

TIME -> Start Time,  in "UNIX time" format (data initialized with a time() C standard library call)

 

T I M E 00 05 00 04 [00 00 00 00]

 

DURA -> Game Duration, in seconds

 

D U R A 00 05 00 04 [00 00 00 28]

 

AFPS -> Average FPS

 

A F P S 00 05 00 04 [00 00 00 31] (0x31 = 49 FPS)

 

PROC -> Processor family, this contains valid data in C&C95 set via a CPUID function. But in RA95 this function doesn't exist so this is always 00, the data is returned as a byte which you'll need Intel's documentation for to be able to convert this into an actual processor family name in C&C95

 

P R O C 00 01 00 01 [00] 00 00 00 (value 00)

 

MEMO -> Total Memory, taken from WINAPI GlobalMemoryStatus()'s Buffer.dwTotalPhys

 

M E M O 00 05 00 04 [FF 70 D0 00]

 

VIDM -> Video Memory, in bytes taken from a DDCAPS struct returned from IDirectDraw::GetCaps, uses the DDCAPS.VideoMemTotal field, it then does a "ADD 0x0FFFFF" and "AND 0x0FFF00000" to that number

 

NOTE: cnc-ddraw sets this to 16777216 (0x1000000)

 

V I D M 00 05 00 04 01 00 00 00

 

SPED-> Game Speed, 0 is fastest 6 is slowest

 

S P E D 00 01 00 01 [06] 00 00 00 (6 = slowest speed)

 

VERS -> Game Version with 'V' prepended, for 3.03 it's "V3.0", C-style string, is variable length

 

V E R S 00 07 00 05 [56 33 2E 30 00] 00 00 00 (C-Style string, 56 33 2E 30 is "V3.0", then a null terminator byte (00) and three junk bytes for alignment

 

QUIT -> NOTE: THIS IS BUGGED in that's it is supposed to be 3 characters plus the player number (e.g. QUIx) instead of QUIT as this is per player. You will find this data field multiple times in this statistics packet/dump, each is per player. Can be either 1 or 0, if it is 1 the player quit the game.

 

This code behind this loops over every player and adds this field (with more than one player multiple time) as "QUIT", but unlike all the other per player stuff it doesn't use any of the tricks to get the number at the end of the field (e.g. "1" in "NAM1") and uses 4 characters. So the code is half-assed per player and half-assed global..

 

To check for what player a QUIT field corresponds to keep a variable with the last player you handled a field for, if you handle the packet one for one in sequence (instead of searching for fields in the packet one by one till you have all your fields) the QUIT field should be between the SIDx and NAMx fields for the same player, so you can use the variable for the last player you kept to check what player the QUIT field corresponds to.

 

NOTE ALSO: This is set to 0 if the client who is sending this statistics packet leaves the game, when it should be 1

 

Q U I T 00 02 00 01 [00] 00 00 00

 

DATE -> LastWriteTime of the game executable, NOT IN UNIX FORMAT, the game takes the LastWriteTime field returned from WINAPI GetFileTime(), converts it into network format then sends the LastWriteTime field, TWO DWORDS (32-bit ints) are sent, one is LastWriteTime.dwLowDateTime and one is LastWriteTime.dwHighDateTime, BOTH converted to network format.

 

DATE : Date...

D A T E 00 14 00 08 [05 BA 5A 23 01 CE 4A 94] (05 BA 5A 23 is FILETIME.dwLowDateTime in network format, 01 CE 4A 94 is FILETIME.dwHighDateTime in network format)

 

See MSDN documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724284(v=vs.85).aspx

 

 

Per player stuff, in the following 'x' can be 1-8 for each player:

 

NAMx ->  Player Handle (NOTE: Computer players will have no data for their NAMx field, players who've left and who's control has been taken over by a computer player will have the original player name listed, NOT "Computer"

 

N A M 1 00 07 00 05 [49 72 61 6E 00] 00 00 00 (C-style string, the length can be variable and includes the null terminator, 49 72 61 6E is "Iran" and the next 00 byte is the null terminator, the other three 00 bytes are garbage)

N A M 1 00 07 00 01 [00] 00 00 00 (Data for computer players, always a NULL string (00 byte) like this)

 

SIDx ->  Player Team, for possible values see the houses abbreviations list below

 

S I D 1 00 07 00 04 [46 52 41 00] (C-style string, 46 52 41 = "FRA", the 00 is the string terminator)

 

COLx -> Player Color, doesn't work correctly in 3.03 (not sure about earlier versions). the code for RA95 does some weird stuff and grabs the HouseType (see HouseTypes.txt) of the player and subtracts it by 0x0C. But in C&C95 it's probably a working PlayerColourType (see PlayerColorTypes.txt)

 

C O L 3 00 02 00 01 [02 00 00 00] (value is 0x2 which means the player is multi3 as house..)

 

CRDx ->  Player Credits

 

C R D 3 00 05 00 04 [00 00 25 E4] (0x25E4 = 9700 credits)

 

CRAx  ->  Player Crates Found, list of crates and the amount found

 

C R A 2 [00 14 00 48] (size 48)

00 00 00 01 (1 Money crate)

00 00 00 03 (3 Unit crates)

00 00 00 02 (2 ParaBomb crate)

00 00 00 00 (heal crate)

00 00 00 00  (stealth crate)

00 00 00 00 (explosion crate)

00 00 00 01 (1 napalm death crate)

00 00 00 01 (1 squad crate)

00 00 00 00 (darkness/map reshroud crate)

00 00 00 00 (map reveal crate)

00 00 00 00 (sonar pulse crate)

00 00 00 00 (armor upgrade crate)

00 00 00 00 (speed upgrade crate)

00 00 00 01 (firepower upgrade crate)

00 00 00 01 (one shot nuke missile crate)

00 00 00 00 (Time Quake crate)

00 00 00 00 (invulnerability/iron curtain crate)

00 00 00 00 (chrono vortex crate)

 

HRVx  -> Player Amount Money Harvested (from ore/gems)

 

H R V 1 00 06 00 04 [00 00 02 BC] (Money harvested is 0x2BC = 700)

 

UNLx  ->  Player Units Left (units = vehicles, NOT total units)

 

U N L 1 00 14 00 58 (yes size is 58!)

 

00 00 00 02 (2 mammoth tanks)

00 00 00 06 (6 heavy tanks)

00 00 00 05 (5 Medium Tanks

00 00 00 04 (4 light tanks)

00 00 00 03 (3 APCs)

00 00 00 03 (3 minelayers, Anti-Tank AND Anti-Personnel)

00 00 00 02 (2 Rangers left)

00 00 00 02 (2 Ore Trucks left)

00 00 00 02 (2 Artillery)

00 00 00 01 (1 MRJ)

00 00 00 05 (5 mobile gap generators)

00 00 00 01 (1 MCV)

00 00 00 05 (5 v2 rocket launchers)

00 00 00 09 (9 Supply Trucks)

00 00 00 01 (1 ANT1)

00 00 00 06 (6 ANT2)

00 00 00 04 (4 ANT3)

00 00 00 02 (2 Chrono Tanks)

00 00 00 04 (4 Tesla Tanks)

00 00 00 01 (1 MAD tank)

00 00 00 03 (3 demo trucks)

00 00 00 05 (5 phase transports)

 

INLx ->  Player Infantry Left

 

I N L 1 00 14 00 68

 

00 00 00 0A (0x0A = 10 rifle infantry)

00 00 00 09 (9 grenadiers)

00 00 00 06 (6 rocket soldiers)

00 00 00 05 (5 flamethrowers

00 00 00 03 (3 engineers)

00 00 00 01 (one tanya

00 00 00 05 (5 spies)

00 00 00 03 (3 thieves)

00 00 00 01 (1 medic)

00 00 00 04 (4 GNRLs)

00 00 00 04 (4 dogs)

00 00 00 03 (3 C1s)

00 00 00 08 (8 C2s)

00 00 00 09 (9 C3s)

00 00 00 02 (2 C4s)

00 00 00 05 (5 C5s)

00 00 00 01 (1 C6)

00 00 00 04 (4 C7s)

00 00 00 07 (7 C8s)

00 00 00 05 (5 C9s)

00 00 00 1a (0x1A= 26 C10s)

00 00 00 09 (9 EINSTEINs)

00 00 00 06 (6 DELPHIs)

00 00 00 03 (3 CHANs)

00 00 00 00 (1 shock trooper)

00 00 00 02 (2 mechs)

 

PLLx -> Player Planes Left

BLLx -> Player Buildings Left

 

B L L 1 00 14 01 5C

00 00 00 01 (1 Allied Tech Center) ; 0

00 00 00 01 (1 Iron Curtain) ; 1

00 00 00 04 (4 Weapon Factories) ; 2

00 00 00 06 (6 Chronospheres) ; 3

00 00 00 04 (4 pillboxes)  ; 4

00 00 00 03 (3 camo pillboxes) ; 5 

00 00 00 03 (3 radar domes) ; 6

00 00 00 09 (9 Gap Generators) ; 7

00 00 00 02 (2 turrets) ; 8

00 00 00 05 (5 AA guns) ; 9

00 00 00 00 (4 flame towers) ; 10

00 00 00 01 (1 Conyard) ; 11

00 00 00 02 (2 refineries) ; 12

00 00 00 06 (6 ore silos) ; 13

00 00 00 02 (2 helipads) ; 14

00 00 00 03 (3 sam sites) ; 15

00 00 00 03 (3 Airfields) ; 16

00 00 00 02 (2 Power plants) ;17

00 00 00 04 (4 advanced power plants) ;18

00 00 00 03 (3 soviet tech centers) ; 19

00 00 00 01 (1 Hospital)  ; 20

00 00 00 03 (3 Soviet Barracks) ; 21

00 00 00 05 (5 Allies Barracks)  ; 22

00 00 00 05 (5 kennels) ; 23

00 00 00 05 (5 service depots) ;24

00 00 00 03 (3 Bio Research Facilities aka BIO) ;25

00 00 00 04 (4 Technology Centers, those buildings with 3 domes) ;26

00 00 00 01 (1 shipyard) ;27

00 00 00 01 (1 subpen) ;28

00 00 00 02 (2 missile silos) ; 29

00 00 00 00 (Forward Command Post aka FCOM) ; 30

00 00 00 04 (4 tesla coils) ; 31

00 00 00 05 (5 fake War Factories; 32

00 00 00 08 (8 fake Conyards) ; 33

00 00 00 05 (5 fake Allies Shipyards) ; 34

00 00 00 03 (3 fake Soviet Subpens, unbuidable with default rules.ini) ; 35

00 00 00 02 (2 fake Radar Domes) ; 36

00 00 00 09 (9 sandbags) ; 37

00 00 00 05 (5 Chain-Link fences) ; 38

00 00 00 02 (2 concrete walls) ; 39

00 00 00 08 (8 Barbwire Fences) ; 40

00 00 00 05 (5 Wooden Fences) ; 41

00 00 00 06 (6 Wire Fences) ; 42

00 00 00 04 (4 anti-vehicle mines) ; 43

00 00 00 06 (6 anti-personnel mines) ; 44

00 00 00 01 (1 V1) ; 45

00 00 00 01 (1 V2) ; 46

00 00 00 01 (1 V3) ; 47

00 00 00 01 (1 V4) ; 48

00 00 00 01 (1 V5) ; 49

00 00 00 01 (1 V6) ; 50

00 00 00 01 (1 V7) ; 51

00 00 00 01 (1 V8) ; 52

00 00 00 01 (1 V9) ; 53

00 00 00 01 (1 V10) ; 54

00 00 00 01 (1 V11) ; 55

00 00 00 01 (1 V12) ; 56

00 00 00 01 (1 V13) ; 57

00 00 00 01 (1 V14) ; 58

00 00 00 01 (1 V15) ; 59

00 00 00 01 (1 V16) ; 60

00 00 00 01 (1 V17) ; 61

00 00 00 01 (1 V18) ; 62

00 00 00 01 (1 V19) ; 63

00 00 00 01 (1 V20) ; 64

00 00 00 01 (1 V21) ; 65

00 00 00 01 (1 V22) ; 66

00 00 00 01 (1 V23) ; 67

00 00 00 01 (1 V24) ; 68

00 00 00 01 (1 V25) ; 69

00 00 00 01 (1 V26) ; 70

00 00 00 01 (1 V27) ; 71

00 00 00 01 (1 V28) ; 72

00 00 00 01 (1 V29) ; 73

00 00 00 01 (1 V30) ; 74

00 00 00 01 (1 V31) ; 75

00 00 00 01 (1 V32) ; 76

00 00 00 01 (1 V33) ; 77

00 00 00 01 (1 V34) ; 78

00 00 00 01 (1 V35) ; 79

00 00 00 01 (1 V36) ; 80

00 00 00 01 (1 V37) ; 81

00 00 00 01 (1 BARL, barrel) ; 82

00 00 00 01 (1 BARL3, group of barrels) ; 83

00 00 00 03 (3 Ant Queens) ; 84

00 00 00 06 (6 LAR1s, aka Larva1) ; 85

00 00 00 09 (9 LAR2s, aka Larva2) ; 86

 

VSLx -> Player Vessels Left (NOTE: RA95 is bugged and sends this data in PC format (little endian) instead of network format (big endian))

 

V S L 2 00 14 00 1C

02 00 00 00 (2 submarines)

08 00 00 00 (8 destroyers)

05 00 00 00 (5 cruisers)

04 00 00 00 (4 LST transports)

03 00 00 00 (3 gunboats)

01 00 00 00 (1 Missile Sub)

02 00 00 00 (2 Helicarriers, hidden Aftermath unit)

 

PLLx ->  Player Planes Left

 

P L L 1  00 14 00 1C

00 00 00 01 (1 Chinook)

00 00 00 04 (4 Badger Bombers)

00 00 00 03 (3 U2 Spy Planes)

00 00 00 02 (2 migs)

00 00 00 01 (1 yak)

00 00 00 01 (1 longbow)

00 00 00 02 (2 Hinds)

 

UNBx -> Player Units Bought (units = vehicles, NOT total units)

INBx  -> Player Infantry Bought (excluding infantry left)

PLBx ->  Player Planes Bought

BLBx -> Player Buildings Bought

VSBx  -> Player Vessels Bought

UNKx ->  Player Units Killed (units = vehicles, NOT total units)

INKx  ->  Player Infantry Killed

PLKx ->  Player Planes Killed

BLKx ->  Player Buildings Killed

VSKx ->  Player Vessels Killed

BLCx  ->  Player Buildings Captured

 

From my testing and looking at the code it appears that the lost and bought stats always have the same values

 

Houses abbreviations, used by the SIDx (player team) field:

 

"SPA" (Spain)

"GRE" (Greece)

"USS" (USSR)

"ENG" (England)

"ITA" (stands for Italy, but is actually Ukraine)

"GER" (Germany)

"FRA" (France)

"TKY" (Turkey)

"GUD" (GoodGuy)

"BAD" (BadGuy)

"CIV" (Civilian)

"JP " (Special) (NOTE SPACE CHARACTER AFTER 'P')

"M01" (Multi1)

"M02" (Multi2)

"M03" (Multi3)

"M04" (Multi4)

"M05" (Multi5)

"M06" (Multi6)

"M07" (Multi7)

"M08" (Multi8)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...