The online racing simulator
What version of Lapper are you running?

If you are using the latest version of Lapper, here are the answers for question 1 and 3:

Your 1st question (shutdown server and password it) can be done using "RegisterScheduleAction" which can be found in the "Event OnLapperStart()" section.

You should be looking for "Event OnPB( $userName )" to solve your 3rd question.
After finding that event, make sure you set it like this:


/*
Event OnPB( $userName )
EndEvent
*/

This will disable the whole event.

I can't answer the other question as my Lapper code knowledge is too rusty at the moment.
thanks
I don't understand much code I found the place for race event but I don't no where to place server password when it closes and is this what I need to change for event

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
if so which bit ie what does the SA_mid mean
I have the following code for server management on my own servers:


#Syntax: ss mm hh dayofweek dd MM YYYY

RegisterScheduleAction( "0 0 0 * 3 7 * ", Pw_change );
RegisterScheduleAction( "0 0 0 * 4 7 * ", Track_change );
RegisterScheduleAction( "0 1 0 * 4 7 * ", Track_change_2 );
RegisterScheduleAction( "15 1 0 * 4 7 * ", Track_change_3 );

Sub Pw_change()
cmdLFS("/pass justsomething");
cmdLFS("/qual 15");
cmdLFS("/canreset no");
EndSub

Sub Track_change()
cmdLFS( "/rcm ^1Track/car(s) will be changed in 1 minute^8" );
cmdLFS( "/rcm_all" );
EndSub

Sub Track_change_2()
cmdLFS("/pass tmp");
cmdLFS("/reinit");
EndSub

Sub Track_change_3()
cmdLFS("/track SO1R");
cmdLFS("/cars UF1");
cmdLFS("/laps 43");
cmdLFS("/qual 240");
cmdLFS("/pass anything");
cmdLFS("/canreset yes");
EndSub

On 00:00 at raceday the password is changed.
On the next day the server is set for next weeks race.
This method needs you to change the date everyweek and then restart Lapper, so after having done that a couple of months, I have build a system to do it automaticly.


Event OnLapperStart()
RegisterScheduleAction( "0 0 0 * * * *", Reinitialise_server_1 );
RegisterScheduleAction( "30 0 0 * * * *", Reinitialise_server_2 );
RegisterScheduleAction( "0 1 0 * * * * ", Track_check );
RegisterScheduleAction( "0 2 0 * * * *", Schedule_trackcheck );

initAddons();

OnLapperStart_Set_Schedule();
EndEvent

Sub Reinitialise_server_1()
cmdLFS( "/msg ^1Server will be reinitialised in 30 seconds^8" );
EndSub

Sub Reinitialise_server_2()
cmdLFS("/reinit");
EndSub

Sub Track_check()
cmdLFS( "/msg ^1In 1 minute the selected Track/car(s) will be ...^8" );
cmdLFS( "/msg ^1... checked and changed if needed^8" );
EndSub

For this code to work, you will also need a module to enter and one to display a set schedule, which I have included in this post as well.
The files are renamed from *.lpr to *.txt , to be able to upload them here.

You also have to add these lines into the addonsused.lpr file:

include( "./schedule_2.lpr");
include( "./schedule_set.lpr");
Attached files
schedule_set.txt - 81.3 KB - 283 views
schedule_2.txt - 28.8 KB - 293 views
Oi. I fired up the latest version on my 0.6B4 server and got this. I checked LFSLapper.lpr and the includes folder, but it doesn't seem to work for me. I briefly read through the LFSLapper.lpr file and everything seems right. Crap.
Attached images
lfs_00000132.jpg
Have you tried to change some of the text in the LFSLapper.lpr file?

This is the sort of thing that happens if you miss a semi-colon and stuff.

Anyway, navigate to your LFSLapper directory, then /bin directory, then /default directory, then /logs directory (sits beside the /includes directory).

There you'll find at least 2 error log files; one ending in -ERR.log, the other -MSS.log.

(If you have 2 of each type, that will mean you'll have one pair for your server address, and one pair for your home (127.0.0.1) pc.

Open up the -ERR.log file.

Likely that 'lapper' will have said which file, and line therein where your error lies.

Error example line:
Quote :
6/26/2011 11:19:26 PM -> Syntax error in cfg file "./lfslapper.lpr" at line #144 Command 'RegisterZoneAction' incorrect number of parameter Function 'onlapperstart./lfslapper.lpr-1' script aborted

If you can't see an error in that line, look to see you have a semi-colon at the end of the previous line.

If you still can't see an error, look at the language files at the bottom of the LFSLapper.lpr file (assuming that's where the error log says the error is).

