Date: 06 8, 2001 3:37:23 PM

# Client configuration via setinfo commands

The Basics of Client Configuration
Maybe you already have some sort of idea how this all works, and you are just trying to figure out exactly what to configure and where without the explanation? To summarize this section, here's the basics of what you can do to get your clients up and going. In the adminmod.cfg file on your server, make sure you have this line: password_field "_pw-home" In the users.ini file on your server, make sure you have this line: `UserName:PassWord:#####` Note that in the above example, `"UserName"` must be replaced with the player's name, `"PassWord"` must be replaced with the desired password, and `"#####"` must be replaced with the numeric access level to be granted to that user. More information about access levels can be found in "Setting up your users.ini file." In your adminpass.cfg file on your CLIENT machine, make sure you have this line: `setinfo "_pw-home" "password"` Note that `"_pw-home"` in the above line must match the value assigned to the password_field cvar in your adminmod.cfg file from step 1 above. Create a shortcut on your desktop to the game you will be playing, or copy an existing shortcut. Edit the shortcut, and in the "Target" field, add the this text: `+exec adminpass.cfg` For example, if your Counter-Strike shortcut looked like this: `C:\SIERRA\Half-Life\hl.exe -console -game cstrike` you would change it to say: `C:\SIERRA\Half-Life\hl.exe -console -game cstrike +exec adminpass.cfg` (to set up your shortcut to allow you to automatically connect to your server, add: +connect 0.0.0.0 - and put your server's IP address in place of the zeros) Remember: Never use the shortcut for admin privileges to connect to a server other than the one you are an admin on, or you will risk exposing your password to the outside world. If you need to load your password configuration file again while in the game, you can type: `exec adminpass.cfg` in the console. This loads the information in the file in the same way the startup shortcut does.

In order for a person to successfully log onto your server and gain access through Admin Mod, you must prepare the client computer ahead of time. That is what this section covers.

The setinfo line is the most important part of client access to the Admin Mod on a server. It is also the part that tends to cause the most difficulty, but it doesn't need to. It requires some level of knowledge about what is going on when you connect to a server running Admin Mod. We'll try to explain that here in a fairly simple fashion.

In previous 2.5x series installers a default user was configured and an adminpass.cfg file created for you. This is no longer the case and you will have to create this file using notepad or another plain text editor. The filename adminpass.cfg is used only because it tells you the function of the file, feel free to change all reference to adminpass.cfg to whatever you decided to call it on your system.

What is this file for? Basically, when you connect to the server, the Admin Mod looks at your player name that you have specified in your game settings. If your name is listed in the users.ini file on the server, it recognizes that you are connecting as an admin, and then checks your password against the one it has in it's users.ini file to make sure it's really you.

The way the server interacts with the client, in simplified terms, is like this: Once the server recognizes your player name as being on the admin list (in users.ini), it requests information about your password from your client machine (that's the machine you play on and are using to log into the server).

In order to request that information from your client machine, it makes a request based on where it expects the password to be stored, sort of like you going to your mailbox to get your mail, since the client's password storage mechanism has a unique identity and can hold information that you put in there. Let's say your mailbox is called `"_pw-home"` and you have specified that in the adminmod.cfg file, like this:

`password_field "_pw-home"`

If that is the case, the server is going to send your game a message asking the client machine to send anything that is stored in the "mailbox" called "_pw-home." For those who prefer to use accurate terms rather than metaphors, it's actually a "variable," or some would call it a "field."

Therefore, you need to store your player password in the field called _pw-home on your game machine. You do this using a "setinfo" command, which is simply a command that Half-Life uses to store information in specified places. In tech terms, "_pw-home" is a variable for storing data, and "setinfo" is a command used to assign values to Half-Life game variables. In this case the data being stored is your Admin Mod password.

N.B.
From Admin Mod 2.50.50 onwards using an underscore as the first character of the password field is now compulsory. The change to the secure underscore including forms was made several versions previously but was not enforced. Unfortunately not all users took notice and passwords were left in the clear for cheats to find and exploit. With compulsory first character underscores the server will print a warning message and then quit if a password_field not beginning with underscore is used. This behavior is added to ensure better security for both client and server.

The setinfo line that needs to be used on the client machine looks like this:

`setinfo "_pw-home" "password"`

with `"_pw-home"` being the mailbox variable defined by the password_field setting in the adminmod.cfg , and the `"password"` being the same one listed in the server's users.ini file for your player name or WON ID.

For example, if your users.ini file looked like this:

`PlayerX:testpass:65535`

and the adminmod.cfg file had:

`password_field "_pw-home"`

the setinfo line for PlayerX would be:

`setinfo "_pw-home" "testpass"`

For any player attempting to gain access to your server, the first item in quotes in the line above (again, as defined in password_field) will always be the same. The second quoted item - the player's password - will give the player access to your server, as long as the password provided here matches the one set on the client machine. Once again, in our "mailbox" metaphor, the mailbox name (field where info is stored) is called `"_pw-home"` and the user's password is `"testpass"`

The setinfo line can be specified in many places. Every person that will connect to your server as an Admin needs to follow these instructions. Note that we recommend only one safe and secure way to do this. Please follow these instructions carefully.

On the client (game) machine, go into the `<mod>` directory of the game you will play on the server running Admin Mod.

For example, if you play TFC and your HL is installed on your c:\ drive, it would be:

`c:\Sierra\Half-Life\tfc`

Your adminpass.cfg file should contain the information you need already, if you created it with the Windows installer for Admin Mod, but check it to be sure. You were instructed to put a copy of this file in your mod directory earlier in this chapter. If the file is not already there, you either need to go back and copy it, or you can create it with a plain-text editor such as Notepad, emacs, vi, Textpad, etc.

First off, you need to edit the adminpass.cfg file with a plain text editor such as notepad, and add these lines if they are not already there:

`

setinfo "_pw-home" "password"

developer 1

echo client admin mod password has been set

developer 0

`

Make sure you replace "_pw-home" and "password" in the example above with the appropriate information from the password_field in your adminmod.cfg and the password listed for your user name in the users.ini file. Be sure to include the quotation marks around the words as shown above - you need to keep those to ensure the file will be read properly by the game when it loads.

Finally, create a shortcut on your desktop to the game you will be playing, or copy an existing shortcut to your game. Edit the shortcut (right-click on it and choose "Properties," and then click on the "Shortcut" tab), and in the "Target" field, add the this text: "+ exec adminpass.cfg"

For example, if your Counter-Strike shortcut originally looks like this:

`C:\SIERRA\Half-Life\hl.exe -console -game cstrike`

you should change it to read:

`C:\SIERRA\Half-Life\hl.exe -console -game cstrike +exec adminpass.cfg`

To set up your shortcut to allow you to automatically connect to your server, you can also add:

`+connect 0.0.0.0:[port]`

to the shortcut entry - but remember to put your server's IP address in place of the "0.0.0.0" and the port number for your server if needed in place of "[port]" in the example:

`C:\SIERRA\Half-Life\hl.exe -console -game cstrike +exec adminpass.cfg +connect 192.168.0.1:27015`

Remember: Use this new shortcut to connect only to the server you have admin privileges on, or you will risk exposing your password to the outside world. Rename this shortcut to something obvious that will identify it as the one that invokes your Admin Mod password. You might call it, for example, "ADMIN Counter-Strike."

If you need to load your password configuration file again at any time, you can type:

`exec adminpass.cfg`

in the console. This loads the information in the file in the same way the startup shortcut does.

If all the passwords and variables are in the right place and are (of course) correctly entered, you automatically have access to the server whenever you connect to it. You can also play on any other servers without changing anything. Remember that everything, passwords and names, are case sensitive.