The online racing simulator
Bug Reports
(207 posts, closed, started )
Quote from Krayy :The problem that you are experiencing looks to me like its due to latency in the lapper code itself. The doCountDown function subtracts the current time in seconds from the predicted button visible time in seconds then updates the text. The problem is that when doing time subtractions in seconds, there is some rounding going on that may cause the function to skip a second. So if you open the button the first time at 3.9 second past the minute, the text wont update till at least 1 second has passed. If the code gets executed 1.2 seconds later, then you are now at 5.1 seconds past the minute. Second 4 has effectively disappeared. This time slip will be cumulative, so I would suspec that if you have a button counting down from 20 or 30, you would see 3 or 4 numbers missed. Give it a test if you can and see what the outcome is.

So the problem could occur at any time, not just for the second number. It also depends on several other factors, like how many buttons are visible, how many of them are countdowns, and if lapper is doing some other things as well.

One possible fix may be to do the time subtractions in milliseconds rather than seconds to make it more accurate. Other things we could is to go through the code and do some tuning to see if the number of system calls, functions and other bits around the countdown stuff can be made faster.

hmm that makes me wonder why can we do that kind of thing with drift? update every millisecond rather then after drift?
Quote from Krayy : One possible fix may be to do the time subtractions in milliseconds rather than seconds to make it more accurate. Other things we could is to go through the code and do some tuning to see if the number of system calls, functions and other bits around the countdown stuff can be made faster.

I can tell you for a fact, that my lapper.lpr file is a complete mess - full of lines starting with a #

Some ideas I've implemented, and gave up on, or changed, or moved, or testing, etc. Not forgetting the sub-routines that go with these, and are left cluttering up the place.

One day, when it's no longer a WIP!

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

Countdown with larger number - tried a few, and hit and miss, but it misses at least 1 second, but more normally 2.
(20,18,17,16....)
Found a slight bug which was enough to stuff up my car reset stuff.

In the ListPlayers.cs file, there is a function called "RaceRestart" which is meant to zero out a number of race related values for each player. Some values aren't included in the reset code like the ones below:

(currInfoPlayer as infoPlayer).bestSpeed = 0;
(currInfoPlayer as infoPlayer).currSplit = 0;
(currInfoPlayer as infoPlayer).currVote = (int)InSim.vtn.VOTE_NONE;
(currInfoPlayer as infoPlayer).drivethroughcount = 0;
(currInfoPlayer as infoPlayer).finishedPos = 0;
(currInfoPlayer as infoPlayer).lapTime = 0;
(currInfoPlayer as infoPlayer).lastSplitTime = -1;
(currInfoPlayer as infoPlayer).maxLapSpeed = 0;
(currInfoPlayer as infoPlayer).pitTime = 0;
(currInfoPlayer as infoPlayer).racePBTime = 0;
(currInfoPlayer as infoPlayer).raceTotalTime = 0;

Also, the patch below will update the parseEvents.cs file to always return a valiue for the "finishedpos" variable (as peviously it only returned a value if the user had actually finsihed a race), and also adds a new GL function "userisadmin". This is to allow all admin functions to work if the UCID of the user is 0, which is the host. To use this, replace any IF clause in your lapper file that uses 'UserinGroup("admin", $userName)', with 'UserIsAdmin($userName)', Like this:

CASE "!ban":
IF ( UserIsAdmin( $userName ) == 1 )
THEN
privMsg ( langEngine( "%{main_ban}%", GetCurrentPlayerVar( "Nickname" ), GetPlayerVar( $argv, "Nickname" ) ) );
cmdLFS ( "/ban " . $argv . " 1" );
ENDIF
BREAK;

PS: If you do use this function to determine Admin status, you can then comment out the UserGroupFromFile( "admin", "./admin.txt" ); function in the oNmso event so that you're not reading in that file and populating the admin group stuff every time you do any Lapper command.
Attached files
krayy_parseevent_patch.txt - 1.8 KB - 264 views
Hello,

I apply your modification on SVN repository. Get the freshen file. I Add a new config Var

Quote :Add $AdminFile in LFSLapper.lpr file to specify what file is used
for UserIsAdmin function


<?php 
#################
#General options#
#################

$AdminFile "./admin.txt"# Name of the file containing admin lfsname player
...
?>


Thank you

Gai-Luron
Dang,

