Ok. I'll have to call trim on the data within the unpack function for that packet. I'll get around to it.
[EDIT] Fixed in my version.
I fixed the buttons on dedicated hosts, the only thing stoping a release is the LVS plugin and PTH parser. Seems there is an issue.
PHP NOTICE: Uninitialized string offset: 92 in C:\Users\Dygear\PRISM\modules\prism_pth.php on line 137 1 :: isOnPath in C:\Users\Dygear\PRISM\modules\prism_pth.php:103 2 :: isOnRoad in C:\Users\Dygear\PRISM\plugins\LVS.php:119 3 :: onCarInfo in C:\Users\Dygear\PRISM\modules\prism_plugins.php:156 4 :: dispatchPacket in C:\Users\Dygear\PRISM\modules\prism_hosts.php:577 5 :: inspectPacket in C:\Users\Dygear\PRISM\modules\prism_hosts.php:487 6 :: handlePacket in C:\Users\Dygear\PRISM\modules\prism_hosts.php:353 7 :: checkTraffic in C:\Users\Dygear\PRISM\PHPInSimMod.php:228
Fatal error: Cannot access empty property in C:\Users\Dygear\PRISM\modules\prism_pth.php on line 137
That's awesome, I'm sure that information will be useful.
It is tied to the autox layout name right now. For example, is the track BL1X or BL1Y is loaded, and the B11.lyt file is loaded, then PRISM will look in the $PRISM/data/pth/ directory for a file called B11.pth. That mechanism is already in place, I'll just have to add the Bool TRUE when calling the PTH constructor.
Excellent, you might also want to notify Scawen to include this file in the next patch for LFS.
After merging the branches, PRISM is crashing PHP (5.4.0). I'm going to have to pin point the problem, as this might be a bug in PHP itself. (Only of the perks / drawbacks of being on the edge of with PHP is capable of, some times you go past it's limit and don't even know it.)
Yep! Seems we've found a bug in PHP. Sending my results to Vic to confirm, to see if he can reproduce on his system.
Vic, I forgot the mention in the PM that you should also remove the LVS plugin from the plugins.ini, and just leave TimingAndScoring in there. When you do that, you'll see PHP crash HARD when you get to a split time.
I did sleep last night for 6 glorious hours, but now I'm at work so I'll go over the code change I made with a fine tooth comb later on. When adding back the Node, Direction, Limit and Road classes, I might of missed a divide sign, or minus sign some where.
I can just make it a string 'delta'. I just thought that was intresting from a programming standpoint that the PHP engine supports that. I always program in UTF-8 encoded format for all of my PHP files due to the web design work that I used to do, it carried over to PRISM and indeed some of the variables and functions that I named using UTF-8 strings. It's odd that NetBeans does not support it, Notepad2 does and that's what I'm using for a basic text editor.
My comment is backwards. Should read
<?php # Is a open layout where we need to check for custom pth files. ?>
That did make sense when it was !=, but now that it's == that's the correct comment. Silly mistakes!
Well that's good to know. What with it being 7:11 am and I've been up all night, I tend to lose my marbles a little bit.
Well, that really depends on how the pth is structured. ARIO might take the whole path into consideration (that is significantly slower computationally), but for us the Node that's reported in the CompCar packet MUST match that of the PTH file, or we'll report that they are not in THAT node, because they are not.
Doing logic at 4am, never a good idea. Doing logic at 10:44am, a better idea.
<?php if ($trackType == 'X' OR $trackType == 'Y') ?>
That's what I wanted.
Checkout the github repo for some goodies.
<?php php
define('ROOTPATH', dirname(realpath(__FILE__)));
require('./modules/prism_pth.php');
$pth = new PTH('./data/pth/BL1.pth'); $pth->drawPath('./BL1.png');
?>
Yep, this is now totally possible, you can now SEE the path that the PTH parser has. All you have to do is call the drawPath method, and tell it where to save the image file. (It's ALWAYS going to be an PNG.)
Pushed another update, that includes support for custom pth files on the open configs. You have to have the custom pth files in $PRISM/data/pth/ AND the layout name must match that of the PTH file. Tested on Cargames server again, it loads the normal tracks as you where running SO5R, but I've yet to be able to test it with a custom layout ... I've also added protected to the plugin should it try to load a pth file that is not there, it will not crash, but use the HLV packets to keep track of the lap validity.
Now I just have to fix the buttons that I broke in the last version and we are ready for version 0.4.4.
So I merged Vic's changes, and I fixed the bug in LVS where it only reports too the first player. These have changes have been committed and uploaded to github. I checked these changes on cargames server, and they worked without incident, but that was only on WE1R. The only thing I have to add now is a support for pth files based on layouts. So I'll do a check in the program to see if the track is an X or Y track, and then I'll check to see if their is a pth file that corresponds to the layout. I will require that all server hosts to keep their pth files in a single directory within prism to standardize it for all server hosts and promote compatibility for all.
Vic and I also discussed a class for LFS strings, that should help everyone out, but it might be a while until we see it. I'd like to have it for version 0.5.0, so we all have some time to ponder how we want this to look.
I would think that Rockingham is licensed, commercially to use LFS. And if they are not, I would think it's because we get their track, and we don't have to pay an extra license for it. Also, none of us where meant to know about Rockingham's involvement with LFS until S3 dropped, one of the private testers let a screen shot slip, and all hell broke lose on the forums so they had to divulge it's existence.
Although, I would gladly pay 12 GBP right now to be able to use VWS and Rockingham right now with the current Tyre physics. Because it's still a damn sight better then anything else I've seen, and I can race with a MOUSE!
Vic, do you have any interest in doing a LFSString class? I'm looking for a class that I can bolt onto the message packets, and have it take over to the Text and Msg propertys. I want something that will allow me to do something like this...
<?php public function onMsgOut(IS_MSO $MSO) { $MSO->Msg->toUTF8(); // Converts to UTF-8 $MSO->Msg->toUTF8(); // Converts to UTF-16 $MSO->Msg->toHTML(); // To HTML string. $MSO->Msg->toLFS(); // To LFS String $MSO->Msg->Strip(); // Remove all colors. $MSO->Msg->Wrap(80); // Word Wrap at the 80th Char. } ?>
Pretty sure we can come up with better method names then that, but that's pretty much what I'm looking for. I've seen some pretty funky things happen with code pages so I'm sure that you would do a better job that I could on the subject.
Oh, yeah. That's because I'm using return and not continue.
Yeah, that's because, I don't have the X/Y pth files, and I don't have a mechanism yet to load a pth file based off the current layout. It's something that I've never had, and I would need the pth files, and the layout files that your using. These would have to be standardized for use on other servers, or the LVS plugin will only really work on Cargame servers, while that might be good for you, it does not help anyone else.
Yes, everyone has access to that, it's exposed by the command get(Client/Player)By(UCID/PLID/UName/PName), and it returns a reference to that class. Every host has it's own instance of statehandler, and every packet that updates information by the State Handler is handled and recorded by this class. It allows for information to always be available for the plugin classes, but it can be used by other modules as well.
Using $PRISM->hosts->getHostById($HostID)->State, will get you the ISS state flags for that host.