Es la tercera vez q intento escribir el mensaje y mas tan largo... q si no se puede poner enlaces q si no estas identificado (aunque lo este) yo no se... (mi miniqueja del cabreo de llevar media hora escribiendo .... ya se me pasara...)
En fin, necesito una mano con la lectura de un fichero q se llama csstats.dat que contiene las estadisticas de jugadores de un servidor de counter strike, la idea es hacer q dichas estadísticas salgan en la web leyendo este fichero con php.
Conozco del fichero:
(como no se pueden poner enlaces pos...)
Código:
How to Interpret
int8/uint8 - Signed or Unsigned Byte (8 bits). C types: char, unsigned char
int16/uint16 - Signed or Unsigned Word (16 bits). C types: short, unsigned short
int32/uint16 - Signed or Unsigned Doubleword (32 bits). C types: int, unsigned int
sz - Zero-terminated C-style string
If a size is followed by [N], for example, int8[9], this would mean 9 blocks of int8 data must be read.
CSX (csstats.dat)
The CSSTATS format has RANK_VERSION of 11. The version numbers are considered isolated rather than backwards or forward compatible.
int16 - RANK_VERSION
uint16 - Bytes in first string (if 0, no entries)
sz - Name (read N bytes, where N is previous uint16)
uint16 - Bytes of next string
sz - Steam ID (read N bytes, where N is previous uint16)
uint32 - Team kills
uint32 - Damage
uint32 - Deaths
int32 - Kills
uint32 - Shots
uint32 - Hits
uint32 - Headshots
uint32 - Defusions
uint32 - Defusal Attempts
uint32 - Plants
uint32 - Explosions
uint32[9] - Body Hits (array of ints, one for each body hit area)
uint16 - If zero, end of file. Otherwise, loop back up and read the next name for this many bytes.
Mas o menos claro, pero no se como leer los uint que es lo que se me escapa, a lo mas que llego es a leer la version del archivo. Creo que la solucion esta usando unpack() pero no se hacerlo, aunque lo he intentado
Para abreviar he encontrado scripts q hacen lo que pretendo pero de versiones antiguas del fichero csstats.dat (de más de 3 años) si alguien quiere para ver si se le enciende la bombilla y tambien puedo dar el codigo para interpretar el archivo pero escrito en perl que no tengo ni idea (he intentado probarlo sin exito) y en c# que menos todavia por si ayuda también.
Pos nada espero su ayuda yo y la comunidad de gente que juega al counter strike quedará seguro muy agradecida.
Se me olvidaba... falta el fichero lo puen descargar de busqo.com/mank0s/csstats.zip
Saludos