The online racing simulator
ISP_RES dump. Where is CONF_DISQ?
var_dump($RES) gives;
object(IS_RES)#55 (19) {
["Size":protected]=>
int(84)
["Type":protected]=>
int(35)
["ReqI"]=>
int(0)
["PLID"]=>
int(50)
["UName"]=>
string(10) "cargame.nl"
["PName"]=>
string(18) "^1CG^7Ö^4╗^3nl2dav"
["Plate"]=>
string(8) "pwrpff4u"
["CName"]=>
string(3) "FXR"
["TTime"]=>
int(747950)
["BTime"]=>
int(747950)
["SpA":protected]=>
int(0)
["NumStops"]=>
int(0)
["Confirm"]=>
int(6)
["SpB":protected]=>
int(0)
["LapsDone"]=>
int(1)
["Flags"]=>
int(12809)
["ResultNum"]=>
int(1)
["NumRes"]=>
int(2)
["PSeconds"]=>
int(0)
}

Quote :
// Confirmation flags

define('CONF_MENTIONED', 1);
define('CONF_CONFIRMED', 2);
define('CONF_PENALTY_DT', 4);
define('CONF_PENALTY_SG', 8);
define('CONF_PENALTY_30', 16);
define('CONF_PENALTY_45', 32);
define('CONF_DID_NOT_PIT', 64);
define('CONF_DISQ', CONF_PENALTY_DT | CONF_PENALTY_SG | CONF_DID_NOT_PIT);
define('CONF_TIME', CONF_PENALTY_30 | CONF_PENALTY_45);
$CONF = array(CONF_MENTIONED => 'CONF_MENTIONED', CONF_CONFIRMED => 'CONF_CONFIRMED', CONF_PENALTY_DT => 'CONF_PENALTY_DT', CONF_PENALTY_SG => 'CONF_PENALTY_SG', CONF_PENALTY_30 => 'CONF_PENALTY_30', CONF_PENALTY_45 => 'CONF_PENALTY_45', CONF_DID_NOT_PIT => 'CONF_DID_NOT_PIT', CONF_DISQ => 'CONF_DISQ', CONF_TIME => 'CONF_TIME');

int(6) I get, thats 4+2 => confirmed DT

But I want CONF_DISQ. Where is it?
Nowhere, I think.

Making a misinterpretation here.

$CONF is just a breakdown of Confirm

Right?
DISQ - impossible? DT + SG - I think they can't be together once.
I thought there was a separate disqualification flag..

But I guess there isnt.

I use

Quote :if ($onR_Confirm == 6 || $onR_Confirm == 10 || $onR_Confirm == 66) {

6, 10 and 66 now
No, the value of 76 is a disqualification.
76?

That is these three together;

define('CONF_PENALTY_DT', 4);
define('CONF_PENALTY_SG', 8);
define('CONF_DID_NOT_PIT', 64);

Can't be right.
It's a bitwise operation, so in code it would be...

$result = 4 | 8 | 64;

echo $result; // Output '76'

So yup, it is indeed 76.

Edit: But anyway to detect a DISQ it would be something like this:

if ($onR_Confirm & CONF_DISQ) {
// Disqualified
}

Thank you for the backup DarkTimes.
Hahaha

I really had to laugh now. You don't need a backup, you code PHP way better then me. I'm really doing everything old style

But sorry guys, I really don't get this 76 .. I keep using 6, 10 and 66.. It's working. bitwise or not bitwise


.
Quote from cargame.nl :I really don't get this 76

Youtube:
Binary numbers
Logic OR gate
Logic AND gate

Edit:
Nirvana is reached when you realize that you can replace your three-part condition with just a single condition (an AND operation), which is what these numbers were designed for and would also be the case if you were checking for four, ten or n different combinations.

FGED GREDG RDFGDR GSFDG