The online racing simulator
Searching in All forums
(968 results)
Gai-Luron
S3 licensed
You can insert a tarpit in your php Script and retry 5 second later.

Receive WebCmd in LFSLapper is asynchronus and don't freeze working of LFSLapper in waiting to receive web response.

Soon, LFSLapper retreive by ownself this stats values.

Gai-Luron
Last edited by Gai-Luron, .
Gai-Luron
S3 licensed
Hello,

i think there is a misunderstanding on how work http request. When you send a request to a web server LFSLapper attemps to receive a GLScript code and execute it.

Example
if i use you web call: you send a request to know if player is allowed, http("http://www.demourl.nl/lfs_plugin.php?u=". GetCurrentPlayerVar("UserName") );
and GetCurrentPlayerVar("UserName") -> "gai-luron"

web response can contain this glScript lines:

$allowed = 1;
$userName = "gai-luron";
doMyCode( $userName,$allowed );

OR

doMyCode( "gai-luron",1 );

LFSLapper interpret this GLScript code and in this code you can see you have a call to subroutine. This subroutine can be declared in lpr file.

In you lpr file tou have:
SUB doMyCode( $userName,$allowed )
... Do what you want if lpr file
IF( $allowed == 0 ) THEN
cmdlfs( "/kick " . $userName );
ELSE
privMsg("Allowed");
ENDIF

ENDSUB

And other way is to put all code in the returned webcommand
Request = http("http://www.demourl.nl/lfs_plugin.php?u=". GetCurrentPlayerVar("UserName") );

Returning web commands if allowed:

privMsg("Allowed");

Returning web commands if not allowed:

cmdlfs( "/kick gai-luron");

It's a very flexible system more than returning value inline, i hope i'am clear.

Krayy i see your code but it's not usefull when you know how webreturn work. Thank's anyway

Gai-Luron

PS: You can put any GLScript command in returned web, like top(), topuser(), etc...
Last edited by Gai-Luron, .
Gai-Luron
S3 licensed
Read and write?
Gai-Luron
S3 licensed
in my opinion XML it's not very easy to read or write by human.
Gai-Luron
S3 licensed
Hello,

i think about an config championship file and points management

And idea is

Quote :[points "poinType1"]
1 = 20
2 = 18
3 = 16
...
RelativeToPlayer = true;
[/points]

[race "1" ]
date = dd/mm/yyyy;
Time = hh:mm;
Car = XFG+XRG;
Track = SO6;
qualify = no;
[/race]

[race "2" ]
date = dd/mm/yyyy;
Time = hh:mm;
qualify = yes;
qualifyTime = 30; // in minute
Car = RB4;
Track = SO1;
points = "poinType2"; // override championship point
[/race]

[race "2" ]
date = dd/mm/yyyy;
Time = hh:mm;
qualify = yes;
qualifyTime = 30,20; // in minute
laps = 20,10;
Car = RB4,XFG;
Track = SO1,BL1;
points = "poinType2"; // override championship point
[/race]


[championship "champ1"]
title = "Firts championship";
race = "1";
race = "2";
points = "poinType1";
[/championship]

Gai-Luron
S3 licensed
- Error sorted
- Exe available on new release, sorry

Release 5.8.5.2 beta available for test purpose.

send me feedback.


+-------------------------------+
|Changes from v5.851 to 5.852 |
+-------------------------------+
1. Add new player event : OnNameChange (krayy)

2. Update SuperUser checks to include UCID 0 (dedicated server or LFS host) (krayy)

3. Update finishedpos event to return a valid number at any time as currently
it does return a number if the racer has not passed the finish line (krayy)

4. privMsg now can take 1 or 2 Arg (krayy)
1 arg, send message to current player;
example : privMsg( "myMessage");
2 arg, Send a message to a specified user
example : privMsg( "gai-luron","myMessage");

5. Fix error on SetUserStoredValue, now accept string for storing

6. Improve array performance and use of specific player array getted with GetplayerInfo
if you copy an GetplayerInfo array in another array, you get a sbapshot or a carboncopy of the original array
and not a full featured GetPlayerInfo Array.


Gai-Luron
S3 licensed
I dont understand, it's exist!
Gai-Luron
S3 licensed
Release 5.8.5.1 beta available for test purpose.

Here are the commands that I never had the time nor the courage to do. I hope they are useful for you

send me feedback.

NB: $CurrPly = GetPlayerInfo( $userName );
$CurrPly is a special array who continusly updated with correct player values
but you can't assign it to another var array using $newVar = $CurrPly;


