The online racing simulator
Searching in All forums
(446 results)
Krayy
S2 licensed
Quote from Fire_optikz001 :or kick

and as he was saying there is

<?php 
Event OnFalseStartL1
()
EndEvent

Event OnFalseStartL2
()
EndEvent
?>


in the lpr

That function reponds to a normal false start in LFS, i.e. moving before the green light. It won't allow any kind of staggered start.

The one thing I could suggest is having a physical person as a race controller. All racers would start in a "no start" group, then the race controller could move tem into a "go" group which would flash a start message on the drivers screen. This is of course would need buy-in from the racers as they would need to wait for these messages after the normal LFS start procedure.
Krayy
S2 licensed
Quote from KSheppard :Can lapper be configured to manage a multi-class start?

What I'd like is to have all the cars enabled and as an example have say 3-fxo's, 4-fox's & 4-bf1's on the track then a) have the fxo's start first - third, the fox's fourth - seventh, the bf1's eighth - eleventh b)in order as per their qualify positions within their own grouping and c) held back from starting until the previous group is a reasonable time away.

Yes I know this puts the fast cars at the back but it's the hardest so I thought I would at least ask... besides a normal qualify puts the fast cars up front - where's the fun in that

In any InSim you can only tell if a vehicle is moving, you cannot disable their controls, force brake etc and if they join the race late, then they start in the pits. Even if they do move, you have limited options as to what you can do...apply a time/drive through penalty or spec them.
Common GUI Layout & Look (Competition)
Krayy
S2 licensed
Hi guys,

Here's a chance for world-wide fame and fortune...well, okay, no fortune, and fame only within the world of LFS, but fame none the less.

The background:
After some discussions with Tim NL and fire_optikz, there is a lot of interesting deveopment going on, and I have a few "grand plans" for my own Lapper servers, that could seriously benefit from a common look & feel to make Lapper more appealing. One bugbear for me is that each contributors buttons look & feel completely different, and that causes me to either shy away from using a particular plug in or just get confused.

The challenge:
Design a GUI look & feel that can be easily adapted and used by other Lapper admins so that Lapper looks "integrated". Some guidelines to follow are:
  • It should be able to support a tab bar to access multiple screens of information
  • Text colours should be visible when the game shows darker and lighter backgrounds
  • Text should be easy to read at any resolution (ie not too small - except for the tabs)
  • It should be able to be configured for different languages
  • The entire interface should not overwrite any LFS race buttons
  • It can include infobars on top and bottom of screen
  • Add/minus buttons should act the same way as LFS (ie when using a plus button, right clicking increases a numeric by 5, left by 1)
Let your imagination run (not too) wild and let's see what we can come up with. Winner gets a beer next time they are in New Zealand
Krayy
S2 licensed
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(' ');
?>

