The online racing simulator
PHPInSimMod - PRISM 0.4.4 Discussion
You can download PHPInSimMod - PRISM 0.4.4 from that link. Please use this thread to talk about this release.

Thank you.

PHPInSimMod (PRISM) 0.4.4
  • Updated to Version 0.4.4.
    Asorted Fixes
    • Fixed E_STRICT warning with InsimConnection::writeUDP()
    • Fixed up timer bug, which caused another timer with same timestamp to be removed.
    • Merge pull request #30 from LFSPovo/master Fixed timer stop issue reported by Povo.
    • Fixed merge conflicts with messaging branch.
    • Adds IS_NPL fix (Thanks the_angry_angel)
    • Adds IS_TOC fix (Thanks the_angry_angel)
    • Added DarkTime's timer fix for timer's smaller then 1 second. (Thanks DarkTimes)
    PTH & LVS fixes and improvements
    • First attempt at using custom pth files with PRISM, pth files must be in the same dir as the normal pth files (/data/pth/) to load correctly. The layout name must match that of the pth file to load the layout correctly.
    • LVS now reports on / off track events for all players.
    • LVS Plugin now works, with some modifications to the PTH parser as well.
    • Added Image Maker method to PTH parser.
    General Improvements / New Things
    • Msg2Lfs for sending messages to LFS.
I had no problems in the quick testing that I did with this release, and I don't see any show stoping bugs, so please do let me know if anything is working, not working so we can move onto the next branch 0.5.0 for PHP 5.4.x.

[Edit]
Yes, I just called Hell, it has frozen over. That's why there is a new PRISM release.
Fix of the Client and PlayerHandler would be nice because I fail to get the destruct routine working correctly and just decided yesterday not to rely anymore on these arrays and make my own again

Recap; they contain invalid data, primary due to the non removal of data when a client disconnects or joins the track, goes to pits and/or spectates (and joins again).
Quote from cargame.nl :Fix of the Client and PlayerHandler would be nice because I fail to get the destruct routine working correctly and just decided yesterday not to rely anymore on these arrays and make my own again

Recap; they contain invalid data, primary due to the non removal of data when a client disconnects or joins the track, goes to pits and/or spectates (and joins again).

I'll add that to my to do list.
-
(cargame.nl) DELETED by cargame.nl : too quick
OK about LVS.

First of all... There is a bug with function onLoadLayout(IS_AXI $AXI);

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

This is always true when its not open config so $this->pth gets overwritten with empty data when its a trackcombo in the old fashion. And I think it shouldn't do a return when its X or Y anyway.

I think it should be something like this;


if ($trackType == 'X' OR $trackType == 'Y')
{
echo "X or Y, lets continue with function";

}
else
{
echo "no X or Y, exit le custom layout function!";
return PLUGIN_CONTINUE; # Not a open layout where we need to check for custom pth files.
}

My debug echo's still in it

Quote from Dygear :First attempt at using custom pth files with PRISM, pth files must be in the same dir as the normal pth files (/data/pth/) to load correctly. The layout name must match that of the pth file to load the layout correctly.

Custom PTH gets loaded (I know that because I print_r($this->pth); @MCI section) but somehow it always reports on track

I tested it with B11.pth, it basically does nothing. Just saying once; on the track, when leaving pits (should be off the track anyways) ..

Too bad because it seem to work perfectly with FE3!

Any idea's? I have zero expertise with PTH files.
Attached files
B11.zip - 7.5 KB - 835 views
Just a heads up(I guess?) I was getting this error:

Quote :> ERROR: [8] Undefined variable: callback. prism_plugins.php:231

Which is this line:

<?php 
        
if ($callback $this->getCallback($this->insimCommands$packet->Msg) && $callback !== FALSE)
?>

Which I fixed by doing:


<?php 
        
if (($callback $this->getCallback($this->insimCommands$packet->Msg)) && $callback !== FALSE)
?>

Might be worth fixing for all 3 command functions...
I keep getting an error on TOC, with this line in prism_statehandler.php

<?php 
$this
->parent->clients[$TOC->NewUCID]->players[$TOC->PLID] &= $this->parent->players[$TOC->PLID];
?>


> ERROR: [8] Undefined offset: 28. prism_statehandler.php:416
> ERROR: [8] Object of class PlayerHandler could not be converted to int. prism_statehandle

I'm honestly surprised that anyone is still using it, while PRISM still works quite well with the current version of InSim, it is in such bad need of a re-write from the ground up. The odd thing is, that I think the numbers of people using PRISM is going up quite significantly over the past few months, I'm guessing we are getting some people switching over from ARIO, and new servers showing up that don't want to pay for something that is no longer supported.
Lol, I'm sorry but this is nothing compared with Airio's capabilities (even in free version).