I should have double checked the RaceRestart variables I pasted here...I made an error with FinishedPos. it should be -1, not 0:

(currInfoPlayer as infoPlayer).finishedPos = -1;

Also, in the ParseEvent.cs file, the code to return the finishedpos var needs to be changed slightly, else it won't return a value:

case "finishedpos":
val.typVal = GLScript.typVal.num;
val.fval = (float)currInfoPlayer.finishedPos + 1;
break;

Hey Guys
Web Commands Thread Started...
9/28/2009 10:37:30 PM -> Connection unavailable or lost on 127.0.0.1/17468, retry in 1mn
9/28/2009 10:37:30 PM -> Connecting to 127.0.0.1 / 17468
Connection OK
9/28/2009 10:38:27 PM -> Connecting to 127.0.0.1 / 17468
Connection OK
9/28/2009 10:40:25 PM -> Connecting to 127.0.0.1 / 17468
Connection OK

i dont get what this means :/ could someone help please..

Thanks Tur8o
Hello,

LFS try, in accordance to your host file, to connect on your localhost port 17468 and can't

Gai-Luron
I found a bug that got in from one of my updates (d'oh) that can overwrite the DefaultTopCar. This change needs to made to the TopGrip function so it will not overwrite teh CarName if it has already been set:


<?php 
Index
cmdLapper.cs
===================================================================
--- 
cmdLapper.cs    (revision 12)
+++ 
cmdLapper.cs    (working copy)
@@ -
96,+96,11 @@
 
             
infoPlayer currPly listOfPlayers.getPlayerByUCID(UCID);
 
+            if (
carName == "" && currPly.CName != ""// Set default car to current car if no default set in the lapper config
+            {
+                
carName currPly.CName;
+            }
+
             
closeAllTop(currPly);
 
             
string[] splitCmd cmd.Split(' ');
?>

Hi Gai,
You have broke the GetCurrentPlayerVar("UNameBefore") in the version you sent me. The GetCurrentPlayerVar("UNameBehind") works fine.
Hello,

Okay, my mistake, i fix for the next Release. It's a lowercase case issue in N

use for Now before my next release ( soon )

GetCurrentPlayerVar("UnameBefore") the N is in wrong Lowercase in you LFSLapper beta version.

Sorry!

Gai-Luron
Hi Gai,
Can you check...
SUB TRI_split1_0($UserName) # Player EVENT
SUB TRI_split1_1($UserName) # Player EVENT
SUB TRI_split1_2($UserName) # Player EVENT

as I am getting errors from it....
Syntax error in cfg file: Number of function argument not matche at line #1363 in function 'tri_split1_2' script aborted
SUB TRI_split1_2 it's your add, do you define it and where. it need username in args


Sub TRI_split1_0( $userName ) # Player event
globalMsg( langEngine( "%{main_great1}%", NumToMSH(GetCurrentPlayerVar("SplitTime")),GetCurrentPlayerVar("Nickname") ) );
EndSub

Sub TRI_split1_1( $userName ) # Player event
globalMsg( langEngine( "%{main_good1}%",NumToMSH(GetCurrentPlayerVar("SplitTime")),GetCurrentPlayerVar("Nickname") ) );
EndSub

Sub TRI_split2_0( $userName ) # Player event
globalMsg( langEngine( "%{main_great2}%", NumToMSH(GetCurrentPlayerVar("SplitTime")),GetCurrentPlayerVar("Nickname") ) );
EndSub

Sub TRI_split2_1( $userName ) # Player event
globalMsg( langEngine( "%{main_good2}%",NumToMSH(GetCurrentPlayerVar("SplitTime")),GetCurrentPlayerVar("Nickname") ) );
EndSub

Sub TRI_split3_0( $userName ) # Player event
globalMsg( langEngine( "%{main_great3}%", NumToMSH(GetCurrentPlayerVar("SplitTime")),GetCurrentPlayerVar("Nickname") ) );
EndSub

Sub TRI_split3_1( $userName ) # Player event
globalMsg( langEngine( "%{main_good3}%",NumToMSH(GetCurrentPlayerVar("SplitTime")),GetCurrentPlayerVar("Nickname") ) );
EndSub

Sub TRI_lap_0( $userName ) # Player event
globalMsg( langEngine( "%{main_greatlap}%",NumToMSH( GetCurrentPlayerVar("LapTime") ), GetCurrentPlayerVar("Nickname" ) ) );
EndSub

Sub TRI_lap_1( $userName ) # Player event
globalMsg( langEngine( "%{main_goodlap}%", NumToMSH( GetCurrentPlayerVar("LapTime") ), GetCurrentPlayerVar("Nickname") ) );
EndSub

Hi Gai, I added.......
Split1Action = TRI_split1_0:TRI_split1_1:TRI_split1_2
Split2Action = TRI_split2_0:TRI_split2_1:TRI_split2_2
Split3Action = TRI_split3_0:TRI_split3_1:TRI_split3_2
LapTimeAction = TRI_lap_0:TRI_lap_1:TRI_lap_2
to Trackinfo.cfg and it worked, it was a long time ago and don't think I defined it anywhere.

EDIT: Found it Gai it was my points system causing the issue, sorry.
Hi Gai,
Can you take a look at the CPU Usage before running Lapper and then while running Lapper. After a Lapper crash it seems to be causing 100% CPU Usage after closing it down and restarting.

CPU Usage: My Server after a reboot with LFS Running....


CPU Usage: My Server after a reboot with LFS & Lapper running....


Will add screenshot after lapper crash to show CPU Usage locked at 100% after it happens and will attach error log.
Attached images
Lapper_01.jpg
Lapper_02.jpg
Hello,

The crash is not a CPU usage's consequence but CPU usage is crash's consequence. When LFSLapper crash, C# release all memory, release all thread , then it restart and C# allocate all things. This is why the 100 cpu usage.
Normaly, the cpu usage slow down after reload of lapper


Gai-Luron
Hi Gai, it remains at 100% until you reboot the machine. I left it overnight after a Lapper crash and in morning it was still at 100%. I rebooted machine and CPU was at 1-2% then started LFS and Lapper which took it up for 30 seconds and then its went back to 2-4% until it crashed. The crash has to be a Stack Type empty crash where Lapper tells you to look in the log within the dos screen.

I will try and reproduce the crash. and save all logs to show you.
Quote from Andy King :Hi Gai, it remains at 100% until you reboot the machine. I left it overnight after a Lapper crash and in morning it was still at 100%. I rebooted machine and CPU was at 1-2% then started LFS and Lapper which took it up for 30 seconds and then its went back to 2-4% until it crashed. The crash has to be a Stack Type empty crash where Lapper tells you to look in the log within the dos screen.

I will try and reproduce the crash. and save all logs to show you.

:P it dont do that for me i think it might be ur pc :P
Hello,

Take a look on what is the process who take 100% of cpu. Take a look also in your script if there is an infinite loop in one of this. In next release i can try to make an timeout on each event or sub to limit this crash possibility.

Without the log for view the error, i can't do anything

Gai-Luron
Quote from Fire_optikz001 ::P it dont do that for me i think it might be ur pc :P

I reinstalled the OS on my server on Tuesday because evalution period expired lol and it was still doing it yesterday. Also Dean from 500Servers told me about the CPU usage because I said my Servers hosted with him were laggy so it was him that put me onto it.

I may have a loop Gai but if I reboot my local Server and start my Testing LFS and Lapper and connect and use it it's all fine until I make an error scripting and it crashes then I can't even start Lapper for a while as it just comes up with DOS screen and no version number etc etc. I have to wait maybe 2 - 3 minutes before it will start properly and connect.

I haven't had time to make it crash but will try when I get in from work.
Hello,

Take a look if it crash if LFSLapper.exe still running looking at process. Because you think lapper is crashed but it is in infinite loop and work. In this case it can take 100% cpu and second Lapper started take very much time to start because .NET is very busy with the first one.

i hope this can help you!

Gai-Luron
Hi Gai,
Can you take a look at posabs as it doesn't seem to be working.
Hi Gai,
v5.9.0.3RC end pit message says can't find "id main_pit notfound" and I don't use the language files so it must be hard coded or something. Anyway thats the message received making a pitstop.
if i remember it is in one include, defpit.lpr. you must add in this file the part of lang definition used

Gai-Luron
Quote from Andy King :Hi Gai,
Can you take a look at posabs as it doesn't seem to be working.

Hi Gai, any ideas on why its not working.
DefaultTopCar not set correctly


Gai-Luron
This thread is closed

Bug Reports
(207 posts, closed, started )
FGED GREDG RDFGDR GSFDG