Krayy
S2 licensed
I also found a bug that got in from one of my updates (d'oh) that migth overwrite the DefaultCar. This change needs to made to the TopGrip function.


<?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(' ');
?>

Krayy
S2 licensed
Quote from Fire_optikz001 :ye

thought so...this patch isnt for that problem..i'm still working on that
Krayy
S2 licensed
Quote from Fire_optikz001 :still dont work :|

Which part? The PM'ing?
Krayy
S2 licensed
Found a bug already...that'll pay me to read Gai-Lurons code more thoroughly.

We need to strip out any single quotes and blanks from any stored var, so the following line with the + next to it needs to be added to the storeddbs.cs file:

<?php 
        
public void LdbUpdateUserVar(string userNamestring keystring value)
        {
            
long idUserData;
            if (
userName != "")
            {
                
lockBase(); // Lock the database for write

                
userName userName.ToLower(); // Store usrename in lower case
+                value value.Replace("'""").Replace("\0"""); // Replace any invalid chars in value string
?>

Krayy
S2 licensed
Try running the attached lapper file only to see if that works.
Krayy
S2 licensed
Have you copied the RcaerArray code from the attached lapper file into your one in the right place? Also any vars that have the prefix $ra*

Entries need to be copied from OnLapperStart, OnConnect, OnDisconnect
Krayy
S2 licensed
Guys,

I did say that it was a temporary solution.

I have posted some updated code in a new thread that integrates the functions into the !who screen, as it's more to do with adding database functionality and the PM code is a result of that.

http://www.lfsforum.net/showthread.php?t=61992

Be aware that there is a lot of custom code that will need to be added to your LFSLapper.lpr file for some globals

Also, the a patch needs to be applied to the source code for 5.8.4.6, but it could most likely work in versions since 5.8.4.4.
[CODE] Replacement stored var code
Krayy
S2 licensed
Hi guys,

Well I was having a problem with the setuserstoredvalue and getuserstoredvalue functions in that the code in parseevent would only handle ints, and you were limited to storing data for the current user only.

The supplied patch will add the code to allow a lapper sub to set or retrieve a var for any user. All vars are stored as string, but can be retirevd as nums or vars using the appropriate calls. It will store these in a new DB called LapperDB.dbs. The updated functions have the syntax:

GetStoredUserNum( userName, varKey);
GetStoredUserStr( userName, varKey);
SetStoredUserVar( userName, varKey, value);
* NOTE: The userName is OPTIONAL in all of these commands and will apply to the current user if omitted. This allows setting a var for ANY user.

The other advantage of this system is that in a command that needs to track button values (like !ctrack, or the attached replacement for !who), you can use this new DB as storage space rather than setting a global var which may get overwritten by another instance of the command while you're using it. Have a look at the code in the !who command to send a PM to see how to use it. The Pitboard code could also be modified to use this.

I have also attached a copy of my base Lapper.lpr file because there is a lot of stuff in the OnConnect and OnLapperStart that the !who command relies on.

Any suggestions or questions, please post here.
NB: This patch is for version 5.8.4.6

PS: See post #7 for an update too (http://www.lfsforum.net/showthread.php?p=1277027#post1277027)
Last edited by Krayy, .
Krayy
S2 licensed
Quote from Tim NL :Hi,

I have "tim nl" with a space.

As your actual user name or as your nickname that you set in the options screen?
Krayy
S2 licensed
Thtas why I said that this initial !pm command is a temporary solution. I'll get time to wrap it nicely later. As to spaces in the username, I'm pretty sure that LFS will not let you register a username with a space in it, and nicknames are local to your client/server, so that will never be an issue.
Here's the base code...
Krayy
S2 licensed
Okay guys,

Here's the base code that I will be using, wrapped in a !pm command for you.

Add this code in the LFSLapper.lpr file in amongst the other ! commands:

<?php 
        
CASE "!pm":
            
$idxSpace indexOf$argv" ");
            
$toUser subStr$argv,0,$idxSpace );
            
$argv trimsubStr$argv,$idxSpace ) );
            
userMsg (GetCurrentPlayerVar"Nickname" ), $toUser$argv);
            BREAK;
?>

Add this code to the parseEvent.cs file just above the code for the "privmsg" command:

<?php 
                
case "usermsg":
                    {
                        
testArgs(ident"SSS"args);
                        
currInfoPlayer listOfPlayers.getPlayerByUserName((string)args[1]);
                        if (
currInfoPlayer == null)
                            throw new 
GLScript.GLApp.GLScriptException("You can't use " ident " in this context, not a player event");
                        
string text args[2].ToString();
                        if (
text == "[[TranslateEngine]]")
                            
text lfsLang.replaceParmsLangStr(currInfoPlayer.idLang);
                        
SendMsgToConnection(currInfoPlayer.UCID"^6Personal msg from: ^8" + (string)args[0]);
                        
SendMsgToConnection(currInfoPlayer.UCID"^7" text );
                        break;
                    }
?>

Use by typing in a normal text window:
!pm krayy hey there matey

Note: To use the code, you need to address it using the username, not the nickname. This won't matter when I make it a button off of the !who display
Krayy
S2 licensed
In that case:

Short answer...yes, it is possible

