The online racing simulator
Searching in All forums
(981 results)
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.
Dygear
S3 licensed
Windows come with a GUI front end, but I never use it. I did not even install the GUI for git on my linux box. I'm pretty sure the MAC as a GUI as well, as the official build now has a GUI.
Dygear
S3 licensed
Quote from PoVo :Hmm... I'll check it out later. I've always used SVN for private code projects.

Good on ya mate. It will change your world on how easy it is compared to SVN. Once you remember over the command line that is.
Dygear
S3 licensed
I merged vic's pth branch. I think I did it in a dirty way so it might not look like that in the tree. But that's besides the point. Cargame, if you can try that out, let me know what's working and what's not on a populated server.
Dygear
S3 licensed
Quote from thisnameistaken :Yeah I don't like the way SVN does handles merges, I've noticed that a lot of the clients I work for try to avoid them ever happening.

Yeah, no kidding.

Quote from Linus :How many of you have really done a branch and ever merged it in CVS.

Good Job.

I mean, it wasn't everybody, but it was actually more than I expected.

How many of you enjoyed the experience?

Ooh, ok. So there were a couple.

But, but it is considered hard.

In CVS, when you merge a branch, I've done it as little as possible, but I've had to do it.

What you do is, plan ahead for a week, and then you basiclly set aside one day for doing it.

Am I wrong?

I don't see a lot of people saying "No it was easy, I liked it."

Dygear
S3 licensed
Quote from MadCatX :Git is actually pretty awesome, it makes branching, patching and submitting patches extremely easy. A well set up git environment can create, format and email a patch to developers in one command.

Yep, we love it here! I tried using SVN back in 2004, but like Linus said, it did things to my source code, and I found that unacceptable.
Last edited by Dygear, .
PHP migrates to Git
Dygear
S3 licensed
Quote from PHP Website :PHP migrates to Git

The migration of the PHP source code from Subversion to Git is complete. You can clone or fork the source from our GitHub mirror, and we also now support pull requests made via GitHub. The source is also available via git.php.net, and full instructions on cloning the php-src tree can be found at php.net/git.

One immediate benefit is that future PHP release tags will be signed by the PHP development team. We will be releasing GPG keys for verification purposes in the next few days.

More information on the migration and the new workflow can be found at the Moving to Git FAQ on the PHP Wiki.

Please note that the PHP manual, including translations, continues to be hosted in Subversion for the time being and will be migrated to Git at a later date.

Many thanks to David Soria Parra for his hard work on making the conversion to Git a reality, and to Alexander Moskaliov, Florian Anderiasch and Johannes Schlüter for their work on the scripts required to support the conversion. Let the forking begin!

I'd like to welcome PHP to the party! PRISM was using git before it was cool tho .
Dygear
S3 licensed
Using the Button class should be a better option. By the way, I'm at work, so I've not tested this code, and from my understanding that Button class is not working in the current version of PRISM, so it would be better to test with version 0.4.2.


<?php 
class flame_test extends Plugins
{
    const 
URL 'http://www.lfsforum.net/showthread.php?t=78721';
    const 
NAME 'Flame Test';
    const 
AUTHOR 'Martin Kapal';
    const 
VERSION '0.0.1';
    const 
DESCRIPTION 'Button Test Phase';

    public function 
__construct()
    {
        
$this->registerPacket('onState'ISP_STA);
    }

    public function 
onState(IS_STA $STA)
    {
        
$BTN = new Button(0'Test''Flame');
        
$BTN->T(50)->L(50)->W(30)->H(10)->BStyle(ISB_DARK ISB_LEFT 1);
        
$BTN->Text('Test button')->registerOnClick($this'onBtnClick')->Send();
    }
    
    public function 
onBtnClick(IS_BTC $BTC)
    {
        
IS_MSX()->Msg('Clicked a button!')->Send();
    }
}
?>

Dygear
S3 licensed
Quote from cargame.nl :Hahaha.. Some recognition here.

It's OK. Looking at the layout filename when an AXI packet is there should be fine.

After this pth loading and spamming is working 100% it's possible to store timings and do some stuff with safety which really would be great (can do that on my own I think, but I'm slow).

No hurry though, relax.

