The online racing simulator
Commandline to connect to a server
I know this is probably not the correct forum but since no one could answer the question in this thread in the Technical Assistance forum I thought I'd maybe have a better chance of finding an answer here.

I want to know what the commandline is that you can give so that LFS connects to a specific server because I'd like to be able to join a server from within my IRC client, which has a built-in server browser for games. So in order for that to work I need to know what the commandline is to connect to the server, otherwise it will just fire up LFS and not connect.

Thanks in advance!
I can't believe no one here knows the answer Surely this is needed for all kinds of insim applications and whatnot?
#3 - Jakg
Do you mean like an LFS:// link?

Heres a link to the server your on, which should explain it...

lfs://%7CCTRA+Race+2%7C0%7CS2%7C/

Add that to Join2LFS and you've got a solution.

Do you mean as a commandline parameter...? if so it's outlined in one of the files in LFS>Docs.
Quote from Jakg :Do you mean as a commandline parameter...? if so it's outlined in one of the files in LFS>Docs.

That's what I was looking for, thank you. Stupid of me not to look in the game docs first.

Anyway, it doesn't seem to work as my IRC client is set up to work with ip's and LFS itself seems to work better with servernames. For example, in LFS if you go to Multiplayer and type in the ip address of say CTRA Race 1 (with or without port) it says the server could not be found Anyone know why this is? It works fine if you just type in the servername. Unfortunately my IRC client only accepts ip addresses or hostnames (which have to have a . in them)
It's by design, to prevent avoiding the master, which is supposed to be a deterrent to prevent people cracking the game and using it online.
Ah, that makes sense. Pitty though...
Tbh, if you're getting a list of servers in your IRC client (I assume you've got some pretty mod which lists the servers in a dialog or something?), you should really be doing it via the pubstats, which means you only get the server name anyway, which means you can then pass the name onto the game.. If you're actually querying the master directly then I'd suggest moving across to the pubstats as it's not subjected to LFS updates (i.e. it relatively stable in comparison to the master protocol), plus the dev team might want to hit you over the head with a small spanner should you be doing it..
Quote from the_angry_angel :Tbh, if you're getting a list of servers in your IRC client (I assume you've got some pretty mod which lists the servers in a dialog or something?)

Nope, it's not that fancy It's fairly simple, really: you can specify the .exe of the game, and manually add servers for that game by either typing the ip address or the hostname in a dialog box; they are then stored and brought up for you when you run the game from within the IRC client. It doesn't read those ip's to give you any information on the servers, it's just used to put in the commandline to connect to that server when the game is run, the commandline being /join=<ip> (with <ip> being the variable that you entered, either an ip or a hostname). It would work perfectly if it would allow me to just enter the name of the server, but the script requires either an ip or a hostname which has to have a . in it.

The reason I'd like to do this is because I sometimes spend quite a lot of time on IRC and if I'm able to join servers this way it will automatically set me as "away playing LFS on .... server" and whatnot, so people know I'm playing a game and shouldn't be bothering me.
Quote from obsolum :but the script requires either an ip or a hostname which has to have a . in it.

Then fix the script? If you use irssi or mIRC, or any of the other popular clients, it should be trivial..
I use mIRC with nnscript. The possibility to start games and connect to servers is a feature of nnscript. Maybe I could look into it, but I'm not really a wizard in IRC scripting.

EDIT: okay, I've managed to change it so that it allows me to enter the server name. However, if I then select a server and run the game it only takes the first part of the name - up until the blank space - with it in the command line. For example, I add CTRA Race 2 to my favorites, but when I select that server and run the game, LFS tries to connect to "CTRA" I'm getting closer, though Anyone here happen to be a scripting wiz?
Quote from obsolum :I use mIRC with nnscript. The possibility to start games and connect to servers is a feature of nnscript. Maybe I could look into it, but I'm not really a wizard in IRC scripting.

EDIT: okay, I've managed to change it so that it allows me to enter the server name. However, if I then select a server and run the game it only takes the first part of the name - up until the blank space - with it in the command line. For example, I add CTRA Race 2 to my favorites, but when I select that server and run the game, LFS tries to connect to "CTRA" I'm getting closer, though Anyone here happen to be a scripting wiz?

I am not a scripting wiz by any stretch of the imagination, but in the case of spaces causing glitches, just remove the spaces and replace them with ASCII characters...Problem is, don't know the ASCII code for space...think it might be %20, but look it up anyways
Well I suppose the idea is good, but how would you go about entering ASCII codes into that dialog box? 'Cause... if you just press ALT+32 (that's the code btw) you just get a space, of course



The problem is... that I'm not sure where the problem is. I can enter the servername alright into that dialog box, but I don't know how the actual variable is stored. Ugh, this is confusing
Try this:
CTRA Race 1

or:
CTRA Race 1

Might work


[edit]
The SECOND ONE DOES WORK!!!!!

trouble is, even THIS editor will parse it as a space!

I entered "&" + "#160" + ";"...without the quotation marks ...If I type it all together then it prints...a space!!!!
[/edit]
Neither of those suggestions work. The problem is that neither the IRC client nor LFS parse any of those codes; they just see it as text. See screenshots below.





I don't know enough about mirc scripting to know if there are different types of variables, like there are integers, strings and whatnot in programming languages. Maybe I just need to change the type of variable to the equivalent of a string so that it includes spaces.

FGED GREDG RDFGDR GSFDG