The online racing simulator
.
(11 posts, started )
.
.
#2 - Silox
You can use the PubStat (watch out with the maximum of requests) to request the stats, and use StreamReader (or another http reader included in C#) to read the information...

I have no experience with C# nor with PubStat, I just know it's possible this way
-
(Heiko1) DELETED by Heiko1
edit: irrelevant.
-
(Heiko1) DELETED by Heiko1
edit: irrelevant.
-
Explain what i need to be Explained (Heiko1) DELETED by Heiko1
#5 - Silox
Quote from Heiko1 :The only thing what i need is that i can insert LFSW stats into a Button

Well, DarkTimes (almost) gave you the code for it...
I'll show you in VB.net (not tested, it can be bugged) how to recieve a PB from LFSW in milliseconds with PubStat for a pre-defined racer.


' Place the piece of script where you want to create the button

string pubStatUri = "http://www.lfsworld.net/pubstat/get_stat2.php?version=1.4&idk=<Your_Ident_Key_Here>&action=hl&racer=Silox";

' This returned a lot of PB's for my account

' Now the requesting part

WebRequest request = WebRequest.Create(pubStatUri);

using (WebResponse response = request.GetResponse())
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{

' The streamreader reads every time 1 line from the file, so we'll need a loop

' Save the return info in a string, called line

string line;

' Loop trough all the lines of the file

while (line = reader.ReadLine()) != null)
{

' E.g. I want to get my XFG Bl1 PB
' Which is, on the Pubstat like this:
' 240 XFG 45500 0 0 94230 2 1201295794 (Don't know for sure if it's this one)
' Now we'll modify the code:
' I should cut the code into an array

array results

results = String.split(line)

' If BL1 and XFG

If results(0) = 240 and results(1) = "XFG" then

' Save the total time in Miliseconds
string pb
pb = results(7)
' Exit the loop so it will take less time
exit loop;

}
}


Now you have the pb of the racer in milliseconds, you'll just need to edit the pb a bit to make it display in hours, minutes, seconds, hundreths...
And then make a button of out it, using the InSim.CreateButton thing
-
(Heiko1) DELETED by Heiko1
edit: irrelevant.
#7 - Silox
Quote from Heiko1 :Thanks silox

PS: Was on ur server with ur system.

FirstCorner+Demo's = Crash carambolage ^^ but nothing against server its very less lag!

We're planning to make a 'Noob server'; 1 lap Crash!
Well, as the InSim Program is made with a file to save all the data in, the bigger the file gets, the longer to load...

Good luck on your Ranking System!

P.S.: I think it's better to work with a MySQL database to save all the info:
- Much easier way of updating points
- Quicker (I think)
- Better way of backupping

(The 500servers admin accidentally overwrote one of our ranking files... Result: We ended up with a 1 week old file, so we gave everybody more points )

P.P.S.: Watch out with the PubStat Tarpit! You can only make 1 request every 4 seconds...


Quote from DarkTimes :It's actually the fifth one.

pb = results(5)


Didn't test it, was a guess...
-
(Heiko1) DELETED by Heiko1
don´t give up so fast if you want it realy you will get it !
many times its just a simple failure what you done maybe a } or { to mutch i know this probs from my cruise insim
-
(Heiko1) DELETED by Heiko1
-
(Marco1) DELETED by Marco1
#9 - Silox
Quote from Heiko1 :Can someone make me the code for:

First Place
Total Distance
Total Driven Laps
Races Finished
Fuel Burnd


PLEASE!


HAPPY NEW YEAR!

You want us to make a System for you? That's gonna cost some money I think...
-
(Heiko1) DELETED by Heiko1
Hi Heiko -

I was wondering if there is a website for your servers that would have such things as rules, stats etc??

Been watching from the remote and it sure looks like it is doing well
hi some belgiumranking system admin here ?

.
(11 posts, started )
FGED GREDG RDFGDR GSFDG