Yeah, I'm gonna make an API so that programmers can do that, using this plugin as a template.
Dygear
S3 licensed
Quote from cargame.nl :Complicated with the fact that a layout change also implies a track change nowadays.

Had not really considered that.

(BTW, my girlfriend is here, so I can't even program because she wakes up when ever I type.) <- Slowest typed sentence of my life.
Last edited by Dygear, .
Dygear
S3 licensed
Quote from cargame.nl :I merged Victors changes and Dygears changes together but still... If I adjust LVS.php, LVS is only working for one racer.

Problem must be inside function onCarInfo(IS_MCI $MCI) because thats the only difference.

Yeah, I'll fix that.

Quote from cargame.nl :I want to get rid of that message spamming all the time. On/off track should only be reported when the change happens.

Yeah, that was my intention.

Quote from cargame.nl :And another thing. I noticed that every time someone joins the track or spectates (STA)... The pth file gets reloaded again. This is not very good for performance.

It should happen on race restart (RST) and on first prism init (only moment to trigger on STA).

I was under the impression that STA packets are only sent when the track is loaded, I did not know it happens when some one leaves and joins too ... So I'll have to change that to something else. Actually, it should not reparse the file if the track is the same.

Quote from cargame.nl :But I'm quite happy with the progress. It's a big step forward for racing servers

Glad to hear that! I feel the same way.
Dygear
S3 licensed
From my understanding he has been MIA for about 2 months now, but it's not every day that you get a message from a dev so ... who knows!
Dygear
S3 licensed
He 'licensed' it to Victor, I don't want to take someone else's work without permission.
Dygear
S3 licensed
Quote from Victor :So this should be fine for now as far as I'm concerned.

edit - ok pushed two more fixes and cleanups

That edit made me giggle.

Quote from Victor :[T]here is an [flaw] in KY2.pth.

So I guess we could fix that ... The SMX file should have the correct track markings, we could use that and convert it over to the PTH.
Dygear
S3 licensed
As long as you caused no damage, as long as you did not go outside of the permission level for your account, then you should be fine. Email him, let him know there is a problem. Some thing along the lines of "Hey, I noticed there was a problem with your site, it let me do this, and I don't think that's what you intended."
Dygear
S3 licensed
Quote from Victor :As for the coordinates in insim packets, they should be signed (jebus, i wrote unsigned first). So that 0,0,0 lies at the center of the world and coordinateds go smoothly from positive to negative.

I'll finger the commit in my branch and revert the changes.

Quote from Victor :You can skip the top and bottom sides because we already know the point is in between them; we already have the node ID.

That's awesome, never really thought about that.

Quote from Victor :One other thing, about prism in general. When I tested this path stuff on a local, single player instance, I noticed the MTC packets telling me I'm on or off the road do not work (of course).

Do you take this into account in other places where info is sent to the racer directly through MTC packets? Because they won't work when prism is connected to a offline, single player LFS client.

Or should prism not be used in single player mode?

No, that's just because I tested in a local server on my client, I do not normally test for single player type accounts. But yes, PRISM should support all modes that LFS supports. It was just me in the programming of that LVS plugin using the MTC packets that made it not work as well as it should off.

Quote from Victor :I guess dygear put that in for testing purposes, which i found handy as well. But it's no good for production use.

Yeah, that's why I did it. I also don't have the chance to test PRISM on an active host because I don't have a server to test on. Just the servers that I make for myself with my LFS client. The only clients I have on besides my self is the AI that I put on the track.
Dygear
S3 licensed
Quote from Victor :I took the liberty to write another path detection interpretation. It's on github in the vic_pth branch. Feel free to use it or not.
Main difference I guess is the addition of prism_geometry.php where point and polygon classes and the poly->contains(point) detection happens, instead of in prism_pth.php. Also the detection algorythm is a lot shorter. It's using solution 3 from http://paulbourke.net/geometry/insidepoly/ which is really simple and totally reliable for our purpose.

Thank you, I'll look into this!

Quote from Victor :OH almost forgot one major point : Why did you say you had to use V instead of l? (small L) They are both 32 bit and l is signed which is what you need; V is unsigned.

I'm pretty sure I read that these should be unsigned, not signed.
FGED GREDG RDFGDR GSFDG