As an example, you may have a line such as;


<?php 
    openPrivButton
"label_lfslogo",5,181,21,4,1,-1,128,langEngine"%{label_lfslogo}%" ));
?>

and in the language part of the file (search for label_lfslogo after the line LANG "EN") and it may have something like


<?php 
label_lfslogo 
"^7powered by ^3LFSLapper";
?>

Make sure there's a semi-colon at the end of the line. More importantly, make sure the line just before that also has a semi-colon at the end (that's where I usually have mistakes).

If you still can't see where the error in the programming is, then save your LFSLapper.lpr file as a .txt file, and zip that up along with your error message and post it here.

Make sure you remove any passwords or your $PubStatIdk id if you've added it.

(PS - there's 2 /logs directories made when you install lapper - make sure you navigate to the one I gave instructions for).

Good luck.
I don't know what happened, I was tabbing back and forth and must of deleted something in between. It's okay though, I just downloaded a fresh copy, and it seems to be working now.

Thanks for the help!
Could someone explain me what this error means and how to fix it.

9/16/2012 1:43:46 PM -> Warning packet not catched (55)

thx
Quote from Bass-Driver :Could someone explain me what this error means and how to fix it.

9/16/2012 1:43:46 PM -> Warning packet not catched (55)

thx

It means that Lapper received a packet from the LFS server via InSim that it does not understand, i.e. a handler has not been written for it yet

Things that were introduced in InSm 6 will do this like IS_CON (contact), IS_OBH (object hit) or IS_HLV (hotlap validation).

its informational rather than critical

P.S. Insim message 55 is ISP_ACR, // 55 - info : admin command report (someone tried to run an admin command when they do not have admin rights)
Does Lapper need an update when the new LFS patch comes out, or shouldn't that cause any troubles?
Quote from Yisc[NL] :Does Lapper need an update when the new LFS patch comes out, or shouldn't that cause any troubles?

The devs guarantee backwards compatibility (as far as I know anyway), so future point updates to LFS should not require Lapper to be updated.

That being said it does require updates to support InSim features that get modified or implemented.
Conflict with Airio and LFSLapper Commands
I have Airio and LFSLapper running on 3 servers on 500 servers. I have successfully installed both of the above applications and would be happy except that since I have finally figured out how to get lapper to work, the problem I am encountering is that when you type for example !pb both of the gui's for both apps load, and if you type for example !help, both help windows open up.

Now, I admit I don't understand the coding necessarily for either, but, I am hoping that I can have a solution to have only one of the to respond to certain commands.

I am not sure whether people are using both Airio and LfsLapper concurrently or they have chosen one over the other?

Can someone point me in the right direction?

Thanks
-
(Bass-Driver) DELETED by Bass-Driver : found a solution
hi
i have a issue with saving values to the database and showing them in the toplist


CASE "!dplist":
SetPlayerVar($userName , "DerbyPoints" , ToNum(GetStoredValue($userName. "DPTotal") + 5));
SetStoredValue($userName . "DPTotal" , GetPlayerVar($userName,"DerbyPoints"));
privmsg(GetPlayerVar($userName,"DerbyPoints") ."/".GetStoredValue($userName . "DPTotal"));
topUser( "DP System","DPTotal","DESC",argv );
BREAK;

i cant see what i do wrong.
use getStoredNum (defaults to -1 if doesnt exists ) instead of getStoredvalue (returns a NULL) to ensure that you are returning a valid numeric. e.g.



<?php 
CASE "!dplist":
    
# Get default value if not already defined
    
$DPTotal GetStoredNum($userName"DPTotal");
    IF( 
$DPTotal == -THEN
        $DPTotal 
5;
    ENDIF
    
# Now set it in player
    
$DPTotal $DPTotal 5;

    
SetPlayerVar($userName "DerbyPoints" $DPTotal);     
    
SetStoredValue($userName "DPTotal" $DPTotal);
    
privmsg(GetPlayerVar($userName,"DerbyPoints") ."/".GetStoredNum($userName "DPTotal"));
    
topUser"DP System","DPTotal","DESC",argv );
BREAK;

?>

nope toplist is still empty
heres a peace of code



WHILE($PointsMax >= 1)
$Racers = getListOfPlayers("N");
FOREACH( $maVar IN $Racers )
IF(GetPlayerVar($maVar["value"],"JoinedDerby") == "1")THEN
IF(GetPlayerVar($maVar["value"],"Pointsrun1") == $PointsMax)THEN

$DBTotal = GetStoredNum($maVar["value"]. "DPTotal");
$DBTotal = $DBTotal+$PointsMax;
SetStoredValue($maVar["value"] . "DPTotal" , $DBTotal);

SetPlayerVar($maVar["value"], "JoinedDerby","0" );
openGlobalButton( "name_" . $maVar["value"],$point_L,$point_T+1,21,4,3,-1,96,"^7" . GetPlayerVar($maVar["value"],"NickName") );
openGlobalButton( "ontrack_" . $maVar["value"],$point_L+21,$point_T+1,6,4,3,-1,32,"^3" . GetPlayerVar($maVar["value"],"Pointsrun1"));
$point_T=$point_T+4;
ENDIF
ENDIF
ENDFOREACH
$PointsMax=$PointsMax-1;
ENDWHILE

One thing I can say is that with lapper scripts you really need to do a lot of bounds testing, such as when you do the GetPlayerVar(Pointsrun1), you need to be very sure that you test the output to make sure that it returned a valid Number, othersie the DBTotal additions will fail. You can use the IsNum function to test that.


<?php 
WHILE($PointsMax >= 1)
    
$Racers getListOfPlayers("N");
    FOREACH( 
$maVar IN $Racers )
        IF (
GetPlayerVar($maVar["value"],"JoinedDerby") == "1"THEN
        $thisPointsrun 
GetPlayerVar($maVar["value"],"Pointsrun1");
            IF ( 
IsNum($thisPointsrun) == TRUE THEN
                
IF ($thisPointsrun == $PointsMaxTHEN
                    $DBTotal 
GetUserStoredNum($maVar["value"], "DPTotal");
                    
$DBTotal $DBTotal+$PointsMax;
                    
SetUserStoredValue($maVar["value"], "DPTotal" $DBTotal);

                    
SetPlayerVar($maVar["value"], "JoinedDerby","0"  );
                    
openGlobalButton"name_" $maVar["value"],$point_L,$point_T+1,21,4,3,-1,96,"^7" GetPlayerVar($maVar["value"],"NickName") );
                    
openGlobalButton"ontrack_" $maVar["value"],$point_L+21,$point_T+1,6,4,3,-1,32,"^3" GetPlayerVar($maVar["value"],"Pointsrun1"));
                    
$point_T=$point_T+4;
                ENDIF
            ENDIF
        ENDIF
    ENDFOREACH
    
$PointsMax=$PointsMax-1;
ENDWHILE
?>

ofcourse i tested this with a debug message ( i just removed that line in the code/post below)

globalmsg($PointsMax."/".$DBTotal);

And the output was correct.
i go futher testing

i go putt the IsNum testcode into my codehelp file
hi
Lapper crashed in a Server with 19 guests. it tries to reboot but crashed again

It seems that lapper cant reboot in a server with more than 10+ people
it just load 8 users and than lapper crashed and it crashed again.

checking my MSS file i see the following lines:

12/1/2012 1:04:44 PM -> Parsing config file...12/1/2012 1:04:44 PM -> Warning ".\default/./includes/const.lpr" doesn't exist!
Ok
12/1/2012 1:04:44 PM -> Loading WR...Not Loaded
12/1/2012 1:04:44 PM -> Loading swearwords...Ok
12/1/2012 1:04:44 PM -> Connecting to 10.0.0.17 / 30000
Connection OK
1-12-2012 13:04:44 -> InSImReceive Thread Started...
12/1/2012 1:04:44 PM -> Product:S2 Version:0.6E InSim Version:5
1-12-2012 13:04:44 -> Ftp Upload grip DB Thread Started...
1-12-2012 13:04:44 -> Ftp Upload drift DB Thread Started...
1-12-2012 13:04:45 -> Web Commands Thread Started...
12/1/2012 1:04:45 PM -> LFSLapper is running...
1-12-2012 13:04:45 -> -----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
PubStat Thread Started...
12/1/2012 1:04:45 PM -> Warning packet not catched (117)
12/1/2012 1:04:45 PM -> Warning packet not catched (106)
12/1/2012 1:04:46 PM -> Warning packet not catched (51)
12/1/2012 1:04:46 PM -> Warning packet not catched (98)
12/1/2012 1:04:48 PM -> Warning packet not catched (115)
12/1/2012 1:04:49 PM -> Warning packet not catched (55)
12/1/2012 1:04:49 PM -> Warning packet not catched (80)
12/1/2012 1:04:49 PM -> Warning packet not catched (MST)

ERR file:
12/1/2012 1:28:26 PM

Lapper Instance 10.0.0.17/30000 abort!

Doelmatrix is niet lang genoeg om alle items in de verzameling te kopiëren. Controleer de index en de lengte van de matrix.
mscorlib
bij System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
bij System.BitConverter.ToInt32(Byte[] value, Int32 startIndex)
bij InSim.Decoder.STA..ctor(Byte[] packet)
bij LFSLapper.LFSClient.Loop(Connect insimConnection)
bij LFSLapper.LFSClient.doloop()
bij LapperInstances.LapperInstance.doConnection()
Void ThrowArgumentException(System.ExceptionResource)
Closing Instance...
Attached images
lfslapper error.png
Lapper (5.846) keeps crashing on my demo servers with the following error.
This problem started after upgrading LFS to 0.6C/D/E and isn't happening on my S2 servers:

12/1/2012 3:11:31 PM

Lapper Instance 127.0.0.1/29982 abort!

De index ligt buiten de matrixgrenzen.
LFSLapper
bij InSim.Decoder.pakGetByte(Byte[] pak, Int32 first)
bij InSim.Decoder.NPL..ctor(Byte[] pak)
bij LFSLapper.LFSClient.Loop(Connect insimConnection)
bij LFSLapper.LFSClient.doloop()
bij LFSLapper.LFSListen.Listen.goWorkMode()
bij LFSLapper.LFSListen.Listen.start()
Int32 pakGetByte(Byte[], Int32)
Closing Instance...
My lapper (V6.012) is working on my Sin'rs host, and has not had any problems during any of the recent host upgrades (0.6C/D/E).
Right, the problem of Lapper (5.846) crashing isn't only happening on Demo servers.
Tonight Absolute-Beginners.nl has their racing night on one of my S2 server, and the crashes appear there too.
I've attached the log file.
Attached files
lapper_5846.txt - 11.6 KB - 329 views
can you reboot in a full server without crashing??
Quote from Bass-Driver :can you reboot in a full server without crashing??

I can restart Lapper, but it crashes immediatly again.
It has something to do with with more then X people being connected at the same time, since the problem isn't happening when only a few people are on a server.
Quote from Yisc[NL] :I can restart Lapper, but it crashes immediatly again.
It has something to do with with more then X people being connected at the same time, since the problem isn't happening when only a few people are on a server.

you have the same issue as me
with more than 8 people in the server , lapper will crash

and also it crash randomly ,:S
few min ago my 2nd lapper crashed.

Edit: added some files
Attached files
ERR1.txt - 2.5 KB - 274 views
MSS1.txt - 151 KB - 279 views
@Gai-Luron:

This morning I had another Lapper crash, this was logged by Lapper:

12/5/2012 6:35:15 AM

Lapper Instance 127.0.0.1/29991 abort!

De index ligt buiten de matrixgrenzen.
LFSLapper
bij InSim.CodePage.GetString(Byte[] pack, Int32 offset, Int32 len)
bij InSim.Decoder.pakGetString(Byte[] pak, Int32 first, Int32 len)
bij InSim.Decoder.MSO..ctor(Byte[] packet)
bij LFSLapper.LFSClient.Loop(Connect insimConnection)
bij LFSLapper.LFSClient.doloop()
bij LFSLapper.LFSListen.Listen.goWorkMode()
bij LFSLapper.LFSListen.Listen.start()
System.String GetString(Byte[], Int32, Int32)
Closing Instance...
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
12/5/2012 7:00:39 AM

Lapper Instance 127.0.0.1/29991 abort!

Doelmatrix is niet lang genoeg om alle items in de verzameling te kopiëren. Controleer de index en de lengte van de matrix.
mscorlib
bij System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
bij System.BitConverter.ToInt32(Byte[] value, Int32 startIndex)
bij System.BitConverter.ToUInt32(Byte[] value, Int32 startIndex)
bij InSim.Decoder.pakGetUnsigned(Byte[] pak, Int32 first)
bij InSim.Decoder.RES..ctor(Byte[] packet)
bij LFSLapper.LFSClient.Loop(Connect insimConnection)
bij LFSLapper.LFSClient.doloop()
bij LFSLapper.LFSListen.Listen.goWorkMode()
bij LFSLapper.LFSListen.Listen.start()
Void ThrowArgumentException(System.ExceptionResource)
Closing Instance...

-----------------------------------------------------------------------------

The console showed the following error:

Error in SMALL TypeSmall valus is 38, reset to 0
Hello,

it's seem that some packet sent by LFS are corruptep. The better way is to send a report to Scawen. A guy say Airio seem to have same issue.

Are you in UDP or TCP mode?

Bye

Gai-Luron
This thread is closed

Config help
(1112 posts, closed, started )
FGED GREDG RDFGDR GSFDG