The online racing simulator
Searching in All forums
(981 results)
Dygear
S3 licensed
It seems to happen when you get to the end of the pth array, something that I thought I had fixed in this version. I'll take a look at it. Thanks for the report.
Dygear
S3 licensed
LVS and PTH parser now works on the repo. Please do take a look at it, and report back.
Dygear
S3 licensed
Quote from T3charmy :I was just suggesting that it be added with 5.0 since If I remember correctly you said that it would most likely break the compatibility with existing plugins anyways

Then we are on the same page. I'll do this if I don't come up with something that I think it better. But if I did, I'll ask the community first if they think it's better.
Dygear
S3 licensed
Yeah, I saw it. I just don't know if I want to break that compatibly in this branch.
Dygear
S3 licensed
I'll look into fixing both the timers and the buttons in the next release, as that's a pretty huge over sight on my part. :sorry:

I'll also ask around for how to do the pth parsing correctly on getting the size of the node, because, I'm really getting something wrong for sure on the size of the nodes. I hope I can get in contact with scawen, and maybe he could explain how he does the calculations.
Dygear
S3 licensed
Quote from T3charmy :Nice update, Also something came to mind, Would it be possible to give Timers Names... This way we can unset timers?

Show me how you want it to work.

Quote from T3charmy :Edit: Either I'm doing something wrong, or buttons(using new Button) don't seem to work in this release

Ya know, I don't know. I don't think I did any testing with buttons, I really did not expect them to stop working. I'd be pissed if I did something silly and it caused a huge bug like that. Can you post some example code that was working in 0.4.2, but is not working in 0.4.3?
Dygear
S3 licensed
Quote from DarkTimes :I used Dive Into Python to learn Python.

But you have no formal education on the subject?
Dygear
S3 licensed
Just by playing with it. For me it was, AMX Mod, and SmallC, they have a bunch of plugins that you could compile with the tools they gave you, and they also had a bunch of people making plugins for these Counter - Strike servers that would add things like jetpacks and crap like that. I was like, that's awesome, I want to be able to do that! So I found the source code of the plugins, as AMX Mod was under the GPL everyone had to give out their source code for their plugins if they gave out the binary on the forums. From there, I started playing on the servers with the plugin devs, helping them test their plugins, they would give me the code, and say, I'm having a problem in this area of the plugin, from Line X to Line Y, and that's what I need you to test. Just by doing things like that you learn alot about how to program because you see how the engine and how your actions with the engine and there by your actions effect the plugin. It was a pretty easy way of learning for me. This is what I'm trying to get at with PRISM, people that don't know how to program, learning PHP from the fun side, games! Learning about event based programming with it.
Dygear
S3 licensed
Right now, PRISM 0.4.3 it compatible with both PHP 5.3.x and 5.4.x, simultaneously. The next update to PRISM, 0.5.0 will require everyone to PHP 5.4.x. There is a pretty substantial advantages to running even 0.4.3 with PHP 5.4.x over PHP 5.3.x right now as it offers a 20% memory reduction, and speed increase. I will continue to support PRISM 0.4.x and release a couple of releases to ensure that they are no major bugs in it, but you can consider it to be deprecated around the time 0.5.0 is released.
Dygear
S3 licensed
I strongly recommend that you backup your current version of prism, before upgrading to this version!

Please let me know of any bugs you should find, as I'm sure that they are going to be a few with the statehandler, and I know of one already with the LVS plugin, but it's more to do with the pth parser. Anyway, thank you for your continued support!
PHPInSimMod - PRISM 0.4.3 Discussion
Dygear
S3 licensed
You can download PHPInSimMod - PRISM 0.4.3 from that link. Please use this thread to talk about this release.

Thank you.

