The online racing simulator
Example: Cruise server (C#, LFS_External)
  • I did not write this - This is the work of mcgas001 with some additional work from various other forum members to resolve bugs or introduce new features
  • There is no support, warranty, or guarantee with this code. It is provided "as is", "sold as seen", etc.
Things to note:
  • It's written in C#
  • Quote from mcgas001 :Well... judging by the time on this message you can see ive gone mad . I made a 'Cruise' InSim application; currently it uses text files and stores them in C:\users\user.txt (very bad i know, but it's an example).You can, Sell/buy cars. Make money. Its quite buggy.

I've posted it here because it's professed to not be a finished product and should be used as a simple example or tutorial in creating your own.

If you are incapable of simple programming then this is not designed for you. You must have some fleeting knowledge of Object Orientated Programming, and have some idea about the C# syntax and how the .NET framework works.

Please see http://www.lfsforum.net/showthread.php?p=785753#post785753 for a version updated to use LFS_External 1.1.

The version attached here is for the old version of LFS External and is purely remaining here for historical purposes.
Attached files
Cruise Tutorial.zip - 130.5 KB - 3065 views
-
(xaotik) DELETED by the_angry_angel : Thread cleaning.
-
(wsinda) DELETED by the_angry_angel : Thread cleaning.
-
(kurent) DELETED by the_angry_angel : Thread cleaning.
-
(xaotik) DELETED by the_angry_angel : Thread cleaning.
-
(the_angry_angel) DELETED by the_angry_angel : Thread cleaning.
-
(xaotik) DELETED by the_angry_angel : Thread cleaning.
-
(ReVoX) DELETED by the_angry_angel : Thread cleaning.
-
Bug on insim [application] (MariusMM) DELETED by the_angry_angel : Thread cleaning.
-
(the_angry_angel) DELETED by the_angry_angel
-
(Robbo01) DELETED by the_angry_angel : Thread cleaning.
-
(the_angry_angel) DELETED by the_angry_angel : Thread cleaning.
how can u run this?
-
(samforey12345) DELETED by the_angry_angel : Thread cleaning.
Quote from samforey12345 :Oh god, now the cruise population will increase massivley again.. great.

Firstly, thanks for contributing positively to the topic.
Secondly, If you don't like it, don't join a cruise server - it's not hurting anyone.

Quote from Stefani24 :how can u run this?

I haven't looked at it, but I'd imagine it needs building, and then running on a server with .NET 2.0 or greater installed. You'll also need to ensure that it has the correct server details built with it.
-
(samforey12345) DELETED by the_angry_angel : Thread cleaning.
Quote from Stefani24 :how can u run this?

In the same way you run any other InSim application; Start insim on the server (/insim 29999), then start the application.

Although if you're not running the application on the same physical machine as the server, or you don't have the same default password as in the code, you're going to have to edit and recompile this if I recall correctly.
#5 - ReVoX
i am working in distance button, my friend have screenshot of my work:
http://www.arribalafoto.com/public/32008/Proyectoinsim.JPG

Have solution for the command !pay?

PD: he has bug with !sell command, return the money but no restrinced the car.
-
(the_angry_angel) DELETED by the_angry_angel : Thread cleaning.
#7 - ReVoX
Thanks men!, good job, and i go to fusion with my Spanish Edition
What class you edit? or edit form1?
the_angry_angel Edit the attachemment
Not important wich exe, but by all exes i get the message: xxx.exe has occured a problem and has to be shut down.
so what can i do?
I'd check that you've got the .NET frameworks installed correctly first, considering that other people have been running them without issue.
-
(ReVoX) DELETED by the_angry_angel : Thread cleaning.
-
(the_angry_angel) DELETED by the_angry_angel : Thread cleaning.
-
(ReVoX) DELETED by the_angry_angel : Thread cleaning.
What are the differences you've introduced Shaun? If it's nothing more than changed messages I don't see what this benefits the tutorial.
i just tried the newest updated version, but it just gives me an empty window with the title: form1 , if i try the vshost.exe, (.exe hass occ.....)
Quote from Stefani24 :i just tried the newest updated version, but it just gives me an empty window with the title: form1

Which I believe means that it's actually running from what I've been told. As stated this is not a fully functioning cruise server. Some work is required to get this working. If you are unable to do so, may I suggest that you talk with one of the guys who have posted updates or fixes.
Karl, it IS functioning, and a good base, but people just need to work on it. It will load and connect to a server, and restrict cars (:hide. People just need to work on it and expand.
I added BF1+FO8 and cleaned up the scipt a bit
Quote from shaun463 :I added BF1+FO8 and cleaned up the scipt a bit

And you edit different levels of money, no?
PD: thanks for the update, is good.
ive done alot to mine

this is waht i get when i try to run the exes
@ revox: btw why do u run version x?
Quote from Stefani24 :
this is waht i get when i try to run the exes
@ revox: btw why do u run version x?

I use version X?, no, i only use X version for drag XRT demo, but I use Y for race demo.
Please, post more big the image, is very small
Quote from Stefani24 :
this is waht i get when i try to run the exes

That happens when it doesn't connect to LFS successfully. Have you opened the Insim port 29999 on your server? (/insim=29999)

Either that, or you've added code which stops it from connecting right...i.e, code that doesn't work...

@ Revox: To see the bigger file, remove .th from the URL. The .th is for thumbnail views...

I quite like this tutorial. It has all the hard work done! Although I had this much done when it was released, unfortunatly
Oh yeah, I edited money too and how quick it was earned
Quote from Stefani24 :
this is waht i get when i try to run the exes
@ revox: btw why do u run version x?

I think thats an 'LFS External' error. The next version of LFS External will throws a nice exception when it fails to connect. You can then display a nice error or try to reconnect or whatever you want.
Quote from Stefani24 :
this is waht i get when i try to run the exes
@ revox: btw why do u run version x?

Try opening the .exe in
Cruise Tutorial\LFS_External_Client\LFS_External_Client\bin\Debug
Quote from Robbo01 :Try opening the .exe in
Cruise Tutorial\LFS_External_Client\LFS_External_Client\bin\Debug

The exe is in \bin\Release, isn't it?
Quote from Stefani24 :
this is waht i get when i try to run the exes
@ revox: btw why do u run version x?

Do you have Visual Studio installed? You need to download that if not. Then change the admin pass.

Quote from dougie-lampkin :The exe is in \bin\Release, isn't it?

There will be one in bin\Release and there will be one in bin\Debug The reasons for that are explained in the name of the directory

FGED GREDG RDFGDR GSFDG