The online racing simulator
Lapper crashes sometimes in a way I don't understand
The error it gives is as follows
Value was either too large or too small for an unsigned byte.
mscorlib
at System.Byte.Parse(String s, NumberStyles style, NumberFormatInfo info)
at System.Byte.Parse(String s)
at LFSLapper.LFSClient.joinrequest(unionVal val, ArrayList args)
at GLScript.GLApp.parseBackcall(SetOfVars GVAR, SetOfVars LVAR, unionVal val, ArrayList args)
at GLScript.Parseur.getval(SetOfVars GVAR, SetOfVars LVAR, executeParsedFunction BC)
at GLScript.GLApp.retrieveEvalVar(String funcName, TokenParse tkparse, TokenBuffer currTokenBuffer, SetOfVars GVAR, SetOfVars LVAR, Boolean breakFunc, Char& breakCar)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteFunction(String funcName, String[] argsVals)
at GLScript.GLApp.executeFunction(String funcName, String[] argsVals)
at Configurator.lexConfigurator.executeFunction(String funcName, infoPlayer pcurrInfoPlayer, String[] par)
at LFSLapper.LFSClient.managePacket(MSO mso)
at LFSLapper.LFSClient.Loop(Connect insimConnection)
at LFSLapper.LFSClient.doloop()
at LapperInstances.LapperInstance.doConnection()
Byte Parse(System.String, System.Globalization.NumberStyles, System.Globalization.NumberFormatInfo)
Closing Instance...
Problem has to do with a joinrequest.
Some value is send, that cannot be handled properly by Lapper, which then crashes.
Ofcourse the value should not be able to crash the application, so that has to be investigated by Bass-Driver.
In the mean time you could check what kind of value is send and if there is anything you can do to prevent it from being send or to try and send it in the correct way.
Thanks for the information, I changed a few things myself, it seems to be fine now, but it will be a while before I can say that my problem is solved, so I can see if the problem persists. Thanks again
I think I found what causes the error, when you go under the map and it is "Retired" it crashes when you use commands that use joinrequest, I don't know how to solve it
As you said, LFSLapper crashes when you are below the map.
So i think the Z value (Height position of the car) might be the problem.

Can you provide me the axis values (X & Y & Z), before you call the joinrequest function.

GetPlayerVar($userName,"X");
GetPlayerVar($userName,"Y");
GetPlayerVar($userName,"Z");

Thanks

<?php 
        
CASE "!rp":
            
privmsg("^T^7Araç Yenileme ^2Başarılı");
            
$X_Axis getcurrentplayervar("X");      #X axis SpawnPoint
            
$Y_Axis getcurrentplayervar("Y");      #Y axis SpawnPoint
            
$Z_Axis getcurrentplayervar("Z");      #Z axis SpawnPoint
            
$Flags 128;      #Move/Reset car (128) else (0)
            
$Heading getcurrentplayervar("Heading");  #Heading of the players car at Spawnpoint
            
$UCID 0;       #Connection's unique id (0 = host)
            
$PLID getcurrentplayervar("PLID");  #Player's unique id
            
$JRRAction 4;
                
            
joinrequest($X_Axis $Y_Axis $Z_Axis $Flags ,$Heading $UCID $PLID ,$JRRAction); #Send Data to LFS
        
BREAK;
?>

It crashes even when I renew the car, can we do this with if value for example
IF ( GetPlayerVar( $userName, "Retired" ) == "0" )
THEN

if i know the values, i can fix it in the Lapper sourcecode.

as a temporary fix you can try:

IF ( ToNum(GetPlayerVar( $userName, "Z" )) >= 0)
THEN
#Call joinrequest
ELSE
#Something else
ENDIF

Looking into the sourcecode.
And Joinrequest shouldnt execute when Z value is below 0.
so should be something else.

I need all the values before you call joinrequest().

X-Axis
Y-Axis
Z-Axis
Heading
Flags
PLID
UCID
JRRAction

