The online racing simulator
Live Timings For LAN
(16 posts, started )
Live Timings For LAN
Hi all

[I dont know if this is the correct thread to place this in and Iv search topics for what im looking for but Im not sure if im looking in the right places / and viewing the right topics in the search. Please dont flam me for this Unnessacey thread if you think it is and I am very sorry.]


Me and a few mates have a LFS LAN Party. I was wondering if there was any way i could display Live Timings on a different Computer (if this were possable).

thanks in advance for any infomation
Like the F1 timeing and scoring screen? Because it's possible, some sites are doing it, but it's always for a internet game. I can be done on a LAN, and would be of better quality over all, but no one has done that yet.
Quote from Dygear :Like the F1 timeing and scoring screen? Because it's possible, some sites are doing it, but it's always for a internet game. I can be done on a LAN, and would be of better quality over all, but no one has done that yet.

yes like the f1 timing/ scoring screen.

wish i could progarm, as i would have ago but i anit that good

thank you for your info anyways
This is exactly what I am looking for, but I need it to work for a dedicated server rather than a lan game. I just want a real-time(or close to real-time) display of current positions, current lap times, best lap times, splits etc. Preferably outputting to a html file, but not essential, any help is much appreciated.
I just started thinking how to do this on a very fundamental level. Really, all that would be needed is Remote Access to the Server. So we could use the resources already available to us, and the bandwidth available to us from the LFS World website to get this data to each of the users. Then all you really need is a web client that will parse the split information into a table format, and seeing as the code, and the peusdo code for this has already been released the only thing is missing is a way to update this information on the client side, when you consider that the client is pretty much always going to be a static interface (such as a HTML webpage).
How about JSON output?

