Logging in without entering a password aka command line login

Deazer

Head Developer
Staff member
In this topic, I will describe how the CMD Line login method works for a game client.
Let's start with activating this method, which is located in authserver\config\authserver.properties.
In that file, we can see the following settings:

# ================================================================
# CMD Line login method
# ================================================================
# Launch the client using the "account=YourAccount password=YourPassword" parameter.
# Also, make sure to set ExternalLogin=true and CmdLineLogin=true in l2.ini.
# Default: False
EnableCmdLineLogin = False
# Default: False
OnlyCmdLineLogin = False
# ================================================================

To activate it, set EnableCmdLineLogin = True.
If you want players to be able to log in ONLY through the command line, set OnlyCmdLineLogin = True.
If you want players to be able to log in both manually with username and password and through the command line, then leave OnlyCmdLineLogin = False.

Now let's move on to the game client.
First, we need to edit the l2.ini file located in GameClient\system\l2.ini (the system folder may have different names for each person, for example, system_ru, system_en, system_whatever).

Change the following in the [Auth] section:
ExternalLogin=false to true
CmdLineLogin=false to true

d1a92a61245ccd78f098bcfc0b32dc77.png

Now, for a simple example, let's create a .bat file in the GameClient\system\ folder to launch our client and name it something like l2start.bat with the following content:
Code:
start l2.exe account=test password=test

Where "account" is the player's login and "password" is the password.

After launching the game client with the l2start.bat file, the player will immediately see the server selection window.
At this point, I've provided a simple option, but you can write your own launcher that saves the password as a hash, switches between accounts, and so on. You just need to pass the login and password as launch parameters to the game client.

After making all the changes, you won't be able to simply start the client with l2.exe because we would be passing empty parameters for account and password. Therefore, you need to launch it through l2start.bat.

To make it more clear, I will record a video.
 
Back
Top