The online racing simulator
Searching in All forums
(884 results)
Bass-Driver
S3 licensed
The function will become uncompatible with older Lapper versions.
Bass-Driver
S3 licensed
There is some info about RegisterScheduledAction() in the changelog. But nothing about the parameters.

I opened LFSLapper.LPR and i found this.


RegisterScheduleAction( "0 0 0 * * * *", SA_mid );

You can register a subfunction to call when a time is reached

Firts arg = cron format ss mm hh dayOfWeek dd MM YYYY

dayOfWeek start at 0 = Sunday

Second arg = Sub to call when player type this text

Bass-Driver
S3 licensed
The Dcon hasnt crashed since then. So i'm thinking of reason 4 and 5 at the same time. The DCon was running since version U came out. Without any crashes.
Bass-Driver
S3 licensed
i'm not sure if lapper suppose to execute RegisterScheduleAction() every second when all parameters are disabled.

In my Idle/AFK script, i have done it like this:
Basically i also set every second aswell, like you did


<?php 
CatchEvent OnLapperStart
()
     
##Set first second (0)
    
GlobalVar $IdleAFKTimer$IdleAFKTimer "0 * * * * * * ";
     
##Create a string from second (1) to second (59)  0 * * * * * * : 1 * * * * * * : 2 * * * * * * etc
    
FOR($i=1;$i<60;$i=$i+1)
        
$IdleAFKTimer $IdleAFKTimer " : ".$i." * * * * * *";
    ENDFOR
     
##Set Registeraction with the string you created above 
    
RegisterScheduleAction"".$IdleAFKTimer.""RSA_IdleTimer);
EndCatchEvent
?>


The internal codes for RegisterScheduleAction() has been changed, because when Lapper hangs up for a second(when someone is leaving the pitbox), a created loop couldnt continue, because the set seconds didnt matched with the real time.
Bass-Driver
S3 licensed
Because the SMALL_LCS insimpacket works only when the an insim is running localy. Maybe Scawen will change that in the future.
Bass-Driver
S3 licensed
That function can only be used when you run Lapper localy.
Bass-Driver
S3 licensed
New turkish demo servers who advertise theire cracked community.

Army team or whatever they named it
Bass-Driver
S3 licensed
New PublicTest: Linux update

This test contains "fixes" for Linux/mono users. Big thanks to Victor for that.

For this test i want to ask Linux users to test this Lapperversion. Ofcourse windows user may test this aswell.

Any feedback whould be welcome.
Bass-Driver
S3 licensed
One of the servers i host , crashed today.
Some say it happends during a track/layout change

i hope you can get any information about the errorcodes below:

Naam van toepassing met fout: DCon.exe, versie: 0.0.0.0, tijdstempel: 0x5c89394e
Naam van module met fout: DCon.exe, versie: 0.0.0.0, tijdstempel: 0x5c89394e
Uitzonderingscode: 0xc0000005
Foutoffset: 0x0001c053
Id van proces met fout: 0xac0
Starttijd van toepassing met fout: 0x01d4ed5b34cecc9b
Naam van toepassing met fout: DCon.exe, versie: 0.0.0.0, tijdstempel: 0x5c89394e
Naam van module met fout: DCon.exe, versie: 0.0.0.0, tijdstempel: 0x5c89394e
Uitzonderingscode: 0xc0000005
Foutoffset: 0x0001c053
Id van proces met fout: 0xac0
Starttijd van toepassing met fout: 0x01d4ed5b34cecc9b

Bass-Driver
S3 licensed
thanks for the information. Smile
ill see what i can do with it.
Bass-Driver
S3 licensed
New publictest version: (Thx Yisc[NL] for testing)

This contains a fix for displaying the visible results within a list in one of the TOP lists : User/Drift/Race
It had to be implemented since 7.0.4.10, but for some reason i havent changed the parameter in the final version.

01: Changed hardcoded visible records in Toplist/UserTop/Drifttop from 24 to 10000