{
"track": "AS6R",
"splits": {
"sp1": 42.98,
"sp2": 44.38,
"sp3": 23.22,
"lap": 31.34
}
"drivers": {
1: {
"PName": "^1(E^4AGL^3E)^9Dygear",
"UName": "Dygear",
"lapNb": 25,
"Car": "FO8",
"sp1": 42.98,
"sp2": 44.46,
"sp3": 23.22,
"lap": 31.94
}
2: {
"PName": "^2FLP|^9filur",
"UName": "filur"
"lapNb": 25,
"Car": "FO8",
"sp1": 43.02,
"sp2": 44.38,
}
"splits": {
1: {
"driver": 2,
"sp1": 43.56,
"sp2": 44.38,
}
2: {
"driver": 1,
"sp1": 43.98,
"sp2": 44.46,
"sp3": 24.12,
"lap": 31.54
}
}

The JavaScript code can then just update the table based off the information present in the JSON update.
Thanks for the info! I'm pretty new to this type of programming. I could probably manage the JSON parsing quite easily, but I'd have no idea how to actually generate the JSON file. I'd only be using this on my own server if that helps at all. I'm up for a challenge, but could you possibly give me some more info on how to generate the JSON file?

Thanks a lot.
The JSON format it's self is just an idea on how to handle this information.

Some one has to make a 'service' that will allow you to get information like this. The JSON format has not be implemented by me because I've not even gotten close to making parsing of InSim packets on this high of a level, and this actually ticks me off quite a large amount. The community could learn alot from the AMX Mod X community but everyone is running around like a headless chicken right now. But I digress.
Again thanks for the reply. Surely it wouldn't be that hard to get the info from the server. I was having a play with LFS Statsthe other day, and I had it running on my laptop, while racing on my pc, and every time someone went through a split, or a lap, the info would pop up on the Stats console, but it doesn't output the info to a file until the end of the race. If I was able to output it every time an event occurred, then only the web parsing would need to be done. The only thing is, is that I have no idea how I would go about outputting every event from LFS Stats.
Quote from MirageJ :Again thanks for the reply. Surely it wouldn't be that hard to get the info from the server. I was having a play with LFS Statsthe other day, and I had it running on my laptop, while racing on my pc, and every time someone went through a split, or a lap, the info would pop up on the Stats console, but it doesn't output the info to a file until the end of the race. If I was able to output it every time an event occurred, then only the web parsing would need to be done. The only thing is, is that I have no idea how I would go about outputting every event from LFS Stats.
  • Split Times (SPX, LAP)
    Get the Time - STime (SPX) or LTime (LAP).
  • Race Restart (RST)
    Clear the whole Splits Array.
  • Client Connected (NCN)
    To add their client data to the drivers array. (UName, PName, & UCID)
  • Clent Left (CNL)
    Remove the client from the drivers array & remove any times they set in the splits array.
  • Client Renames (CPR)
    Update their drivers array to reflect the new PName.
  • Client Takeover (TOC)
    Update the drivers array to reflect the new UName and PName in the Car.
  • Client Joins (NPL)
    Very important for attaching PLIDs to UCIDs also get's their number plate (Plate), car name (CName) the tyre compounds (Tyres) and any handicaps that might have (H_Mass & H_TRes).
  • Client Parcs (PLP)
    Client Enters Pit to Change Car Settings (Client is Park'ed In Pit Stool) In a race this would reset your lapcount, and remove your splits from the array. In qualy tho, your splits should remain. (Note that this differs from real life F1 rules because you can go into pit settings at anytime and thus your penalized by the LFS sim by removing your lap count.)
  • Client Leaves Race (PLL)
    Remove client from drivers array and split array.
  • Client Enters Pit Stool (PIT)
    If your going for the F1.com style T&S you need to change their UName to Red .
  • Client Exits Work Done (PSF)
    Might want to note they are exiting the pit stool.
  • Client Enters Pits (PLA & Fact->PITLANE_ENTER)
    Client is entering the pits (and is govened by it's speed limit).
  • Client Exits Pits (PLA & Fact->PITLANE_EXIT)
    Client is exiting the pits (and is no longer goved by it's speed limit).
  • Client Penalty Chagned (PEN)
    Client was given or cleared a penalty (OldPen & NewPen (See Penalty Enum) for reason (Reason (See Reason Enum)).
  • Client Flagged (FLG)
    Client in in a place where a flag is being displayed.
  • Race Finished (FIN)
    Given for Each client once they finish an event.
  • Client Result (RES)
    On Qualify Result or Confirmed finish.
And that's just a small list of things you should consider when it comes to captureing LFS World Stats in a persistent state for the client.
wow that's a lot of info :| thanks for taking the time to do that. So just to clear one thing up, lfs world stats provides all of the data you mentioned, in real time for each race?
Well, kinda. They have something called Host Progress, and here's the host Porgress for (FM) FoX JuNkieS, that will do kinda what you want. If I remember corretly, I have something in the LFSWorld SDK that allows you to get this information in the JSON format. But I COULD be wrong, and it will not be in the format I described above.
Oh, even better! The output is indeed JSON, and it's not governed by the tarpit rules of the pubstats!

http://www.lfsworld.net/pubsta ... php?host=(FM)+FoX+JuNkieS

enum status {
"OFFLINE" = 1,
"SPECTATING",
"IN_PITS",
"IN_RACE"
};

enum Car {
"XFG" = 1,
"XRG",
"XRT",
"RB4",
"FXO",
"LX4",
"LX6",
"MRT",
"UF1",
"RAC",
"FZ5",
"FOX",
"XFR",
"UFR",
"FO8",
"FXR",
"XRR",
"FZR",
"BF1",
"FBM"
};

Hmm right, okay, hopefully this will be the last completely nooby questions (although there may be some more semi-nooby questions ),

the info you provided in the post above with that big list, where is that from? where are all of the abbreviations from, like FLG and PEN, how do I access these? is that what InSim is?

thanks again.
Quote from MirageJ :Hmm right, okay, hopefully this will be the last completely nooby questions (although there may be some more semi-nooby questions ),

the info you provided in the post above with that big list, where is that from? where are all of the abbreviations from, like FLG and PEN, how do I access these? is that what InSim is?

thanks again.

Yes and No. FLG and PEN is the abbreviation that Scawen chose to give the packet's structure as defined in the insim.txt (<LFS>/docs/insim.txt) document. FLG is really a struct, or a structure for information to be placed into, but it's full name is IS_FLG, the IS standing for InSim or Insim Struct (It's never really defined anywhere what the IS prefix really stands for), and ISP is assumed to be defined as meaning InSim Packet. InSim it's self is just a method getting game event data from the engine to the InSim Client via a connection between the LFS InSim host, and InSim Client. The insim host does not have the be the ultimate host either, it can be just a client connected, but functionality is derogated when operating in this mode without the lfs client operating as an insim host admin privileges on the ultimate host.

To access these you can use many different options currently available, such as LFSLapper, or LuaLFS to hook into these packets in different ways. But using them requires a level of computer programming understanding in the various languages they choose to function under. I myself am starting work on a PAWN interface for the InSim system, and your post above gave me a chance to clarify my thoughts on what I should name the forward functions.
Excellent, thanks a lot. I just wanted a bit of base knowledge to build upon, and that's exactly what you've given me, much appreciated.

Live Timings For LAN
(16 posts, started )
FGED GREDG RDFGDR GSFDG