The online racing simulator
IS_TOC error
Error with TOC, when I take over car with other player, I will get an error:

<?php 
IS_TOC Packet from server.
PHP NOTICE:
    
Undefined offset21 in xxxx\modules\prism_statehandler.php on line 416
    1 
:: onTakeOverCar in xxxx\modules\prism_statehandler.php:81
    2 
:: onClientPacket in xxxx\modules\prism_statehandler.php:58
    3 
:: dispatchPacket in xxxx\modules\prism_hosts.php:576
    4 
:: inspectPacket in xxxx\modules\prism_hosts.php:487
    5 
:: handlePacket in xxxx\modules\prism_hosts.php:353
    6 
:: checkTraffic in xxxx\PHPInSimMod.php:228
PHP NOTICE
:
    
Object of class PlayerHandler could not be converted to int in xxxx\modules\prism_statehandler.php on line 416
    1 
:: onTakeOverCar in xxxx\modules\prism_statehandler.php:81
    2 
:: onClientPacket in xxxx\modules\prism_statehandler.php:58
    3 
:: dispatchPacket in xxxx\modules\prism_hosts.php:576
    4 
:: inspectPacket in xxxx\modules\prism_hosts.php:487
    5 
:: handlePacket in xxxx\modules\prism_hosts.php:353
    6 
:: checkTraffic in xxxx\PHPInSimMod.php:228
UNKNOWN
:
    
Argument 1 passed to welcome::onTest() must be an instance of ISP_TOCinstance of IS_TOC givencalled in xxxx\modules\prism_plugins.php on line 156 and defined in xxxx\plugins\welcome.php on line 54
    1 
:: onTest in xxxx\modules\prism_plugins.php:156
    2 
:: dispatchPacket in xxxx\modules\prism_hosts.php:577
    3 
:: inspectPacket in xxxx\modules\prism_hosts.php:487
    4 
:: handlePacket in xxxx\modules\prism_hosts.php:353
    5 
:: checkTraffic in xxxx\PHPInSimMod.php:228
object
(IS_TOC)#11 (8) {
  
["Size"[:p]rotected]=>
  
int(8)
  [
"Type"[:p]rotected]=>
  &
int(31)
  [
"ReqI"[:p]rotected]=>
  
int(0)
  [
"PLID"]=>
  
int(21)
  [
"OldUCID"]=>
  
int(20)
  [
"NewUCID"]=>
  
int(19)
  [
"Sp2"[:p]rotected]=>
  
int(0)
  [
"Sp3"[:p]rotected]=>
  
int(0)
}
?>

Code I am using:

<?php 
public function onTakeOverCar(ISP_TOC $TOC)
    {
        
var_dump($TOC);
    }
?>

Is this a PRISM bug?
Quote from geekas :Is this a PRISM bug?

I believe it should be

<?php 
    
public function onTakeOver(IS_TOC $TOC)
    {
?>

try that, if that doesn't fix it, let me know and I will look further into the issue.

<?php 
PHP NOTICE
:
    
Undefined offset3 in D:\MATAS\testukas\modules\prism_statehandler.php on line 416
    1 
:: onTakeOverCar in D:\MATAS\testukas\modules\prism_statehandler.php:81
    2 
:: onClientPacket in D:\MATAS\testukas\modules\prism_statehandler.php:58
    3 
:: dispatchPacket in D:\MATAS\testukas\modules\prism_hosts.php:576
    4 
:: inspectPacket in D:\MATAS\testukas\modules\prism_hosts.php:487
    5 
:: handlePacket in D:\MATAS\testukas\modules\prism_hosts.php:353
    6 
:: checkTraffic in D:\MATAS\testukas\PHPInSimMod.php:228
PHP NOTICE
:
    
Object of class PlayerHandler could not be converted to int in D:\MATAS\testukas\modules\prism_statehandler.php on line 416
    1 
:: onTakeOverCar in D:\MATAS\testukas\modules\prism_statehandler.php:81
    2 
:: onClientPacket in D:\MATAS\testukas\modules\prism_statehandler.php:58
    3 
:: dispatchPacket in D:\MATAS\testukas\modules\prism_hosts.php:576
    4 
:: inspectPacket in D:\MATAS\testukas\modules\prism_hosts.php:487
    5 
:: handlePacket in D:\MATAS\testukas\modules\prism_hosts.php:353
    6 
:: checkTraffic in D:\MATAS\testukas\PHPInSimMod.php:228
object
(IS_TOC)#11 (8) {
  
["Size"[:p]rotected]=>
  
int(8)
  [
"Type"[:p]rotected]=>
  &
int(31)
  [
"ReqI"[:p]rotected]=>
  
int(0)
  [
"PLID"]=>
  
int(3)
  [
"OldUCID"]=>
  
int(2)
  [
"NewUCID"]=>
  
int(1)
  [
"Sp2"[:p]rotected]=>
  
int(0)
  [
"Sp3"[:p]rotected]=>
  
int(0)
}
?>

Still same...
Known Bug Seems the error is with This Line in the state handler.

Pretty sure this is the fix for that.

Patch for PRISM/modules/prism_statehandler.php [L415:L421]

<?php 
        
public function onTakeOverCar(IS_TOC $TOC)
        {
                
# Adds it to the new client.
                
$this->parent->clients[$TOC->NewUCID]->players[$TOC->PLID] = $this->parent->players[$TOC->PLID];
                
# Removes it from the old client.
                
unset($this->players[$TOC->PLID]);
        }
?>

In theory, that should be it, if anyone wants to give that patch a go and let me know. I'm on a Mac right now, and don't have direct access to the game to test it.
Yes, now it works. Thank you.
I should probably submit that pat h to the master.

FGED GREDG RDFGDR GSFDG