Hi
Could someone explain me how to read and understand player flags from spr file? I would like to read if driver used mouse or keyboard, braking help etc.
This is how I do it in php:
After that when I print to screen I see for example:
playerFlags -> Array ( [1] => 55 [2] => 51 )
playerFlags2 -> Array ( [1] => 54 )
so playerFlags is 73 (from ascii code 55=7, 51=3) and playerFlags2 = 6
I don't know how to split those two values:
1.
73 = 64(Braking help) + 8(auto shift)+1(left hand drive)
6 = 4(gear change blip) + 2(gear change cut)
2.
736 = 512(auto clutch) + 128(axis clutch)+64(braking help)+32(reserved ?)
3.673 = 512(auto clutch) + 128(axis clutch) + 32(reserved ?) + 1(left hand drive)
Or maybe during reading,converting (unpack) file there is a bug?
Best Regards
Tomasz Zakrecki
Could someone explain me how to read and understand player flags from spr file? I would like to read if driver used mouse or keyboard, braking help etc.
This is how I do it in php:
<?php
fseek($stream,132);
$player_flags = hexdec(bin2hex(fread($stream,1)));
$player_flags = unpack("C*",$player_flags);
fseek($stream,133);
$player_flags2 = hexdec(bin2hex(fread($stream,1)));
$player_flags2 = unpack("C*",$player_flags2);
?>
playerFlags -> Array ( [1] => 55 [2] => 51 )
playerFlags2 -> Array ( [1] => 54 )
so playerFlags is 73 (from ascii code 55=7, 51=3) and playerFlags2 = 6
I don't know how to split those two values:
1.
73 = 64(Braking help) + 8(auto shift)+1(left hand drive)
6 = 4(gear change blip) + 2(gear change cut)
2.
736 = 512(auto clutch) + 128(axis clutch)+64(braking help)+32(reserved ?)
3.673 = 512(auto clutch) + 128(axis clutch) + 32(reserved ?) + 1(left hand drive)
Or maybe during reading,converting (unpack) file there is a bug?
Best Regards
Tomasz Zakrecki