Also give me the name of the trackconfig and the position where you get "retired". (X and Y axis).
Thanks, the code you gave me for now seems to have worked for me.
Nice that the code works. But that is just a temporary fix.
i whould like to fix that crash, so i need your values i provided in my post above.
I did not fully understand what you said, but I wrote below what I could understand

<?php 
            $X_Axis 
getcurrentplayervar("X");      #X axis SpawnPoint
            
$Y_Axis getcurrentplayervar("Y");      #Y axis SpawnPoint
            
$Z_Axis getcurrentplayervar("Z");      #Z axis SpawnPoint
            
$Flags 128;      #Move/Reset car (128) else (0)
            
$Heading 0;  #Heading of the players car at Spawnpoint
            
$UCID 1;       #Connection's unique id (0 = host)
            
$PLID getcurrentplayervar("PLID");  #Player's unique id
            
$JRRAction 4;
            
            IF( 
$eventarea == )
            
THEN
            privmsg
("^1^T IŞINLANMA ALANI DOLU LÜTFEN BEKLEYİNİZ");
            ELSE
            
joinrequest(60.94,878.06,$Z_Axis,128,0,$UCID,$PLID,$JRRAction);
            
privmsg("^7^T Işınlanma Tamamlandı Lütfen Alanı Boşaltın");
            
closePrivButton("yazis1&yazis2&yazis3&yazis4&yazis5&yazis6&yazis7&yazis8&yazis9&yazis10&yazis11&yazis12&yazis13&yazis14&yazis15&yazis17");
            ENDIF
?>

X = 416 - Y = 166
WE1Y

When we crash or when we travel outside the map we can go underground so I don't think this location can only be in 1 place
I don't think the joinrequest I gave above makes sense because it crashes every time I use joinrequest

<?php 
        
CASE "!rp":
IF ( 
ToNum(GetPlayerVar$userName"Z" )) >= 0)    
THEN
            privmsg
("^T^7Araç Yenileme ^2Başarılı");
            
$X_Axis getcurrentplayervar("X");      #X axis SpawnPoint
            
$Y_Axis getcurrentplayervar("Y");      #Y axis SpawnPoint
            
$Z_Axis getcurrentplayervar("Z");      #Z axis SpawnPoint
            
$Flags 128;      #Move/Reset car (128) else (0)
            
$Heading getcurrentplayervar("Heading");  #Heading of the players car at Spawnpoint
            
$UCID 0;       #Connection's unique id (0 = host)
            
$PLID getcurrentplayervar("PLID");  #Player's unique id
            
$JRRAction 4;
                
            
joinrequest($X_Axis $Y_Axis $Z_Axis $Flags ,$Heading $UCID $PLID ,$JRRAction); #Send Data to LFS
ELSE
            
privmsg("^T^7Şuan bu komutu kullanamazsın!");
ENDIF            
        BREAK;
                CASE 
"!rt":
IF ( 
ToNum(GetPlayerVar$userName"Z" )) >= 0)    
THEN                
            $X_Axis 
getcurrentplayervar("X");      #X axis SpawnPoint
            
$Y_Axis getcurrentplayervar("Y");      #Y axis SpawnPoint
            
$Z_Axis getcurrentplayervar("Z");      #Z axis SpawnPoint
            
$Flags 128;      #Move/Reset car (128) else (0)
            
$Heading getcurrentplayervar("Heading");  #Heading of the players car at Spawnpoint
            
$UCID 0;       #Connection's unique id (0 = host)
            
$PLID getcurrentplayervar("PLID");  #Player's unique id
            