PHPInSimMod (PRISM) 0.4.3
  • Updated to Version 0.4.3.
    Updates to support PHP 5.4.0.
    • Fixed parse error when used with PHP 5.4 RC1.
    • Fixed fatal error when used with PHP 5.4 RC1.
    • Fixed STRICT warning when calling the interactive query method in a static context on PHP 5.4.0.
    State Handler Fixes and Improvements
    • Massive update to state handler, the classes are now much better devided into their roles, lots of redundant code removed, still need to check TOC packet, and for 5.3.x compatability.
    • Added some functions to the Client & Player Hanlder.
    • ISP_TOC handling done.
    PTH & SMX module fixes and improvements
    • Added the Data Directory, that includes the PTH files used for the LVS plugin, and by the PTH module.
    • Moved the inPoly method into the pth parser, and added some new methods to use that can be found in the LVS example plugin.
    • Completly rewrote the PTH parer (twice).
    • Fixed PTH parser, was using l, but needed V because some numbers where too large.
    • Fixed small errors in the pth parser.
    • Completly rewrote the SMX parer.
    • Fixed SMX parser, was using l, but needed V because some numbers where too large.
    OutGuage Support
    • First draft of OutGauge support. Has config and network facilities and parses packet. Needs a method to actually do something with it.
    • Added OSP & OGP consts, and added their ID's to the TYPEs array.
    • Updates the OutSimPack's & OutGuagePack's PACK, UNPACK and added LENGTH and added a special unpack method to both.
    • Made OutGuage code cross refrence the information from the OutGuagePack class. That also made the code much more concise.
    General Fixes and Corrections
    • Fixed crash on player pitting.
    • Made the dedicated or listen server, answer choices make sense.
    • Slight Change for T3, to allow for plugin defined parameters to be received by the onClick handler.
    • Changed the string type for the Plate's from a NULL Padded (a) string to a SPACE Padded string (A), in response to a bug report 29 by PoVo. This effects, CPR, NPL and RES packets.
    • Fixes issue 26, reported by PoVo, where a client presses Shift + I PRISM would crash.
    • PoVo confirmed fix for the button interface, un-commented ButtonManager::buttonsForHost();
    • Fixed bug when pitting due to the handling of the Tyres.
    • Added some questions to the interactive start for the hosts, so we can find out what flags to set. I've also added default ports to both HTTP and Telnet.
    • Fixed bug where no plugins are loaded when PRISM_DEBUG_CORE is not set.
    • Fixed duplicate port-check.
    • Fixed data types for ints in the packests, where their signed long machine byte order variant, now they all are unsigned long little endian byte order as they should be.
    • Fixed PACK/UNPACK in IS_RST
    • Fixed PACK string of IS_MTC, so that sound does work.
    • Fixed a capital K in parent::unpack in the IS_HLV class.
    • Fixed missing semi-colon after class for IS_TINY.
    Plugin Update, Changes and Improvements
    • Added iTunes control plugin (Works only on Windows)
    • Added Timing & Scoring plugin.
    • Removed some testing plugins that are no longer needed. (AutoX, Button Test, Color Buttons, Contact, Distance, Gap Monitor & GapMon, and Pylons.
    • Fixed a bug with the PLL, CNL & CPR packets going to the state handler first, removing inforemoving information from the plugin's scope before they have had a chance to use it.
    • Added IS_CPR (Client Player Rename) to list of packets that are sent to the plugin before they are handled by the State Handler.
Last edited by Dygear, .
PHPInSimMod (PRISM) 0.4.3
Dygear
S3 licensed
PHPInSimMod (PRISM) 0.4.3
  • Updated to Version 0.4.3.
    Updates to support PHP 5.4.0.
    • Fixed parse error when used with PHP 5.4 RC1.
    • Fixed fatal error when used with PHP 5.4 RC1.
    • Fixed STRICT warning when calling the interactive query method in a static context on PHP 5.4.0.
    State Handler Fixes and Improvements
    • Massive update to state handler, the classes are now much better devided into their roles, lots of redundant code removed, still need to check TOC packet, and for 5.3.x compatability.
    • Added some functions to the Client & Player Hanlder.
    • ISP_TOC handling done.
    PTH & SMX module fixes and improvements
    • Added the Data Directory, that includes the PTH files used for the LVS plugin, and by the PTH module.
    • Moved the inPoly method into the pth parser, and added some new methods to use that can be found in the LVS example plugin.
    • Completly rewrote the PTH parer (twice).
    • Fixed PTH parser, was using l, but needed V because some numbers where too large.
    • Fixed small errors in the pth parser.
    • Completly rewrote the SMX parer.
    • Fixed SMX parser, was using l, but needed V because some numbers where too large.
    OutGuage Support
    • First draft of OutGauge support. Has config and network facilities and parses packet. Needs a method to actually do something with it.
    • Added OSP & OGP consts, and added their ID's to the TYPEs array.
    • Updates the OutSimPack's & OutGuagePack's PACK, UNPACK and added LENGTH and added a special unpack method to both.
    • Made OutGuage code cross refrence the information from the OutGuagePack class. That also made the code much more concise.
    General Fixes and Corrections
    • Fixed crash on player pitting.
    • Made the dedicated or listen server, answer choices make sense.
    • Slight Change for T3, to allow for plugin defined parameters to be received by the onClick handler.
    • Changed the string type for the Plate's from a NULL Padded (a) string to a SPACE Padded string (A), in response to a bug report 29 by PoVo. This effects, CPR, NPL and RES packets.
    • Fixes issue 26, reported by PoVo, where a client presses Shift + I PRISM would crash.
    • PoVo confirmed fix for the button interface, un-commented ButtonManager::buttonsForHost();
    • Fixed bug when pitting due to the handling of the Tyres.
    • Added some questions to the interactive start for the hosts, so we can find out what flags to set. I've also added default ports to both HTTP and Telnet.
    • Fixed bug where no plugins are loaded when PRISM_DEBUG_CORE is not set.
    • Fixed duplicate port-check.
    • Fixed data types for ints in the packests, where their signed long machine byte order variant, now they all are unsigned long little endian byte order as they should be.
    • Fixed PACK/UNPACK in IS_RST
    • Fixed PACK string of IS_MTC, so that sound does work.
    • Fixed a capital K in parent::unpack in the IS_HLV class.
    • Fixed missing semi-colon after class for IS_TINY.
    Plugin Update, Changes and Improvements
    • Added iTunes control plugin (Works only on Windows)
    • Added Timing & Scoring plugin.
    • Removed some testing plugins that are no longer needed. (AutoX, Button Test, Color Buttons, Contact, Distance, Gap Monitor & GapMon, and Pylons.
    • Fixed a bug with the PLL, CNL & CPR packets going to the state handler first, removing inforemoving information from the plugin's scope before they have had a chance to use it.
    • Added IS_CPR (Client Player Rename) to list of packets that are sent to the plugin before they are handled by the State Handler.
Last edited by Dygear, .
Dygear
S3 licensed
From pth.txt found on the lfs website.
1) X,Y,Z int : 32-bit fixed point world coordinates (1 metre = 65536)

X and Y are ground coordinates, Z is up.

From the CompCar struct found in the InSim.txt, found in LFS 0.6B.

int X; // X map (65536 = 1 metre)
int Y; // Y map (65536 = 1 metre)
int Z; // Z alt (65536 = 1 metre)

So they are directly compatible from a datatype stand point. No conversion needed on our end. What you get from the packet should be, there for directly compatible with what you get from the pth file.

Don't worry, I'm working on the LVS plugin right now.
Dygear
S3 licensed
That's what I'm thinking. PHP 6 pretty much became PHP 5.4, as PHP 6 was all but abandoned in name, mainly due to it's requirement of UTF-16 being used everywhere. So short term we do get some of the cool things that where meant to be in PHP 6, but we just get them in PHP 5.4 instead. This works out quite well for us I think!

Did I mention that the <?= syntax is always available? Regardless of the short tag setting? I like that!
Last edited by Dygear, .
Dygear
S3 licensed
Quote from cargame.nl :No.. Just continue... If you want to move on with PHP6 its fine by me too.. I just compile a separate package if needed. No problem.

PHP 5.4.0 is a pretty massive upgrade that will make some thing in PRISM much easier, such as the use of the web interface, that can be pretty much completely taken out and replaced with a native alternative that is much more in line with what other PHP programmers handle on the front end of the web sites every day. Vic did a great job, but it's very confusing to people who are no as adept to PHP as some of the devs are.

Quote from T3charmy :I say just go ahead and go on with PHP 5.4

That would result in some huge changes to the code base, and the interfaces that you're all given. The trait support would be front and center in the modules, and you'll fell that right away with the plugin class, should use decide to use it. But it also allows for the different paradigms to work as one with the plugins, even all in one if someone so desired. Would you still want to do it, knowing that it would be incompatible with anything you might of already programmed?
Dygear
S3 licensed
It's on the repo, I forgot that you stick to official updates. As far as multiplying by a the size of a small int, I'll get into it.
Dygear
S3 licensed
I've wanted to do a rewrite of PRISMs core for a while now, and this have given me a pretty good reason to do that. The 0.4.3 release will fix some bugs that happen with PHP 5.4.0 that don't happen otherwise, but will works with PHP 5.3.x. This may end up being the last release the supports PHP 5.3.x before we move on to PRISM 0.5.x that will only support PHP 5.4.0 and greater. If you have any questions, comments or concerns, please do voice them now. I would love to hear what the community thinks.
Dygear
S3 licensed
Copy the PTH files from your LFS directory into the pth files that PRISM has. If they are not the same file you're going to have this problem.
vB Setting 'Prevent Shouting'
Dygear
S3 licensed
Admincp > vBulletin Options > Message Posting and Editing Options > Prevent 'SHOUTING'

I'm guessing this was just enabled, because, when I try to type like PHP in a title, it turns int Php. When I write PRISM it turns into Prism.

Kind of annoying, can we turn it back to 0 please?
Prism & php 5.4.0
Dygear
S3 licensed
There are a few things to keep in mind if your planning on running PRISM with PHP 5.4.0, you can find where the list of incompatible changes they have made from 5.3.x to 5.4.x. But there are also some new features that should be keep in mind as things that might not be supported by all platforms as right now PRISM only requires 5.3.0 and above. There are currently no plans to require a change to 5.4.0, however should you have custom plugins that you alone are going to use, it is safe to use these new features. I also have not tired to run PRISM with 5.4.0 yet, but I don't see anything that would be a show stopper.

I do think that the web server built into 5.4.0 is pretty cool, so I'll for sure take a look at that.

[EDIT1]
PHP 5.4.0 Traits

This is why I would LOVE to make PHP 5.4.0 a requirement for the next versions of PRISM. This would make my modules work together so much better. Currently, the Plugins module is a bastard child of many different classes that it extends from. With this, we can just have a clean defined class, and it can use the traits of the timer and button traits without having to worry about having to extend those classes into it.

[EDIT2]
Ok, after just trying PRISM with 5.4.0, we do have some issues, but they are pretty small. We get an E_STRICT warning with trying to call a Interactive::Query method in a static context, as of 5.4.0 that's a no no, we'll have to fix that. That's the only thing I've seen so far, but I'm still going through the setup from scratch, so we'll see.
Last edited by Dygear, .
Dygear
S3 licensed
Quote from T3charmy :

Warning: call_user_func_array() expects parameter 2 to be array, null given in \PRISM\modules\prism_button.php on line 52


Sorry, I'll fix that when I get home.


Quote from T3charmy :Only the first car in MCI Info gets called?

What do you mean by that? Do you mean only the first MCI packets information is given, or do you mean that the packet's Info only has one member, and that's the only thing that your getting?

First off, you might only get one Info item in that array because that is the last packet of the set to be sent, or there is only one client on the server. Secondly, the MCI function you defined will be fired one time for each packet in an MCI set, some times there is only 1 packet if there is less then 1 client.
Dygear
S3 licensed
As a US Citizen, I have no direct problem with anything he is saying. Being exposed to more then one point of view is not a disadvantage.
Dygear
S3 licensed
How about ...

PRISM/modules/prism_button.php L39-L59

<?php 
    
public function registerOnClick(Plugins $plugin$methodName$params NULL)
    {
        
$this->onClick = array($plugin$methodName$params);
        
$this->BStyle |= ISB_CLICK;
    }
    public function 
click(IS_BTC $BTC)
    {
        if (!
is_array($this->onClick))
            return;

        switch (
count($this->onClick))
        {
            case 
3:
                
call_user_func_array(array($this->onClick[0], $this->onClick[1]), $this->onClick[2]);
            break;
            case 
2:
            default:
                
call_user_func($this->onClick$BTC$this);
            break;
        }
    }
?>

Let me know if that works out better for you.


<?php 
$this
->registerOnClick($this'ChaseClient', array($UName$CliUName));
?>

If after you update this breaks anything let me know, because I'll have to change it on the commit too.
Last edited by Dygear, .
Dygear
S3 licensed
Quote from T3charmy :Looking forward to that bug being fixed, really messes with my cruise plugin by calling NCN twice...

Really? Why? Why are you handling NCN packets anyway?
Wide Area Network Emulator, for testing packet quirkiness.
Dygear
S3 licensed
WANEM: The Wide Area Network Emulator. WANem allows the application development team to setup a transparent application gateway which can be used to simulate WAN characteristics like Network delay, Packet loss, Packet corruption, Disconnections, Packet re-ordering, Jitter, etc.

I've just found this project today, about 10 minutes ago, and was thinking that this could be useful for other InSim devs out there to check their code against to see how robust their network code is within a lab environment that can simulate the quirky WAN characteristics can may only be found on the fringe.
FGED GREDG RDFGDR GSFDG