Some cruise fans are using it to try to create something but other then that it's pretty dead.

I'm using it to support some basic functions on CG but if it will ever be improved, then we would getting somewhere

Without proper LVS functionality it's pretty pointless.
I've never used Airio, so I don't know what it can and can't do. I also didn't know they had a free one. From that, I really can't explain why people are still using this ...
Quote from cargame.nl :Some cruise fans are using it to try to create something but other then that it's pretty dead.

Yea, My Cruise Plugin is currently 2361 lines, and will probably hit about 3000-3500 lines in a day or two after I go on this coding spree of fhinshing up my to-do list...


Quote from Dygear :I'm honestly surprised that anyone is still using it, while PRISM still works quite well with the current version of InSim, it is in such bad need of a re-write from the ground up. The odd thing is, that I think the numbers of people using PRISM is going up quite significantly over the past few months, I'm guessing we are getting some people switching over from ARIO, and new servers showing up that don't want to pay for something that is no longer supported.

from what I see, PRISM works fine, I've only ran into a few small core PRISM errors, most of which I've fixed my self, I am gonna be looking into the TOC packet tonight and see what's causing it to spit errors at me... I've even managed to import a few features from LFSLapper(such as alternating button text) with my own ButtonManager. :P
#12 - PoVo
I'm using PRISM for my cruise server too ([RC] Reality Cruise). Works great! We switched over from InSimDotNet for "fun"
Cool stuff, T3 if you want to submit those changes as patch I'll happily merge them and you can release the next version of PRISM (just don't forget to add yourself as a dev to the PHPInSimMod.php file at the top of the class definition).
Quote from Dygear :Cool stuff, T3 if you want to submit those changes as patch I'll happily merge them and you can release the next version of PRISM (just don't forget to add yourself as a dev to the PHPInSimMod.php file at the top of the class definition).

Alright, I'll do that, though, I gotta figure stuff out, cause some parts of my PRISM is still 0.4.3 and other parts are 0.4.4

Edit: Soon as I can figure out how to use Git, I've been using BitBucket for all my stuff for a while...

Edit2: I have modded the Timer system to use names, I've used it for months it has no issues, mind if I put that in the next version? or should I just leave it out, until you see fit?
Quote : protected function createTimer($name, $callback, $interval = 1.0, $flags = Timer::CLOSE, $args = array())

Quote from T3charmy :Edit2: I have modded the Timer system to use names, I've used it for months it has no issues, mind if I put that in the next version? or should I just leave it out, until you see fit?

Looks like it brakes compatibility with older code, but that I'm OK with. Just make sure you put it in the notes as a breaking change.

Quote from T3charmy :Alright, I'll do that, though, I gotta figure stuff out, cause some parts of my PRISM is still 0.4.3 and other parts are 0.4.4

Edit: Soon as I can figure out how to use Git, I've been using BitBucket for all my stuff for a while...

Once you learn how to use git, it's awesome. It should even merge the changes from the 0.4.3 version you're using, and it should bring it up to date with the changes in 0.4.4, but keep all of the modifications you've made to the code base.
Lol i will download and try
Quote from Dygear :I also didn't know they had a free one. From that, I really can't explain why people are still using this ...

Because Airio can't manage stuff which I like to see managed...

And I want even more so continueing with it... It came to my attention that it sends out TINY_NCN/NPL and RES twice during startup, so LFS returns that data also twice.

Its because it also sends out an ISM and when PRISM receives the ISM packet it starts to send out TINY_NCN/NPL too

Long story short I removed;


$ISP->SubT(TINY_NCN)->Send(); # get all connections (ISP_NCN)
$ISP->SubT(TINY_NPL)->Send(); # get all players (ISP_NPL)
$ISP->SubT(TINY_RES)->Send(); # get all results (ISP_RES)

from //constructor section @prism_statehandler.php .. Not sure if that is the most logical decision but hey I'm afraid nobody is going to take care anyway.

/end of personal note
As long as you understand the ramifications of doing that, then it's fine. Your not running PRISM stand alone, so it does not really matter. On another note, PHP 5.5.0 was released two days ago. I have it up and running on half of my web servers. So far, so good.
Well ... I don't understand the use of requesting data twice.
Well, the state handler does get it's stateful information at startup from there. But as you said AIRO is already getting those packets, then PRISM does not have to request them. But if you were running PRISM standalone, then you would want to keep those lines in there. Unless you are saying that PRISM is it's self request two sets of cars and clients data.
Hmm nono

