Live for Speed - LFS Main Site
- LFS World
- LFS News
- LFS Manual
- LFS Merchandise
  http://www.worldcrashleague.com/

Go Back   Live for Speed > Main > LFS Programmer Forum > PHPInSimMod - PRISM > Snippets & Tutorials

Reply
 
Thread Tools Search this Thread Display Modes
Old 4th June 2011, 17:46   #1  -   
GeForz
S2 licensed
 
GeForz's Avatar
 
Join Date: Feb 2003
Posts: 688
GeForz's online stats
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/PRISM/blob...out/Layout.php
https://github.com/GeForz/PRISM/blob...youtObject.php


Usage:
PHP Code:
// 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"); 

Last edited by GeForz; 8th June 2011 at 12:23.
Reply With Quote
Old 8th June 2011, 12:23   #2  -   
GeForz
S2 licensed
 
GeForz's Avatar
 
Join Date: Feb 2003
Posts: 688
GeForz's online stats
I've updated the layout object to include the "unified" indexes for z35.
Reply With Quote
Old 8th June 2011, 13:34   #3  -   
Dygear
S2 licensed
 
Dygear's Avatar
 
Racername: (EAGLE)Dygear
Join Date: Feb 2005
Location: Levittown, NY.
Posts: 3,583
Dygear's online stats
Quote:
Originally Posted by GeForz View Post
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.
__________________
Paramedic & Programmer
LFSWorldSDK & PHPInSimMod
No help via MSN or PM
Reply With Quote
Reply

  Live for Speed > Main > LFS Programmer Forum > PHPInSimMod - PRISM > Snippets & Tutorials

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:21.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Live for Speed © 2002-2014 - Scawen Roberts, Eric Bailey, Victor van Vlaardingen