+-------------------------------+
|Changes from v5.850 to 5.851 |
+-------------------------------+
1. Add new struct control in GLSCRIPT
FOREACH( var IN arrayVar )
....
ENDFOREACH

Whith this struct you can parse an array without knowing index
put on each iteration one element of the array arrayVar in var
var is an array containing only index "key", "value"
"key" is the key in the array
"value" is the value

Example:
Script Code

$toto[0,1,0] = "Zero,Un";
$toto[1,1,0] = "Un,Un";
$toto[1,2,0] = "Un,Deux";
$toto[2,2,0] = "Deux,Deux";
$toto[3,1,0] = "Trois,Un";
$toto[4,0,0] = "Quatre,zero";

FOREACH( $myVar IN $tata )
writeLine( "Key = " . $myVar["key" ] . " Value = " . $myVar["value" ] );
ENDFOREACH
Result on screen
Key = toto,4,0,0 Value = Quatre,zero
Key = toto,0,1,0 Value = Zero,Un
Key = toto,1,1,0 Value = Un,Un
Key = toto,1,2,0 Value = Un,Deux
Key = toto,2,2,0 Value = Deux,Deux
Key = toto,3,1,0 Value = Trois,Un

2. Add new GLScrip Function dumpVar(), to dump the content of a var to screen, debug purpose
Example
In script
$toto[0,1,0] = "Zero,Un";
$toto[1,1,0] = "Un,Un";
$toto[1,2,0] = "Un,Deux";
$toto[2,2,0] = "Deux,Deux";
$toto[3,1,0] = "Trois,Un";
$toto[4,0,0] = "Quatre,zero";
dumpVar( $toto );

print on screen:
$toto[4,0,0] = "Quatre,zero"
$toto[0,1,0] = "Zero,Un"
$toto[1,1,0] = "Un,Un"
$toto[1,2,0] = "Un,Deux"
$toto[2,2,0] = "Deux,Deux"
$toto[3,1,0] = "Trois,Un"

3. Completely rewriting array management in GLScript, now you can assign an array to a new var or array,
partially or entirely.
Example
In Script
$toto[0,1,0] = "Zero,Un";
$toto[1,1,0] = "Un,Un";
$toto[1,2,0] = "Un,Deux";
$toto[2,2,0] = "Deux,Deux";
$toto[3,1,0] = "Trois,Un";
$toto[4,0,0] = "Quatre,zero";

$tata = $toto;
$part = $toto[1];
$var = $toto[4,0,0];
$inArray[1] = $toto[1];

Result in Vars:
$toto[0,1,0] = "Zero,Un";
$toto[1,1,0] = "Un,Un";
$toto[1,2,0] = "Un,Deux";
$toto[2,2,0] = "Deux,Deux";
$toto[3,1,0] = "Trois,Un";
$toto[4,0,0] = "Quatre,zero";

$tata[0,1,0] = "Zero,Un"
$tata[1,1,0] = "Un,Un"
$tata[1,2,0] = "Un,Deux"
$tata[2,2,0] = "Deux,Deux"
$tata[3,1,0] = "Trois,Un"
$tata[4,0,0] = "Quatre,zero"

$part[1,0] = "Un,Un"
$part[2,0] = "Un,Deux"

$var = "Quatre,zero"

$inArray[1,1,0] = "Un,Un"
$inArray[1,2,0] = "Un,Deux"

4. New GLScript command getPlayerInfo( userName ), this function return an array containing all player var.
!!!!!!!SORRY!!!!!!! but this is the future command who kill the next command list in the future
Command killed in the future :-)
GetCurrentPlayerVar
GetPlayerVar
SetCurrentPlayerVar
SetPlayerVar

Set a Var with getPlayerInfo and then use it like an Array Var to retreive player var or to set player var
funny isn't it?

Example:
Event OnConnect( $userName ) # Player event
$CurrPly = GetPlayerInfo( $userName ); # Set A var for the player infos
IF( $CurrPly["userName"] != "" ) THEN # Kip Host
WriteLine( $CurrPly["userName"] ); # Retreive a player Var
WriteLine( $CurrPly["nickName"] ); # Retreive a player Var
$CurrPly["ess"] = 12; # Set a player Var
WriteLine( $CurrPly["ess"] );
ENDIF
EndEvent

Next Stage it's send to all parameter event the userName

5. New GLScript command to have the size of an array
arrayCount( array );

Example:
$toto[ 1 ] = "Un";
$toto[ 2 ] = "Deux";
WriteLine( $toto );
Result on Screen
2



Last edited by Gai-Luron, .
Gai-Luron
S3 licensed
Already discuss in thread many, many time

