Autologin

From Citymania.org wiki
Jump to navigation Jump to search

Citymania servers use an autologin feature based on IP address and cannot offer more due to the game's conception. If you are one of those who change of IP address often, maybe you could use a console alias to ease your login. Here are the instruction to set it up.

  1. You need to locate the openttd's configuration/data directory, the directory in which the file openttd.cfg reside. Here is where to look for based on your operating system:
    Win XP : "C:\Documents and Settings\<username>\My Documents\OpenTTD"
    Vista/7: "C:\Users\<username>\Documents\OpenTTD"
    Linux  : "~/.openttd"
    Mac OS X  : "~/Documents/OpenTTD"
    Any OS  : OpenTTD installation folder (must be created after install, before first run)
    
  2. In that directory, a sub-directory "scripts" may exists, if not, create it.
  3. Inside the "scripts" sub-directory, you need to create a plain text file named "on_client.scr".
  4. In that file, you can add a single line:
    alias llogin "say_client 1 '!login your_user_name your_password'"
    

    You will need to replace "your_user_name" and "your_password" by your own account's information. Also, make sure to respect the single and double quotes orders after your password. If you went crazy with your password and have single/double quotes in it, I suggest you change your password or it will break the alias string.

  5. Save and close the files.
  6. (Re)Start OpenTTD.
  7. Once all this is done. Connect to any of the Citymania server, open the console and type: llogin


Security Consideration

The alias send the login string to the client #1, which is always the server. So the risks of publishing your account's information on the general chat is less likely to happen. This is why everybody should have a this set up, not only those with connection problem. If entering your whole information in a file seem to much of a concern to you, you may be interested by the following alias alternative:

alias llogin "say_client 1 '!login your_user_name %A'"

and in the console type:

llogin your_password

to authenticate to the server. The '%A' token force the alias to have one argument, which is your password.