The online racing simulator
Searching in All forums
(982 results)
Dygear
S3 licensed
Quote from PoVo :I've recreated one of my issue posts:
https://github.com/Dygear/PRISM/issues/32

Seems like this is still happening

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

Last edited by Dygear, .
Dygear
S3 licensed
Quote from Victor :As such, $NodeID is not used (of course, it's always 0), however it is returned.

Quote from Victor :Might be handy if you'd need the nodeID for something else. You can simply look it up this way. When using a custom PTH of course.

That's awesome, I'm sure that information will be useful.

Quote from Victor :Have you a mechanism for allowing prism users to add the names of the custom paths they're using? Will that be / is that tied to an autox layout's name so the custom path loading happens automatically, as long as the PTH file is provided in prism/data?

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.

Quote from Victor :EQW replied that it's ok for prism to use the updated KY2.pth file.
So dygear, feel free to include it in the next release.

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.
Last edited by Dygear, .
Dygear
S3 licensed
Quote from PoVo :EDIT2: *facepalm*. For some reason I had the prism_timers.php file from 0.4.2. LOL.

Haha, OK. Now it is working without a problem?
Dygear
S3 licensed
Quote from nl2dav :[J]ust some rest and a short break to regain energy

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.

Quote from Victor :Don't have a lot of time today.

That's fine, thank you for all your help.
Last edited by Dygear, .
Dygear
S3 licensed
Quote from nl2dav :Yes but but...

The return... Means... It's aborting the whole check procedure.

So it does not do any further custom pth processing in the end right now

Yeah, I'm just going to take a look at the whole block again. I've not slept, and it's reflecting in my programming.
Dygear
S3 licensed
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.


Quote from nl2dav :In my head this doesn't add up though...;


<?php 
        
if ($trackType == 'X' OR $trackType == 'Y')
            return; 
# Not a open layout where we need to check for custom pth files.
?>

Because trackType X or Y actually ís open layout so it needs to process it when X/Y trackType is true.. But.. Hmm small problem anyway

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!
Last edited by Dygear, .
Dygear
S3 licensed
Quote from Victor :lfs doesn't actually send node information on open configs. The node id will always be 0.

Well, then that explains it!

Quote from Victor :(btw want me to rewrite that method so it uses the quicker code?)

Lol, yeah! I'm all for quicker code!
Dygear
S3 licensed
Quote from cargame.nl :You are not... $trackType also contains Y when I echo it to the console. Can't explain it either. I commented those two lines out and B11.pth got loaded.

As a matter of fact I had this problem before... I used strpos as solution to check if there was a particular character in a string.

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.

Quote from cargame.nl :Yeah.. Echoed $path which is correct and console also mentioned it loaded that pth file. The pth file works also for the most part of the track. I think it has something to do with internal structure of that pth. That its different in node counting.

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.)
Last edited by Dygear, .
Dygear
S3 licensed
Quote from cargame.nl :

<?php 
        
if ($trackType != 'X' OR $trackType != 'Y')
?>

It somehow produces an always false.. Even if trackType is set to X or Y.

I don't have an explanation for that right now. The string would be BL1X or BL1Y right, I'm not crazy?

Quote from cargame.nl :But even if I comment this out and B11.pth is running... Cars are repeatedly reported off track on some sections of the track while they are not.

First, the layout file that is loaded, is called B11.lyt, and the B11.pth is in the $PRISM/data/pth/ directory right?
Dygear
S3 licensed
This thread is pending an update, I do have a newer version that vic made. I also have a pth to png converter that I'll also include in this version.
Dygear
S3 licensed
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.
Dygear
S3 licensed
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.
Last edited by Dygear, .
Dygear
S3 licensed
Quote from Flame CZE :the only concern I have now that it is actually impossible to create an insim app for local usage and publish it as an EXE file

That's by design. I want people sharing their code. It benefits the whole community.
Dygear
S3 licensed
Last edited by Dygear, .
Dygear
S3 licensed
Quote from Danas :WE are the people who pay for playing

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!
Dygear
S3 licensed
TG1X, Top Gear Test Track 1 Free Roam Layout. Just an idea ...
Dygear
S3 licensed
Quote from Krammeh :ha, I thought it was an error in my coding causing the timers to do that.

I wrote something into my plugin to check last time each timer ran, and reinit any that have not run recent enough, ha!

Nah, it was my mistake . Some times it really is the fault of the upstream library.
Dygear
S3 licensed
I'll merge that when I get home, thank you.

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.
Dygear
S3 licensed
Quote from cargame.nl :It looks like it is only working for the first player inside a MCI package because when somebody leaves it switches to another player.

Oh, yeah. That's because I'm using return and not continue.

Quote from cargame.nl :This shouldn't crash PRISM, only the LVS system should not work in these cases;

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.
Dygear
S3 licensed
Quote from Victor :Thanks everyone! Much appreciated

What are you like 90 now? I kid, I kid. Happy birthday mate.
Dygear
S3 licensed
Visualize git commands, in real time.. Something cool that I just found while perusing the internet.
Dygear
S3 licensed
Quote from Victor :Actually it's $PRISM->hosts->getStateById($HostID)->State , but you got me looking in the right direction.

Oh, sorry! Should really fact check myself before I hit submit. :P
Dygear
S3 licensed
Quote from Victor :Is that the StateHandler? Does every host have a StateHandler?

For example, I wanted to look into making a generic msgToLfs class that would figure out whether to use MTC or MSL depending on an LFS host being a real multiplayer host or a single player instance. But for that the class will have to check at least to see what type of LFS instance we're talking to.

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.

Quote from Victor :To figure that out we'd need information from IS_STA's ISS state flags for example. Is that IS_STA information stored somewhere and made available to any function that needs to instantly check that value?

Using $PRISM->hosts->getHostById($HostID)->State, will get you the ISS state flags for that host.
Last edited by Dygear, .
Dygear
S3 licensed
I pulled your change, and merged it on github. Congrats, on your first bug fix, I hope to see many more .
Dygear
S3 licensed
Quote from Victor :Are these lines to stay in LVS.php?


<?php 
if ($this->pth->isOnRoad($CompCar->X$CompCar->Y$CompCar->Node) === FALSE)
    
IS_MTC()->PLID($CompCar->PLID)->Text('You are ^1off^9 the track!')->Send();
else
    
IS_MTC()->PLID($CompCar->PLID)->Text('You are ^2on^9 the track!')->Send();
?>

It's just that you already have found the result of isOnRoad() a couple lines earlier, and stored it in $isRoad. So you wouldn't have to do the detection again.

No, it's just for debugging, I'll remove them on release.
FGED GREDG RDFGDR GSFDG