In file LFSLapper.lpr and in section
Quote :##################
#Drifting options#
##################

Remove /* and */ present in all event

Example remove code in red, and do for all event in this section

Quote :
/*
Event OnDriftPB() # Player event
globalRcm( langEngine( "%{main_newdriftpb}%" , GetCurrentPlayerVar("Nickname"),GetCurrentPlayerVar("DriftScore") . " ^3pts!") );
EndEvent
*/

/*
Event OnDriftPB() # Player event
globalMsg( langEngine( "%{main_newdriftpb}%" , GetCurrentPlayerVar("Nickname"),GetCurrentPlayerVar("DriftScore") . " ^3pts!") );
EndEvent
*/
...


Gai-Luron
Gai-Luron
S3 licensed
Hello,

I slow down but the last features GetListOfUsersGroup,GetListOfPlayers returning an array var change how the scripts must be writed in future and i want to release it quickly. Next features are less important on how write a script ( except GLScript command explained before, but the suppression of the obsolete command it's not for tomorrow , don't worry ).

Gai-Luron
Last edited by Gai-Luron, .
Gai-Luron
S3 licensed
Hello,

Release 5.8.5.0 beta available for test purpose.

send me feedback.

This version must be tested accurately because of change in script module to have the ability for a builtin function to return an Array.

Quote :
+-------------------------------+
|Changes from v5.849 to 5.850 |
+-------------------------------+
1 Removed hardcoded Global Variable $ListOfPlayers[index] replaced, see below

2 Add new GLScrip Function GetListOfPlayers(), return an array containing list of players connected
Example
$i=0;
$ListOfPlayers = GetListOfPlayers();
WHILE( $ListOfPlayers[$i] != "" )
... Do What you Want ...
$i = $i +1;
ENDWHILE

3 Add new GLScrip Function GetListOfUsersGroup(), return an array containing list of user sorted in a specified group
Example
$i=0;
$ListOfUsers = GetListOfUsersGroup();
WHILE( $ListOfUsers[$i] != "" )
... Do What you Want ...
$i = $i +1;
ENDWHILE

Gai-Luron
S3 licensed
Hello,

Release 5.8.4.9 beta available for test purpose.

send me feedback.

Quote :
+-------------------------------+
|Changes from v5.848 to 5.849 |
+-------------------------------+
1 Add new player var : ontrack
getCurrentPlayerVar( "onTrack") equal 1 if player is on track and 0 of not

2 Add Winner flag on OnResult using new LFS char, limited button

3 Add new GLScript function to save a group to a file
UserGroupToFile( group, file );
Example:
UserGroupToFile( "admin", "./admin.txt" );

CAUTION:
In a future release ( not released for now ) i create new Lapper function to remove some not good designed functions
Function created:
openPrivBtn in replacement of OpenPrivateButton, this new function need UserName
closePrivBtn in replacement of ClosePrivateButton, this new function need UserName
privMsg need username in this future release
privRcm need userName in this future release
privDelayedCmd in replacement of privDelayedCommand , this new function need UserName

Function removed after a while, please update you script as soon i release this modified version, because in next month i remove definitively this function
openPrivButton
closePrivButton
getCurrentPlayerVar
privDelayedCommand


Each player event receive in this future version in argument the userName who triggered this event to have the ability to use the new function

Sorry for the inconvenience, but it's better for future language extension
Last edited by Gai-Luron, .
Gai-Luron
S3 licensed
Hello,

Release 5.8.4.8 beta available for test purpose.

send me feedback.

Quote :
+-------------------------------+
|Changes from v5.847 to 5.848 |
+-------------------------------+

1 Add new Event : OnEnterPitLane( $fact )
Player Event trigerred when player enter in pit Lane
fact can be:
ENTER // entered pit lane
NO_PURPOSE // entered for no purpose
DT // entered for drive-through
SG // entered for stop-go


2 Add new Event : OnExitPitLane()
Player Event trigerred when player exit pit Lane


3 Add a Global Variable $ListOfPlayers[index] containing the list of all the players connectect to the server
when you reach the end of this list, return ""
Example:
$i=0;
WHILE( $ListOfPlayers[$i] != "" )
WriteLine( "> " . $i . " - " . $ListOfPlayers[$i] . "<");
$i = $i+1;
ENDWHILE
*******************************************************************************
PLEASE UPDATE YOUR SCRIPT TO USE THIS FEATURE INSTEAD OF $ar_user FROM PITBOARD
*******************************************************************************

4 Add new player var : wr
Return the World Record for the current track/Car for the player

