The online racing simulator
unable to get IS_ISI (ISP_ISI) to work
Unable to get the insim init packet to work with the new insim version,

connects okay, and can send data. I try and send this

$packet="";
$packet=pack("c", "44");
$packet.=pack("c", "ISP_ISI");
$packet.=pack("c", "1");
$packet.=pack("c", 0);
$packet.=pack("S", $localport);
$packet.=pack("S", "16+32");
$packet.=pack("c", 0);
$packet.=pack("c", 0);
$packet.=pack("c", 0);
$packet.=str_pad($adminPW, 16, "\0");
$packet.=str_pad("LTC Insim", 16, "\0");
fwrite($sender, $packet, strlen($packet));

and, LFS just complains about incorrect packet size, and incorrect byte on first packet.

Using UDP btw.
#2 - filur
"ISP_ISI" should not go in the packet, you're supposed to send the value of the constant ISP_ISI.


<?php 
define
('ISP_ISI'1);        //  1 - instruction        : insim initialise
?>

oooh I see.

Thanks
it still complains about an incorrect packet size.
i wonder if that's correct : $packet.=pack("S", "16+32");

shouldn't that be : $packet.=pack("S", 16+32);
even with it as $packet.=pack("S", 16+32);, it still complains :|

<?php 
  $localport 
12345;

  
$packet  "";
  
$packet .= pack("c"44);
  
$packet .= pack("c"1);
  
$packet .= pack("c"1);
  
$packet .= pack("c"0);
  
$packet .= pack("S"$localport);
  
$packet .= pack("S"16+32);
  
$packet .= pack("c"0);
  
$packet .= pack("c"0);
  
$packet .= pack("S"0);
  
$packet .= str_pad($adminPW16"\0");
  
$packet .= str_pad("LTC Insim"16"\0");

  echo 
strlen ($packet);
?>

you had a CHAR for Interval where it should be a Short, so your packet was 43 bytes instead of 44
okay, it connects now. thanks a lot!!!
btw, i think you chould write C's for all your c's too - those bytes should be unsigned (C) instead of signed (c)
they are lowercase...?
oops typo in second half of my sentence
so it should be C and not c?

FGED GREDG RDFGDR GSFDG