$list = GetListTop( getConfigVar( DefaultTopCar ), 0, 0 );
Note: Users must edit theire script to see the max visible Records. This can be done with a FOR loop:


<?php 
FOR( $i=0;$i<25;$i=$i+1)
ENDFOR
?>

Bass-Driver
S3 licensed
Ill look into that later, when i finally moved to my new house.
Maybe its an idea to set a racetimer in Lapper that starts when the lights go green. But i need to know how.
Bass-Driver
S3 licensed
Sorry to bump this thread.

@ victor: Whould you like to share the code with me to make Lapper work with Mono??
If you send me na PM, will sent you my email.
Bass-Driver
S3 licensed
The raw UCO info you see in Racons post is basically the info you get from the from the UCO insim packet when someone acrossed a checkpoint/Circle :

Event OnCrossingChecker($userName,$Flags,$Time,$Object,$UserSpeed,$CircleIndex) # Player event

SPX is a insimpacket that gives you information when someone across a checkpoint or drove a lap
These are the events in lapper:

#############################################$#
#Splitting (general action when passing split)#
###############################################

Event OnSplit1( $userName ) # Player event
EndEvent

Event OnSplit2( $userName ) # Player event
EndEvent

Event OnSplit3( $userName ) # Player event
EndEvent

Event OnLap( $userName ) # Player event
EndEvent

This is how the UCO and SPX packet looks like in LFSLapper.

<?php 
===============================
UCO insimpacket
===============================
// OK For Insim 8
        
public class UCO // Size 28 Bytes: report InSim checkpoint / InSim circle
        
{
            public 
CarContOBJ C = new CarContOBJ();
            public 
ObjectInfo OBJInfo = new ObjectInfo();

            public 
readonly int PLID;                           // player's unique id
            
public readonly int Sp0;                            //Spare 0
            
public readonly int UCOAction;
            public 
readonly int Sp2;                            //Spare 2
            
public readonly int Sp3;                            //Spare 3
            
public readonly int Time;                           //hundredths of a second since start (as in SMALL_RTP)

            
public UCO(byte[] packet)
            {
                
//byte    Size of packet;        // 28
                //byte Type of packet;      // ISP_UCO
                //byte ReqI;                // 0

                
PLID pakGetByte(packet3);                   //1 Byte PlayerID
                
Sp0 pakGetByte(packet4);                    //1 Byte Spare
                
UCOAction pakGetByte(packet5);              //1 Byte Flag
                
Sp2 pakGetByte(packet6);                    //1 Byte Spare
                
Sp3 pakGetByte(packet7);                    //1 Byte Spare
                
Time pakGetInt(packet8);                    //4 Bytes [RaceTime hundredths of a second since start (as in SMALL_RTP) GetLapperVar("RaceTime)"]

                //Info of PlayerCar
                
C.Direction pakGetByte(packet12);           //1 Byte
                
C.Heading pakGetByte(packet13);             //1 Byte
                
C.Speed pakGetByte(packet14);               //1 Byte
                
C.PlayerPosZ pakGetByte(packet15);          //1 Byte
                
C.PlayerPosX pakGetShort(packet16);         //2 Bytes
                
C.PlayerPosY pakGetShort(packet18);         //2 Bytes

                //Info of object(Checkpoint/Circle)
                
OBJInfo.pakGetShort(packet20);            //2 Bytes
                
OBJInfo.pakGetShort(packet22);            //2 Bytes
                
OBJInfo.pakGetByte(packet24);             //1 Byte
                
OBJInfo.Flags pakGetByte(packet25);         //1 Byte
                
OBJInfo.Index pakGetByte(packet26);         //1 Byte
                
OBJInfo.Heading pakGetByte(packet27);       //1 Byte
            
}
        }

===============================
SPX insimpacket
===============================

 
/// <summary>
        /// Split X time decoder
        /// </summary>
        // SPX OK for insim 4
        
