The online racing simulator
Jakg, most of the people who were/are making cruise servers have already gone past the stage this tutorial is at. It's a resource for beginners to show them how to earn cash, buy cars and a couple other things...that's the way I see it anyway
yes, big help for begginers, this is the base, with that is more easy start cruise server.
Quote from Jakg :Why can't you, as a group of mainly skilled programmers, finish this "open source" cruise program off rather than taking someones hard work and butchering it for your own personal private stuff?

1. The mentality of the average cruise server admin wants it this way

2. This isn't so much an open source application, in the fact that there's no dictator or owning body who will accept patches, etc., centrally

That said, there are some updates coming from several people, who are contributing back, so it's not entirely proprietory here.

If someone wants to take this, and run with an open source cruise server, then I can't see anything preventing anyone, to be honest.
Quote from Jakg :Without Googling - 0.62124

EDIT - This thread is embarrassing - Everyone is making their OWN Cruise program. Why can't you, as a group of mainly skilled programmers, finish this "open source" cruise program off rather than taking someones hard work and butchering it for your own personal private stuff? ATM I can see several people trying to get a "not be a finished product and should be used as a simple example or tutorial in creating your own" program working for a purpose it's not quite fit to do (yet), with no programming experience.

I would love to help but alas I have no programming experience (I even failed the C# - "C Pound or C Sharp" test)

From what I've seen it's not about just having a cruise server, it's having your 'own' cruise server. People see the popular servers and want to emulate them, they want to be the guy that runs it, who gets all the kudos. A collaborative open cruise server that anyone and everyone can use reflects more what the community needs, rather than what individual users want. Until that changes such an obviously useful project will never get off the groud.

I've said before, I will help with the code for any proper open source cruise project that's get started. What we need is some experienced hacker, who believes in open-source software and 'gets' the whole cruise thing, to come along and start the ball rolling... That person must exist somewhere...
Quote from Jakg :Without Googling - 0.62124

EDIT - This thread is embarrassing - Everyone is making their OWN Cruise program. Why can't you, as a group of mainly skilled programmers, finish this "open source" cruise program off rather than taking someones hard work and butchering it for your own personal private stuff? ATM I can see several people trying to get a "not be a finished product and should be used as a simple example or tutorial in creating your own" program working for a purpose it's not quite fit to do (yet), with no programming experience.

I would love to help, but alas I have no programming experience (I even failed the C# - "C Pound or C Sharp" test)

I dont see what you mean by finish this. The current way cruise servers are, Is who has the best. Thats the way i see it, If you look at that and then relate that back to this thread. You will see that this could never been finished. No one knows why the original developer released this, Maybe he wanted to make one and then gave up and sent it to the_angry_angel, Thats not my point though. My main point is that you cant put a "finish" on something like this, if you can, please explain. Its kinda what DarkTimes explains a bit above, about getting all the Kudos.

Quote from DarkTimes :I've said before, I will help with the code for any proper open source cruise project that's get started. What we need is some experienced hacker, who believes in open-source software and 'gets' the whole cruise thing, to come along and start the ball rolling... That person must exist somewhere...

Tbh, I dont see why you wanna bother. If you do, why not use this one. Its basically half done and people are using it already. Why confuse them with something new?
I mean a proper open-source project. A real program designed to be used by real people. Not a half written example that you need to edit the source-code for in order to run without crashing (Edit: no offence to the original author btw, it is just a tutorial after all ).

The simple fact is if people want a cruise server, they shouldn't have to begin by learning to program, they should just be able to download one that already works. If you want to browse the Web, do you start by learning how to write your own Web browser? No, you download Firefox and enjoy the shiny user-friendliness of it all.
Quote from Jakg :Without Googling - 0.62124

EDIT - This thread is embarrassing - Everyone is making their OWN Cruise program. Why can't you, as a group of mainly skilled programmers, finish this "open source" cruise program off rather than taking someones hard work and butchering it for your own personal private stuff? ATM I can see several people trying to get a "not be a finished product and should be used as a simple example or tutorial in creating your own" program working for a purpose it's not quite fit to do (yet), with no programming experience.

I would love to help, but alas I have no programming experience (I even failed the C# - "C Pound or C Sharp" test)

Try learning Visual Basic first, it's easy and simillar to C#

I've been updating this for other people but I feel upset since I joined a server using my edited one and they banned me straight away

BTW is what it is I think : 1 kph = 0.621371192 mph
Still Dont Work !
EY ALL HERES A SCREEN SHOT OF WHAT IS WRONG WITH IT

i have changed what i think is the admin password in c# is it correct

some one please tell me what i am doing wrong all i get back is download c# and change the cfg line

did i do it correct or what did i do wrong

thanks all
Attached images
noope.JPG
Quote from DarkTimes :I've said before, I will help with the code for any proper open source cruise project that's get started. What we need is some experienced hacker, who believes in open-source software and 'gets' the whole cruise thing, to come along and start the ball rolling... That person must exist somewhere...

And the code will be GPL'ed. (I promise that).
Quote from MUFFMAN001 :i have changed what i think is the admin password in c# is it correct

You need to recompile the program after you've changed the password.
Just press F5.
Quote from shaun463 :I added BF1+FO8 and cleaned up the scipt a bit

cruising with single seaters... thats new
Quote from MUFFMAN001 :EY ALL HERES A SCREEN SHOT OF WHAT IS WRONG WITH IT

i have changed what i think is the admin password in c# is it correct

some one please tell me what i am doing wrong all i get back is download c# and change the cfg line

did i do it correct or what did i do wrong

thanks all

Press F5 in VC...
It's F6, F5 is to enter debug mode...
got it running, only thing i want to remove is that admin everytime gets so much cash (or isnt the money saved when i restart the insim?)
how to remove the admin money?? (without paying)
Quote from Stefani24 :got it running, only thing i want to remove is that admin everytime gets so much cash (or isnt the money saved when i restart the insim?)
how to remove the admin money?? (without paying)

the players progress inst saved if the insim crashes or u restart it the players progress is only saved if they leave the server.
Coincidentally, what's the best way to make an auto-save feature? I would like the accounts to be saved every 5 minutes, in case of a crash. I tried making a 5min timer, and making a for loop which saves every UCID, but that just crashes, even inside a try-catch...

Has anyone any advice? Thanks
Add this to main/Form_load

[SIZE=2]BackUp.Enabled = [/SIZE][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]BackUp.Elapsed += [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2] System.Timers.[/SIZE][SIZE=2][COLOR=#2b91af]ElapsedEventHandler[/COLOR][/SIZE][SIZE=2](BackUp_Elapsed);[/SIZE]

Then add this code somewhere in the class, but not in a method.


[SIZE=2]System.Timers.[/SIZE][SIZE=2][COLOR=#2b91af]Timer[/COLOR][/SIZE][SIZE=2] BackUp = [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2] System.Timers.[/SIZE][SIZE=2][COLOR=#2b91af]Timer[/COLOR][/SIZE][SIZE=2](300000);[/SIZE]

[SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][SIZE=2] BackUp_Elapsed([/SIZE][SIZE=2][COLOR=#0000ff]object[/COLOR][/SIZE][SIZE=2] sender, System.Timers.[/SIZE][SIZE=2][COLOR=#2b91af]ElapsedEventArgs[/COLOR][/SIZE][SIZE=2] e)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000ff] foreach[/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#2b91af]clsConnection[/COLOR][/SIZE][SIZE=2] C [/SIZE][SIZE=2][COLOR=#0000ff]in[/COLOR][/SIZE][SIZE=2] Connections)[/SIZE]
[SIZE=2][COLOR=#2b91af] FileInfo[/COLOR][/SIZE][SIZE=2].UpdateUserLeave(C.Username, C.Cash, C.Cars);[/SIZE]
[SIZE=2]}[/SIZE]

Probley not good practice, but works none the less...
I'm willing to put some coding time into the project, supply the server and hosting page for this project. i dont know much about C, but dad has made a few arcade attractions, am sure he can help me along the way.
Thanks, I see my problem. I was using a for loop with a byte that ranges from 0 to 255
Quote from -{RR}-Cannon-Fodder :I'm willing to put some coding time into the project, supply the server and hosting page for this project. i dont know much about C, but dad has made a few arcade attractions, am sure he can help me along the way.

You mean C#
Quote from dougie-lampkin :Coincidentally, what's the best way to make an auto-save feature? I would like the accounts to be saved every 5 minutes, in case of a crash. I tried making a 5min timer, and making a for loop which saves every UCID, but that just crashes, even inside a try-catch...

Has anyone any advice? Thanks

I might not understand what you mean, but I don't see the point of saving the connection ID, as that changes every time the driver joins the server. I would use the LFS username as a key to distinguish different drivers, but obviously that wouldn't work for demo or in single-player, so there might be a better method. Also it would probably just be better to save the data as you receive it, or after every lap, or every race, if you're interested in preventing data loss. I dunno if randomly saving it every 5 minutes make much sense really...
The way I was doing it, it ran through every possible UCID (0 - 255), and "tried" to save each one. But of course, even with a try-catch, it still hung when no file existed.

I save every 5 minutes just incase of a server or insim crash, so that only 5 minutes work is lost. It still saves it when someone disconnects though, so the 5 minutes thing is just a backup...
Well, as I said, the UCID changes every time someone joins the server. I would use the LFSWorld username as a key to store data. Say you had a class called Driver where you store the driver info, and an array of the current drivers on the server, then it's easy to save and recover that sort of data...

// This is the class where we store info about our drivers.
class Driver
{
public string LfsUserName;
public int Money;

// Insert other info you want to save.
}

// This will save an array of drivers to a file.
void SaveDrivers(string file, Driver[] drivers)
{
System.IO.FileStream stream = null;
System.IO.BinaryWriter writer = null;
try
{
stream = System.IO.File.Open(file, FileMode.Create);
writer = new System.IO.BinaryWriter(stream);

writer.Write(drivers.Length);
foreach (Driver driver in drivers)
{
writer.Write(driver.LfsUserName);
writer.Write(driver.Money);

// Write the rest of the info to file.
}
}
catch (System.IO.IOException ex)
{
// Gracefully handle IO error.
}
finally
{
if (writer != null)
writer.Close();
if (stream != null)
stream.Close();
}
}

// This will read the file back and return an array of drivers.
Driver[] LoadDrivers(string file)
{
List<Driver> drivers = new List<Driver>();
System.IO.FileStream stream = null;
System.IO.BinaryReader reader = null;
try
{
stream = System.IO.File.Open(file, FileMode.Open);
reader = new System.IO.BinaryReader(stream);

int numDrivers = reader.ReadInt32();
for (int i = 0; i < numDrivers; i++)
{
Driver driver = new Driver();
driver.LfsUserName = reader.ReadString();
driver.Money = reader.ReadInt32();

// Read the rest of the info in the same way...

drivers.Add(driver);
}
}
catch (System.IO.IOException ex)
{
// Gracefully handle IO error.
}
finally
{
if (reader != null)
reader.Close();
if (stream != null)
stream.Close();
}
return drivers.ToArray();
}

Actually thinking about it, you could just detect if the socket to LFS closes unexpectedly and process any unsaved data when that happens. I dunno how it works in LFS_External, but if you are accessing the socket directly then you can just check to see if the last receive call returned zero bytes, if it did it means the remote socket was closed (EG LFS went bye-byes...).

Also if you're worried about your own program crashing, as opposed to the socket being closed without warning, just hook up the AppDomain.CurrentDomain.UnhandledException and Application.ThreadException events, and process any unsaved data if either of those are thrown (cause if they are it means your user is going to be staring at the desktop any second now...).

Anyway... I might be totally on the wrong track, so sorry if I'm not making any sense...

FGED GREDG RDFGDR GSFDG