The online racing simulator
Searching in All forums
(363 results)
T3charmy
S3 licensed
Quote from Dygear :Where is this code? Is it in a plugin? Also, is the value of $hostId correct?

its in modules/prism_hosts.php Line 515-517
T3charmy
S3 licensed
I seem to be having issues with this:


$host = $this->hosts[$hostId];

if ($host->isRelay())
{

says undefined index, and I am assuming that isRelay isn't working because of this. :3
T3charmy
S3 licensed
I have tried it... I like it... The new Interface, is great for new users aswell as Power users... I haven't actually ran it on my comp... only in virtual box... but It still looks pretty sweet in my opinion
T3charmy
S3 licensed
TechnoBase.FM
T3charmy
S3 licensed
Quote from Dygear :No, not directly, but there is a PHP one.


<?php 
str_replace
($search$replace$subject);
str_replace($needle$haystack$subject);

$Text str_replace('^0'''$Text);

$Text str_replace(
    array(
'^0'),
    array(
''),
    
$Text
);
?>


LateReply: ahh ok thanks
T3charmy
S3 licensed
Quote from Dygear :<snip>

Yep, I'm just having it ignore it all together ... since that is fixed, I shouldn't really need a error limiter now... but might be smart to keep in case Either way, It is working nicely now... that I have ignored that error...

Final Code:

<?php 
    
private $Additional = array();
    
    public function 
onPrismError($eNo$eStr$eFile$eLine)
    {
        if(
$eStr != 'Invalid CRT parameters detected'){
            if(!isset(
$this->Additional['Error']['Last']))
                
$this->Additional['Error']['Last'] = time() - 5;
            if((
time() - $this->Additional['Error']['Last']) >= 5){
                
$Error sprintf("^1> ERROR: ^7[%d] %s. %s:%d",$eNo,$eStr,basename($eFile),$eLine);
                
IS_MTC()->Sound(SND_ERROR)->UCID(255)->Text($Error)->Send(); console($Error);
                
$this->Additional['Error']['Last'] = time();
            }
        }
        return 
FALSE;
    }
    public function 
onPrismClose()
    {
        
IS_MTC()->Sound(SND_ERROR)->UCID(255)->Text('^1> FATAL ERROR. ^7Restarting...')->Send();
        
Cruise::sqlSaveAll();
    }
    public function 
__construct()
    {
        
#PHP Stuff
        
set_error_handler(array($this'onPrismError'));
        
register_shutdown_function(array($this'onPrismClose'));
?>

Example of a fatal error...(click for larger image)


Edit: Is there a PRISM function which will remove ^0 etc. from a string?
Last edited by T3charmy, .
T3charmy
S3 licensed
Quote from Dygear :<snip...>

Yep, I tried sending a /msg and it sends fine... not sure why it is only crashing for MTC...
also, it seems to work fine on shutdown... must be something to do with error... and I might have just found out what it was ... will find out in a sec

EDIT: ok, so I just put it to debug out to the console and I keep getting it to say this error: ERROR: ['2'] Invalid CRT parameters detected

EDIT2: Alright, found out that the problem is due to the error above(has to do with strftime function), the error was sending soo much that it could not keep up causing prism to crash from sending too many pps

Edit3: to prevent too many PPS I did this and it works fine...:

<?php 
    
private $stuff NULL;
    
    public function 
onPrismError($eNo$eStr$eFile$eLine)
    {
        if(
$eStr != 'Invalid CRT parameters detected'){
            if(
$this->stuff === NULL)
                
$this->stuff time() - 10;
            if((
time() - $this->stuff) >= 10){
                
$Error sprintf("^1ERROR: ^7[%d] %s. %s:%d",$eNo,$eStr,basename($eFile),$eLine);
                
IS_MTC()->Sound(SND_ERROR)->UCID(255)->Text($Error)->Send();
                
$this->stuff time();
                
console($Error);
            }
        }
        return 
FALSE;
    }
?>

Last edited by T3charmy, .
T3charmy
S3 licensed
Quote from Dygear :<snip>

Although this is nice, it brings me to worry about some things... How exactly are servers that have multi-LFS dedi's going to use PRISM? will we still be able to set up manually?
T3charmy
S3 licensed
PRISM Cruise?
T3charmy
S3 licensed
Couldn't you make it so you can specify it on a per plugin basis, but also have it so you can set per server, or even global basis? like...
T3charmy
S3 licensed
Quote from GeForz :If you do benchmarks, please also benchmark
'foo'.$packet->var.'bar'
against
"foo{$packet->var}bar"


intrested in this aswell
T3charmy
S3 licensed
Looks like a nice update... looking forward to using it D
T3charmy
S3 licensed
Quote from DavidTiger :It would recover some things but others were overwritten and un-recoverable

ahh, man that really sucks... Kind of surprised you don't have a back up of it on a flash drive or something...
T3charmy
S3 licensed
Quote from DavidTiger :Lost the source (again) lol... Stupid me accidentally deleted the folder on the desktop instead of another folder.. and that folder contained program sources and other website stuff

I have absolutely no motivation to start it from scratch (again)... It was a pretty cool/fun thing to have on cruise servers but I don't think I'll be programming it again.

So for that reason I'll give permission to anyone who would like to 'copy' this idea and create an alarm program themselves

http://www.piriform.com/recuva

this is your friend

EDIT:


Quote from DavidTiger :Nah it was emptied before I realized
Tried Piriform Recuva but didn't help much...

didn't see this :/ Normally Recuva works for me, not sure why its not too good for you :/
Last edited by T3charmy, .
T3charmy
S3 licensed
Woo, Great Work Devs!
T3charmy
S3 licensed
Seems like 0.6B is now available to download
T3charmy
S3 licensed
Quote from Dygear :Kinda like a Time to Live? Interesting.

That does bring up a good point ... Timed buttons. Where a button must only display for some time, the delete it's self. This comes to a point where I must think how to setup the API to allow for buttons to have their own callbacks within plugins, so things like a count down clock could be done easily.

Kinda, like what LFSLapper has? that was one of the things that I really liked about LFSLapper... I just didn't know if it was possible :P
T3charmy
S3 licensed
Quote from Dygear :
I realized that I did that packet system wrong from a fundamental point of view. Button packets are going to have to sent to the button class, and bypass the plugin system altogether for this to function efficiently. Although, it's not going to look pretty in the core the first time I implement it. I do expect that some other pass-throughs it will get better. That said, I would also refactor some of your code T3, you did a good job, but I have some other more concise ideas for this, although your theory is correct.

Altleast it gets the job done?

Quote from GeForz :jeah thats one of the things i wasnt sure of. so its 239 buttons per conn and if you send a button to ucid 255 the clickid would need to be free for every user?

oh yea... didn't think about that :/ hmm well an option would be if UCID 255 subtract from 239 and keep going down
T3charmy
S3 licensed
ok I fixed it...

added


<?php 
if (!empty($BTN->ClickID)) { return PLUGIN_CONTINUE; }
?>

to registerbutton, and now it only sets the ClickID when needed(AKA new button), also, when you guys made the button queue, it should go on a per user not a per host basics

so added this:

<?php 
self
::$ids[$hostId][$BTN->UCID]
?>

final product(posting to GitHub now):

<?php 
    
public static function registerButton(Button $BTN$hostId null)
    {
        if (!empty(
$BTN->ClickID)) { return PLUGIN_CONTINUE; }
        if (
$hostId === NULL)
        {
            global 
$PRISM;
            
$hostId $PRISM->hosts->curHostID;
        }
        
        
// next id: may be 0 - 239
        
$id 0;
        if (isset(
self::$ids[$hostId][$BTN->UCID]))
        {
            
$id self::$ids[$hostId][$BTN->UCID];
        }
        
        
$BTN->ReqI $id 1// may not be zero -_-
        
$BTN->ClickID $id;
        
        
self::$ids[$hostId][$BTN->UCID] = $id 1;
    }
?>

BTW Dygear, look for this account, not Fire_optikz001 :P Not even quite sure how I managed to get logged into Fire_optik001... :P
Last edited by T3charmy, .
T3charmy
S3 licensed
Quote from Dygear :I've been on the server, and it works really well. Very impressed with what has been done.

So, from what you saw, did you think it was ready for a release?
T3charmy
S3 licensed
Has this error been fixed yet?:

PHP NOTICE:
Indirect modification of overloaded property ClientHandler::$UName has no effect in C:\Users\T3charmy\SpiderOak\
PRISM\modules\prism_plugins.php on line 256
1 :: canUserAccessCommand in C:\Users\T3charmy\SpiderOak\PRISM\plugins\admin.php:218
2 :: cmdHelp in C:\Users\T3charmy\SpiderOak\PRISM\modules\prism_plugins.php:213
3 :: handleCmd in C:\Users\T3charmy\SpiderOak\PRISM\modules\prism_plugins.php:156
4 :: dispatchPacket in C:\Users\T3charmy\SpiderOak\PRISM\modules\prism_hosts.php:440
5 :: handlePacket in C:\Users\T3charmy\SpiderOak\PRISM\modules\prism_hosts.php:323
6 :: checkTraffic in C:\Users\T3charmy\SpiderOak\PRISM\PHPInSimMod.php:225

T3charmy
S3 licensed
Quote from Victor :http://www.lfsforum.net/showth ... hlight=IS_PLC#post1602905

oh ok, the funny thing is, i read that the other day, hmm, ah well, thanks yet again
T3charmy
S3 licensed
Hmm, when a user has a car VIA PLC packet, then they lose it VIA PLC, they don't get spectated??
T3charmy
S3 licensed
Quote from Victor :And a new version of Tetris

I was actually, thinking of making a Tetris like game with this...
T3charmy
S3 licensed
Heh, had some fun with AXM:
FGED GREDG RDFGDR GSFDG