public class SPX
        
{
            public 
readonly int PLID;
            public 
readonly long STime;
            public 
readonly long ETime;
            public 
readonly int Split;
            public 
readonly int Penalty;
            public 
readonly int NumStop;
            public 
readonly int Sp3;

            public 
SPX(byte[] pak)
            {
                
//byte    Size of packet;            // 28
                //byte Type of packet;          // ISP_SPX
                //byte ReqI;                    // 0
                
PLID pakGetByte(pak3);      //1 Byte Player ID
                
STime pakGetUnsigned(pak4); //4 Bytes Split time (ms)
                
ETime pakGetUnsigned(pak8); //4 Bytes Total time (ms)
                
Split pakGetByte(pak12);    //1 Byte split number 1, 2, 3
                
Penalty pakGetByte(pak13);  //1 Byte current penalty value
                
NumStop pakGetByte(pak14);  //1 Byte number of pit stops
                
Sp3     pakGetByte(pak15);  //1 Byte Spare
            
}
        }
?>

Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
sry, what i ment is: do not request it to many times per second.
What you are trying todo is just fine.
Bass-Driver
S3 licensed
I have changed the the code of GetLapperVar("RaceTime"); to its old state.
It will now request the current racetime from the LFS Racetimer. LFS will sent a insimpacket back to Lapper.

Do not request it to many times. Your cpu usage will increase.

The rest of the lappervars arent changed:

GetLapperVar("elapsedms");
GetLapperVar("elapsedsecs");
GetLapperVar("elapsedmins");
Bass-Driver
S3 licensed
oke, thanks for the usefull info.

i came to a conclusion that the timecalculation if wrong for


GetLapperVar("racetime");
GetLapperVar("elapsedms");
GetLapperVar("elapsedsecs");
GetLapperVar("elapsedmins");

When requesting these values. It will not get the time from LFS, but it does calculate the time between: Startrace and the time when you request the value.

it seems to take some time to:

-send the valuerequest to Lapper. It might take longer when the Lapperserver is hosted on a another computer
-calculating the time.
-convert the value to MSH: NumtoMSH();
-send the value back on screen (privmsg/button)

So basically the solution is trying to retrieving the same value as $time.
I'm gonna look into this asap.

Going to try to retreive the time-insimpacket from LFS.

Going to change GetLapperVar("racetime") in its old state, to see what the difference are.
Bass-Driver
S3 licensed
About the timedifference between the insim and LFS clocks.

Thy this lapperfunction to retreive the current racetime:

$racetime = GetLapperVar("racetime");

This var will start when the race starts. it retreives information from the insim packet

Here are some other GetLapperVar() vars from the sourcecode.


<?php 
//Get date and time when the race has been started.
//GetLapperVar("dateracestarted");
case "dateracestarted":
      
val.typVal GLScript.typVal.str;
      
val.sval utils.quote(currRace.started.ToString("yyyy-MM-dd-hh-mm-ss"));
return;

//Elapsed racetime (in Minutes) after the race has been started
//GetLapperVar("elapsedmins");
case "elapsedmins":
     
TimeSpan interval DateTime.Now.Subtract(currRace.started);
     
val.typVal GLScript.typVal.num;
     
val.fval = (float)interval.TotalMinutes;
return;

 
//Elapsed racetime (in Seconds) after the race has been started
 //GetLapperVar("elapsedsecs");
case "elapsedsecs":
       
TimeSpan interval2 DateTime.Now.Subtract(currRace.started);
       
val.typVal GLScript.typVal.num;
       
val.fval = (float)interval2.TotalSeconds;
return;

 
//Elapsed racetime (in Milliseconds) after the race has been started
 //GetLapperVar("elapsedms");
case "elapsedms":
    
TimeSpan intervalms DateTime.Now.Subtract(currRace.started);
    
val.typVal GLScript.typVal.num;
    
val.fval = (float)intervalms.TotalMilliseconds;
return;

