The online racing simulator
IS_OCO packets
I believe to keep overview of all the new packets there must be a separate thread about everyone of them.. So this is about OCO; Object COntrol .. Currently used for starting lights. It's a beta packet at the moment but I would like to share what I have so far;

/modules/prism_packets.php

[...]
define('ISP_OCO', 60); // 60 - instruction : object control (currently used for lights)
$ISP = array(ISP_NONE => 'ISP_NONE', ISP_ISI => 'ISP_ISI', ISP_VER => 'ISP_VER', ISP_TINY => 'ISP_TINY', ISP_SMALL => 'ISP_SMALL', ISP_STA => 'ISP_STA', ISP_SCH => 'ISP_SCH', ISP_SFP => 'ISP_SFP', ISP_SCC => 'ISP_SCC', ISP_CPP => 'ISP_CPP', ISP_ISM => 'ISP_ISM', ISP_MSO => 'ISP_MSO', ISP_III => 'ISP_III', ISP_MST => 'ISP_MST', ISP_MTC => 'ISP_MTC', ISP_MOD => 'ISP_MOD', ISP_VTN => 'ISP_VTN', ISP_RST => 'ISP_RST', ISP_NCN => 'ISP_NCN', ISP_MTC => 'ISP_MTC', ISP_CNL => 'ISP_CNL', ISP_CPR => 'ISP_CPR', ISP_NPL => 'ISP_NPL', ISP_PLP => 'ISP_PLP', ISP_PLL => 'ISP_PLL', ISP_LAP => 'ISP_LAP', ISP_SPX => 'ISP_SPX', ISP_PIT => 'ISP_PIT', ISP_PSF => 'ISP_PSF', ISP_PLA => 'ISP_PLA', ISP_CCH => 'ISP_CCH', ISP_PEN => 'ISP_PEN', ISP_TOC => 'ISP_TOC', ISP_FLG => 'ISP_FLG', ISP_PFL => 'ISP_PFL', ISP_FIN => 'ISP_FIN', ISP_RES => 'ISP_RES', ISP_REO => 'ISP_REO', ISP_NLP => 'ISP_NLP', ISP_MCI => 'ISP_MCI', ISP_MSX => 'ISP_MSX', ISP_MSL => 'ISP_MSL', ISP_CRS => 'ISP_CRS', ISP_BFN => 'ISP_BFN', ISP_AXI => 'ISP_AXI', ISP_AXO => 'ISP_AXO', ISP_BTN => 'ISP_BTN', ISP_BTC => 'ISP_BTC', ISP_BTT => 'ISP_BTT', ISP_RIP => 'ISP_RIP', ISP_SSH => 'ISP_SSH', ISP_CON => 'ISP_CON', ISP_OBH => 'ISP_OBH', ISP_HLV => 'ISP_HLV', ISP_PLC => 'ISP_PLC', ISP_AXM => 'ISP_AXM', ISP_ACR => 'ISP_ACR', ISP_HCP => 'ISP_HCP', ISP_NCI => 'ISP_NCI', ISP_JRR => 'ISP_JRR', ISP_UCO => 'ISP_UCO', ISP_OCO => 'ISP_OCO');

[...]

// OBJECT CONTROL - currently used for switching start lights
// ==============

class IS_OCO extends Struct // Object COntrol
{
const PACK = 'CCxxCCCC';
const UNPACK = 'CSize/CType/CReqI/xZero/COCOAction/CIndex/CIdentifier/CData';

protected $Size = 8; // 8
protected $Type = ISP_OCO; // ISP_OCO
protected $ReqI = null; // 0
public $Zero;

public $OCOAction; // see below
public $Index; // see below
public $Identifier; // identify particular start lights objects (0 to 63 or 255 = all)
public $Data; // see below
}; function IS_OCO() { return new IS_OCO; }

// Index byte

// This can be used to identify a light object from the autocross objects list.
// Currently only AXO_START_LIGHTS and the following special value are supported :

#define OCO_INDEX_MAIN 240 // overrides the main start light system

// Identifier byte corresponds with the indentifier seen in the layout editor

// Values for OCOAction byte

define('OCO_ZERO', 0); // 0 - reserved
define('OCO_1', 1); // 1
define('OCO_2', 2); // 2
define('OCO_3', 3); // 3
define('OCO_LIGHTS_RESET', 4); // 4 - give up control of all lights
define('OCO_LIGHTS_SET', 5); // 5 - use Data byte to set the bulbs
define('OCO_LIGHTS_UNSET', 6); // 6 - give up control of the specified lights
define('OCO_NUM', 7); // 7
$OCO = array(OCO_ZERO => 'OCO_ZERO', OCO_1 => 'OCO_1', OCO_2 => 'OCO_2', OCO_3 => 'OCO_3', OCO_LIGHTS_RESET => 'OCO_LIGHTS_RESET', OCO_LIGHTS_SET => 'OCO_LIGHTS_SET', OCO_LIGHTS_UNSET => 'OCO_LIGHTS_UNSET', OCO_NUM => 'OCO_NUM');

// Data byte is currently used for setting particular bulbs

// Here are the bulb values for the currently available lights :

// bit 0 : red1
// bit 1 : red2
// bit 2 : red3
// bit 3 : green

// AUTOCROSS OBJECTS - reporting / adding / removing
[...]

anyplugin.php;

$pos = strpos($MSO->Msg, '^8$oco');
if ($pos !== false && $lfsname == "cargame.nl") {
$chatline = explode(" ", $MSO->Msg);

// OCOAction5 go into change color mode,
// Index 240 for all lights incl track lights. 149 for AXO_START_LIGHTS. See also https://www.lfs.net/programmer/lyt
// Identifier is set in object layout editor, Data is color in Least significant bit (LSB)
IS_OCO()->OCOAction(5)->Index(149)->Identifier((int)$chatline[4])->Data((int)$chatline[5])->Send($hostID);
}

This is what I have so far. I test with a simple chat message

$oco 2 8

8dec is in binary 1000.. => LSB so need to put the binary numbers in reversed order; 0001 => green bulb will get lit.

see also here; https://www.lfs.net/forum/post/1903161#post1903161
-
(TheNoobisonFire) DELETED by Scawen : spam

FGED GREDG RDFGDR GSFDG