$JRRAction 4;
$heading12 = (getcurrentplayervar("Heading") ;        
        IF (
getcurrentplayervar("Heading") < 0)
        
THEN
        PrivMsg
("^T^7Araç Çevirme ^2Başarılı");
        
                
        
joinrequest($X_Axis $Y_Axis $Z_Axis $Flags ,$Heading+180 $UCID $PLID ,$JRRAction); #Send Data to LFS
        
ELSE
        
PrivMsg("^T^7Araç Çevirme ^2Başarılı");
        
joinrequest($X_Axis $Y_Axis $Z_Axis $Flags ,$Heading-179 $UCID $PLID ,$JRRAction); #Send Data to LFS
        
ENDIF
        ELSE
        
privmsg("^T^7Şuan bu komutu kullanamazsın!");
        ENDIF
        BREAK;
?>

The error I mentioned at the beginning also happens when I use the following 2 commands at the same time and my insim crashes
with posting the values, i ment the value output of certain parameters.

Privmsg("X = ".$X_Axis);
Privmsg("Y = ".$Y_Axis);
Privmsg("Z = ".$Z_Axis);
Privmsg("Heading = ".$Heading);
Privmsg("PLID = ".$PLID);
Privmsg("UCID = ".$UCID);

you get the idea now.
So do you want anything from me?
Quote from arda556 :So do you want anything from me?

Bass-Driver, Lapper'ın çalışmayı durdurmasına neden olan gerçek değerlere ihtiyaç duyar. Lapper durduğunda $X_Axis'in değeri nedir? Lapper durduğunda $Y_Axis hangi değere sahip olur? Lapper durduğunda $Z_Axis hangi değere sahip olur? Lapper durduğunda $Heading değeri ne olur? Lapper durduğunda $PLID hangi değere sahip olur? Lapper durduğunda $UCID hangi değere sahip olur?

Bass-Driver needs the actual values that cause Lapper to stop working. What value does $X_Axis have when Lapper stops? What value does $Y_Axis have when Lapper stops? What value does $Z_Axis have when Lapper stops? What value does $Heading have if Lapper stops? What value does $PLID have if Lapper stops? What value does $UCID have if Lapper stops?
X = -588
Y = -93.25
Z = 20.5
Heading = 180
PLID = 30
UCID = 0
here I get a crash when I use a !rp command
Called joinrequest() on many trackconfigs while going out of bounds and also when being "retired", but i cannot reproduce the crashes.
Also tried differend Heading & Z-Axis values

-Which version of LFSLapper do you use?
-And can you show me the location on the map.
I was using 7.0.7.7.2 as a version and when I was renewing my vehicle, I was renewing it on the layout and my insim was crashing, upgrading the version seems to have solved the error and I will let you know if I encounter a problem again.
Unfortunately it is still going on
The version I am currently using is 7.0.9.0
Attached images
resim_2023-07-23_125004132.png
I do see something in your code, that could be the cause of the crashes.
Its about $Heading.

So my question to you is, to try the 'New Code'

Old Code

<?php 
IF (getcurrentplayervar("Heading") < 0)
        
THEN
        PrivMsg
("^T^7Araç Çevirme ^2Başarılı");         
        
joinrequest($X_Axis $Y_Axis $Z_Axis $Flags ,$Heading+180 $UCID $PLID ,$JRRAction); #Send Data to LFS
        
ELSE
        
PrivMsg("^T^7Araç Çevirme ^2Başarılı");
        
joinrequest($X_Axis $Y_Axis $Z_Axis $Flags ,$Heading-179 $UCID $PLID ,$JRRAction); #Send Data to LFS
        
ENDIF
?>

New Code

<?php 
IF (getcurrentplayervar("Heading") < 0)
        
THEN
        PrivMsg
("^T^7Araç Çevirme ^2Başarılı");
        
$NewHeading ToNum($Heading) + 180;
        
joinrequest($X_Axis $Y_Axis $Z_Axis $Flags ,$NewHeading $UCID $PLID ,$JRRAction); #Send Data to LFS
        
ELSE
        
PrivMsg("^T^7Araç Çevirme ^2Başarılı");
        
$NewHeading ToNum($Heading) - 179;
        
joinrequest($X_Axis $Y_Axis $Z_Axis $Flags ,$NewHeading $UCID $PLID ,$JRRAction); #Send Data to LFS
        
ENDIF
?>

The crash persists, I also think the problem is caused by the !rp command, do you think there is something wrong with my command, my code is a bit above
Don't see anything obvious.
You must do some test with the values and see cause the crashes.

FGED GREDG RDFGDR GSFDG