//Current racetime (in Milliseconds) after the race has been started
//GetLapperVar("racetime");                 
case "racetime":
    
TimeSpan intervalm DateTime.Now.Subtract(currRace.started);
    
double RaceTimer long.Parse(Math.Round(intervalm.TotalMilliseconds).ToString());
    
val.typVal GLScript.typVal.num;
    
val.fval = (float)RaceTimer;
return;
?>

i'm aware that racetime and elapsedms looks the same.
the racetime code was differend, but the cpu usage was rising when many people try to retreive the current racetime (from insimpacket). I use this var in my Timeattack script.

Since i changed it, it looks and (works) the same as 'elapsedms'.
Will convert 'racetime' from Milliseconds to MSH someday, like i did with the 'Oncrosschecker' event.
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
I made a couple of changes:

Have only attached the .exe in the attachments.

publictest_01 directory is required!! if you dont have it, goto the first post

=================================================
Changed:
=================================================
1:NumtoMSH(); returns values in HH:mm.ss format, was HH.mm.ss before.
2:Event oncrossingchecker: returns now which insim checkpoint you crossed.
3:Event oncrossingchecker: returns time in H:mm:ss format.

=================================================
Fix:
=================================================
1: No returning value when accidently applying NumtoMSH(); twice

Bass-Driver
S3 licensed
Its indeed more usefull for non-experienced lapperusers.
What i could do is to add numtomsh() to the $Time parameter in the sourcecode.

But there is one think i concerned about.
To keep it compatible with the older lapperversion, i need to know what happends when you convert that value twice with numtomsh();

if it returns an error, i have to change the code a littlebit.

Atm i do have not much time, to work on Lapper.
i'm moving to a new house.
Bass-Driver
S3 licensed
a quick look at the old code it seems that retreiving values from LFSW need a complete overhaul.

look throught the Lapperfunctions list, i see 2 functions to retreive PB's from LFSW??

currentplayerlfsworldpb();
currentplayerlfsworldpbfrom();

I only found a changelog of currentplayerlfsworldpb();.
cant find anything of currentplayerlfsworldpbfrom(); , i have to look at the sourcecode for that.


+--------------------------------+
|Changes from v5.840 to 5.841 RC |
+--------------------------------+
1. Add new GLScrip command
CurrentPlayerlfsWorldPB( $argv );

Display a screen table with the lfs world PB for the current player
$argv cant contain a car or a track or the two values
$argv = "XRT" -> Display all LFS world PB for the XRT Car
$argv = "BL1" -> Display all LFS world PB for the BL1 Track
$argv = "BL1 XRT" -> Display LFS world PB for the XRT car and BL1 Track

This feature need the pubStatIdk setted in config file

Due to the tarpit that forces you to wait 5 seconds between two call to pubstat
( if two player join in less than 5 sec the server ), you need to wait few second
before retry command.

2. Add new function in LFS chat
!mypb to view your LFS world PB

example:
!mypb XRT
!mypb BL1

Edit:
Looking throught the code, it seems to open a list with the current LFSW PB's. This list is hardcoded.

currentplayerlfsworldpbfrom() is the same function as above but with a 2nd parameter.
currentplayerlfsworldpbfrom($argv,$startfromline);

It opens the same table but starts from a differend position in the table?
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Good to see that you got it working. Thumbs up

There's no need to apologize. Didnt had the time to work on it.

Smile
Bass-Driver
S3 licensed
Thx for the first feedback.

The deleting exe file is really strange. Maybe a virusscan protection or something?

I have no idea what that could be.
I will look into it as soon i get home.
Bass-Driver
S3 licensed
Havent change anything with Shift+I.
ill go take a quick look into the sourcecode.

edit: function should be myconfig();

CASE "!myconfig":
myConfig( );
BREAK;

Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
-Do you get any errormessages??
-Does the code work before that line?

What i can see is you forgot a ';' behind it.
FGED GREDG RDFGDR GSFDG