5 Fix bugs in !who script and add the use of the ListOfPlayers
*******************************************************************************
PLEASE UPDATE YOUR SCRIPT TO USE THIS FEATURE INSTEAD OF $ar_user FROM PITBOARD
*******************************************************************************
6 Fix bugs in reorder



Last edited by Gai-Luron, .
Ranking System
Gai-Luron
S3 licensed
Hello,

I plain to put a ranking system into LFSLapper. Can you put here how do you imagine a ranking system? How configure it in GLScript? Etc...


Thank's for your ideas

Gai-Luron
Gai-Luron
S3 licensed
Hello,

Release 5.8.4.7 beta available for test purpose.

send me feedback for reorder feature.

Quote :
+-------------------------------+
|Changes from v5.846 to 5.847 |
+-------------------------------+

1 Add $AutoRestartOnFirstFinished = false; config var to determine if the time used
for the AutoRestartRaceSec value

2 Add new glscript command to force rotation to next track
forceRotation();

3 Fix bug on result Race

4 Remove array var $ConfVar[idOfVar] replaced by getConfigVar( idOfVar )

5 Add new command setConfigVar( idOfVar, value )
You can set some config var in event, list of config var that can be modified

adminfile,adminemail,smtpserver,loginmail,passmail,messagetime,showplayercontrol,defaulttopcar,
swearwordslist,swearwordsmax,handicapusers,swapside,autogears,shifter,helpbrake,axisclutch,autoclutch,
mouse,kbnohelp,kbstabilised,customview,votelifesec,voterestart,votequalify,voteend,autorestartracesec,
autorestartonfirstfinished,rotateeverynbraces,enablerotation,rotatetracks,rotatecars,showsplitpb,refreshqualusers,
qualusers,maxfloodlines,maxfloodlinestime,maxsessionlaps,minanglevelocity,maxnbinstunt,maxallowedlaptime1,
maxallowedlaptime2,onidletimeout1,idleexclude,onidletimeout2,gooddriftscore,minimumdriftscore,minimumdriftspeed,
minimumdriftangle,maximumdriftangle,accelerationstartspeed,accelerationendspeed,accelerationstartspeedmph,
accelerationendspeedmph,accelerationprivatemaxtime, maxfastdriveonpit,pitwindowstart,pitwindowstop,
maxcarresets,reordergrid

6 Add new config Var
$ReorderGrid
Set the automatic reoder, value can be
"WR" reorder relative to World Record
"PB" reorder relative to Server Record
"LFS" LFS config file reorder

you can modify it in setConfigVar


Gai-Luron
S3 licensed
There is not end of race in LFS. Just start new race or qualify. One reason is that a player can never pass the finish line if he want.

LFS never end a race. i hope i'am clear

Gai-Luron
Gai-Luron
S3 licensed
Hello Loco,

PrivMsg can't be use with delayed command because delayed command it's not an user event.

Gai-Luron


PS : I know, i know i speak very well english tikon
Gai-Luron
S3 licensed
Hello Loco my friend!

i see you are working with new LFSLapper! Great!

See you later on msn or Team Speak.


Bye
Gai-Luron
S3 licensed
Hello,

Import .elp file in a sqldatabase

Gai-Luron
Gai-Luron
S3 licensed
Hello,

I don't want LFSLapper work with AI because the unique key for storing value used by Lapper is username and AI have the same username. Anyway i can use nickname, but this add problem if driver change nickname for the top charlist. LFS is made for qualification and race purpose with players not AI. Sorry but it's a choice and it's mine


Gai-Luron
Gai-Luron
S3 licensed
Hello,

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

Gai-Luron
Gai-Luron
S3 licensed
Hello,

Do you use strange character in nickname or in a message? Do you use UTF8 editor?

Gai-Luron
Gai-Luron
S3 licensed
Hello,

Please give your version of lapper. Regarding the file config, i think it's an old version. If i remember this message is due to a mismatch in Timer action.

Gai-Luron
Gai-Luron
S3 licensed
Hello,

Release 5.8.4.6 avaiable

Quote :
+-------------------------------+
|Changes from v5.845 to 5.846 |
+-------------------------------+

1 ( Krayy ) Fix bug Reset some Var when race start

2 ( Krayy ) add new GLScript function
UserIsAdmin($userName);
Return 1 if true and 0 if false. Use admin.txt file to get admin
name and add UCID = 0 as admin ( console )
lpr file modified in accordance to the new function

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



Gai-Luron
S3 licensed
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
Last edited by Gai-Luron, .
FGED GREDG RDFGDR GSFDG