The online racing simulator
Parsing and writing layouts in php
Hi,

Two years ago I wrote some java code to read and write layouts for some experimental lfs marshalling, but it turned out to be pretty bad because you would need to reload the layout once the marshall moved

Well that was the result: http://youtu.be/9SNZe6_RjHw?t=10s

Now, as Scawen is going to bring the layout-manipulation-packets to insim I thought it would be a good idea to port this to a prism plugin, so I ported the basic java classes to php and I thought I share them with you so they can potentially be reused in prism. (Assuming that the packets use the same 8 byte structure.)

Sources:
https://github.com/GeForz/PRIS ... plugins/layout/Layout.php
https://github.com/GeForz/PRIS ... s/layout/LayoutObject.php


Usage:

<?php 
// init
$layout = new Layout("S:/Live for Speed/data/layout");
// parse a layout
$layout->parseLayout("AU1""XXXX");
// manipulation... 
// NYI ;)
// write the layout
$layout->writeLayout("AU1""YYYY");
?>

I've updated the layout object to include the "unified" indexes for z35.
Quote from GeForz :I've updated the layout object to include the "unified" indexes for z35.

Yeah, I really can't wait for Z35. It should make an interesting release, for LFS, for PRISM, for the world.

Parsing and writing layouts in php
(3 posts, started )
FGED GREDG RDFGDR GSFDG