You are getting me wrong I think. Nothing to do with Airio..

This happens also in the constructor;


# Get the most about of information as fast as we can.
$ISP->SubT(TINY_ISM)->Send(); # Get Multiplayer Info (ISP_ISM)

And guess what ISM is about? (further down statehandler)...


public function onMultiPlayerStart(IS_ISM $ISM)
{
$this->Host = $ISM->Host;
$this->HName = $ISM->HName;

# Send out some info requests, to make sure we have all of the baseline information.
$ISP = IS_TINY()->ReqI(1);
$ISP->SubT(TINY_NCN)->Send(); # get all connections (ISP_NCN)
$ISP->SubT(TINY_NPL)->Send(); # get all players (ISP_NPL)
$ISP->SubT(TINY_RES)->Send(); # get all results (ISP_RES)

It does the same!

Sorry if Im a bit unclear, sometimes I tell half stories
This is from what I understand of the InSim.txt file. Nowhere does it say that a ISM packet will also get all of the information for the clients and players. It simply get's the information about a host that you join or create in so far as it's host name. The requests you see are needed when PRISM is running by it's self. So that it can get the information. I think that AIRIO is doing the same thing that I am doing in so far as questing all connections, all players and then all results. That's why you are seeing the double packets.
Can you at least read what you made yourself?

Quote :// Constructor
public function __construct()
{
global $PRISM;
# Send out some info requests
$ISP = IS_TINY()->ReqI(1);
// Request every bit of information we can get.
// This becomes our baseline that we use and update as needed.
# Get the most about of information as fast as we can.
$ISP->SubT(TINY_ISM)->Send(); # Get Multiplayer Info (ISP_ISM)
# Get information on the clients & players, and their current race state.
# These are redundant because of the above request for an ISM packet.
# They must remain in order to avoid an error state in some plugins.
$ISP->SubT(TINY_SST)->Send(); # Send STate info (ISP_STA)

/* blocked by Dave, we already get this info by ISM, see below?
$ISP->SubT(TINY_NCN)->Send(); # get all connections (ISP_NCN)
$ISP->SubT(TINY_NPL)->Send(); # get all players (ISP_NPL)
$ISP->SubT(TINY_RES)->Send(); # get all results (ISP_RES)

*/

# Get information on everything else about the state.
$ISP->SubT(TINY_GTH)->Send(); # Get Time in Hundredths (SMALL_RTP)
$ISP->SubT(TINY_SCP)->Send(); # Send Camera Pos (ISP_CPP)
$ISP->SubT(TINY_REO)->Send(); # send an IS_REO (ISP_REO)
$ISP->SubT(TINY_RST)->Send(); # send an IS_RST (ISP_RST)
$ISP->SubT(TINY_AXI)->Send(); # send an IS_AXI - AutoX Info (ISP_AXI)

if (!$PRISM->hosts->getHostById()->isRelay())
{
$ISP->SubT(TINY_NLP)->Send(); # send an IS_NLP (ISP_NLP)
$ISP->SubT(TINY_MCI)->Send(); # send an IS_MCI (ISP_MCI)
$ISP->SubT(TINY_RIP)->Send(); # send an IS_RIP - Replay Information Packet (ISP_RIP)
}
}

Quote :ISP_ISM => 'onMultiPlayerStart',

Quote :
# IS_ISM (10)
public $Host; # 0 = guest / 1 = host
public $HName; # The name of the host joined or started.
public function onMultiPlayerStart(IS_ISM $ISM)
{
$this->Host = $ISM->Host;
$this->HName = $ISM->HName;

# Send out some info requests, to make sure we have all of the baseline information.
$ISP = IS_TINY()->ReqI(1);
$ISP->SubT(TINY_NCN)->Send(); # get all connections (ISP_NCN)
$ISP->SubT(TINY_NPL)->Send(); # get all players (ISP_NPL)
$ISP->SubT(TINY_RES)->Send(); # get all results (ISP_RES)


}

Stop talking about Airio, it has nothing to do with it, that communication is not being shown in another InSim instance. Major security issue if that would be the case

.
Ok, now that I see the full code block it all makes sense now. I've been living in the world of bridged connections for the past few weeks as I'm been fiddling with network settings within WiFi routers. I just assumed that packets can be seen by other InSim instances. I've forgotten most of the the stuff that I've myself wrote and most of the rules that InSim uses. Not an inspiring bit of news from a Dev, huh!?
No, I think I fully understand it.

It's OK, I didnt expected any response on my report to begin with

I presumed this topic more or less was abandoned, good to see you are still around.
1

FGED GREDG RDFGDR GSFDG