Accounts e-mail HP

## Command-line options to connect

Join us, meet players from all around the world, challenge the strongest top players, practice and be one of them!

### Command-line options to connect

Hi,
I sigend up to 3 GT games so each time I have to type a different port when connecting.
I could remember that back in the LT days I had some batch files (in Windows) to launch different games and having only to type my password. Unfortunately I lost them and now I can't re-create them.
Can someone help me?
Another thing. One of the games I play with needs a different, hex-type tileset. So if I previoulsy played a different game, each time I need to additonally go to client options and manually select the new tileset.
Is there a way to put this option in the .bat file?
Thx
monamipierrot

Posts: 444
Joined: Sat Nov 03, 2012 8:43 pm
Location: Barcelona, Spain

### Re: Command-line options to connect

Hey monamipierrot,

for the ports hassle, Greatturn servers are listed on the public metaserver, so you could just point and click on a GT server and your client would get connected. However, let's take the batch scripting approach, which also allows for defining predetermined tilesets.

Suppose you are playing two Greatturn matches: GT00 and GT01. You can create one script for each match, bearing the names GT00.bat and GT01.bat. Pay attention to not let Windows hide the real file extension from the name, because it may append an additional invisible ".txt" without telling you, and this wouldn't work.
Inside each of the files, insert one of the following text line. Which line to insert into what file depends on the wanted configuration. The files need to be encoded in ASCII 7 bit (eg. use Notepad, but not Microsoft Word).

Code: Select all
C:\path\to\freeciv-client --autoconnect --server greatturn.org --port 5100 --tiles amplio2C:\path\to\freeciv-client --autoconnect --server greatturn.org --port 5101 --tiles hex2t

Now when you want to connect to a server you just need to click on one of these scripts you made.

Davide

Posts: 864
Joined: Sat Mar 24, 2012 12:34 am

### Re: Command-line options to connect

Davide wrote:
Code: Select all
C:\path\to\freeciv-client --autoconnect --server greatturn.org --port 5100 --tiles amplio2C:\path\to\freeciv-client --autoconnect --server greatturn.org --port 5101 --tiles hex2t

Great! It works! Grande Davide!
And what about passwords? I read somewhere ther was some leak in the server, so they shouldn't be used in a script. Is there any solution?
monamipierrot

Posts: 444
Joined: Sat Nov 03, 2012 8:43 pm
Location: Barcelona, Spain

### Re: Command-line options to connect

It's not possible to automate the authentication using a vanilla client. This would require either to create an expansion feature on the client side, or to use other raw user-side solutions such as windowing scripts, which don't yet exist in public domain AFAIK.

Davide

Posts: 864
Joined: Sat Mar 24, 2012 12:34 am

### Re: Command-line options to connect

Wow, that's great! It was really annoying to change the tileset each time you switched an hex game for a non-hex one, and viceversa

ifaesfu

Posts: 242
Joined: Sun Aug 26, 2012 1:03 pm
Location: Huelva, Spain

### Re: Command-line options to connect

ifaesfu wrote:Wow, that's great! It was really annoying to change the tileset each time you switched an hex game for a non-hex one, and viceversa

Yes. Althou it should be a feature of the client itself to check for tileset consistency/compatibility and, if check is unsuccessfull, to automatically switch to a suitable one.
monamipierrot

Posts: 444
Joined: Sat Nov 03, 2012 8:43 pm
Location: Barcelona, Spain

### Re: Command-line options to connect

The trick is great, but I found out that it overrides my original Windows launcher which sets language to en-gb.
Freeciv then "detects" the system language and run automatically with it (if it has been installed). Then, there's no way to change it from the client (quite an issue, in my opinion). I don't like any language different than English, which Freeciv could "detect".
I bet there's a batch option to run freeciv in English? Which one?
monamipierrot

Posts: 444
Joined: Sat Nov 03, 2012 8:43 pm
Location: Barcelona, Spain

### Re: Command-line options to connect

Try to insert a localization variable before invoking the client, such as:

Code: Select all
SET LC_ALL=CC:\path\to\freeciv-client --autoconnect --server greatturn.org --port 5100 --tiles amplio2

If that doesn't work, try to replace LC_ALL with LANG.
Here's the manual page.

Davide

Posts: 864
Joined: Sat Mar 24, 2012 12:34 am

### Re: Command-line options to connect

Davide wrote:
Code: Select all
SET LC_ALL=CC:\path\to\freeciv-client --autoconnect --server greatturn.org --port 5100 --tiles amplio2

It works great! I hope it has no side-effects on windows system. Thanks!
monamipierrot

Posts: 444
Joined: Sat Nov 03, 2012 8:43 pm
Location: Barcelona, Spain

### Re: Command-line options to connect

It shouldn't have side effects as that's solely a local variable which Windows forgets about after Freeciv quits.

Davide

Posts: 864
Joined: Sat Mar 24, 2012 12:34 am

### Who is online

Users browsing this forum: No registered users and 2 guests