Long answer...yes it is possible, BUT...currently lapper has 2 messaging functions...privMsg (for messages to current racer) and globalMsg (to all racers). I mentioned your request to my team last night and they think it would be a good idea to be able to pm people, so I will create a new function to send a msg to a specific player and integrate it with the !who command (I'll put a button on the right to PM someone, then prompt for a message).

I'll hopefully post it by next week.
Krayy
S2 licensed
Already exists...search in the Lapper.lpr file for commands called privMsg to check your syntax.

Basic usage is: privMsg ( "Message_text");
Krayy
S2 licensed
Get a copy of InSimSniffer from here: http://www.lfsforum.net/showthread.php?t=60417

Run it and connect to your LFS Server, or whatever port your race is running on, and see what kind of packets are received when you do your accel test. Also in the Request menu, select TINY_NCN, which will ask all racers to report their connection details, and see if the AI cars return anything. Specifically what you're looking for is a PLID (Player ID) that matches yours and is causing the problem. If you find anything let us know.
Krayy
S2 licensed
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;

Krayy
S2 licensed
3 questions....

1. why is there a space in the directory path for "sr c", and not "src" with no spaces

2. What OS and Service Pack?

3. What version of .NET is installed
Krayy
S2 licensed
Quote from Fire_optikz001 :ok but how do i set up store values aka register?

like what is the thing i dont need u to do the whole thing just that 1 line

UserGroupFromFile( "register", "./registered.txt" );
Krayy
S2 licensed
I'll get you started, but te tack that I will take is slightly to the left of yours.

Firstly, you won't need to store the username, as I said in the other thread, as the LFS username is unique o each installation and if someone is that desperate to try and hack an LFS server, then they have more time than good sense.

The admin password is already handled in the admin usergroup functions so I can't see why you want to authenticate that twice.

The user password is another matter, but the way which it should be initiated would be more logical to call the login function from within the OnConnect function. That way, you're making it compulsory to log in each time you connect. The code below will store the user password in the storedvalues database, but I will leave it to you to figure out how to get it in there.

So to summarise....put a call to OnConnect_Login at the end of the OnConnect function in the main lapper file. This will allow the user to enter his/her password and store it in the storedvalues database in the LPassTemp entry. When you click the Login button, it will check that the LPassTemp value is the same as the store LPass value. Then you're in.

That should be enough to get you started

Sub OnConnect_Login()
$UserName = GetCurrentPlayerVar("UserName");
IF ( UserInGroup( "register", $UserName ) == 1 )
THEN
openPrivTextButton( "LPass1",50,51,25,15,5,96,"Password","Password",30,LPass);
openPrivButton( "Login",50,101,25,15,5,-1,96,"Login",Login);
ELSE
privMsg( "^1You're Not Registered");
ENDIF
EndSub

Sub LPass( $LPass )
SetUserStoredValue(LPassTemp, $LPass);
TextPrivButton( "Login","^3***********" );
EndSub

Sub Login( $KeyFlags,$id )
$userName = GetCurrentPlayerVar("UserName");
IF ( GetUserStoredValue(LPass) == GetUserStoredValue(LPassTemp) )
THEN
closePrivButton("LUser1");
closePrivButton("LPass1");
privMsg( "^2Thank You For Logging In" );
closePrivButton("LAPass");
closePrivButton("Login");
ELSE
privMsg( "Incorrect Password" );
ENDIF
EndSub

Krayy
S2 licensed
Oh, where to begin....

Firstly you are calling the UserInGroup function in both the !register and !login commands with no username. Instead of calling it like:
UserInGroup( "register" ,"Registered" )

you should probably be calling it like:
UserInGroup( "register",$UserName )

Next, in the LUser, LPass and LAPass subs, you are setting a global var to store the login/passwords which is a bit of a no-no in that anyone who runs the !login command while another is doing it might overwriet those values before they are finished with. If I were you, I would use the SetUserStoredValue and GetUserStoredValue functions to store those values in the local databse for easy retrieval later on. They can be cleared when the user logs out or disconnects, or leave them there for future reference. In fact, I would be inclined to stire them there permanently rather than trying to create a usergroup for passwords and writing it out to a text file. Syntax for those functions are:
SetUserStoredValue(LUser, $LUser);
SetUserStoredValue(LPass, $LPass);

Then they are in the storedvalues.dbs database and will be easily retreivable using:
$LUser = GetUserStoredValue(LUser);
$LPass = GetUserStoredValue(LPass);

PS: What is the LAPass setting meant to do?
Krayy
S2 licensed
Open a Windows Command window (Startmenu->run->Cmd) then type "netstat -an". See if there is any line in the output near the top that says something like:

TCP 0.0.0.0:29999 0.0.0.0:0 LISTENING

if it's there, then something is already using that port. Edit the setup.cfg in the dedicated host directory and change the port from 29999 to say 39999.

If it's not there, then the dedi server is not running, so there might be something in the Log.txt file in the server directory. Check the threads about setting up a dedi server if there are probs there.

P.S. What OS are you running?
Krayy
S2 licensed
Quote from lysergic :...<snip>Could You help me? Is this caused by 64bit system?

Looks that way...is there any options to run it in a 32 bit mode if you create a shortcut and modify the shortcuts environment?

Otherwise, see if there is a 64 bit SQLite dll avaiable for download and try copying that into the Lapper directory. Try here: http://blog.quiziqal.com/post/ ... -Vista-64-Bit-Part-2.aspx
FGED GREDG RDFGDR GSFDG