# 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. Step 1. In the server.cfg file on your server, make sure you have this line: password_field "pw-home" Step 2. 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." Step 3. And 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 server.cfg file from step 1 above. Step 4. 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.

When you ran the Windows installation script for Admin Mod, you may have specified some information about your username and password, in which case a text file called adminpass.cfg was probably created in your mod directory on the server. Although the file was created on the server, it is not supposed to be used there. You should now move the adminpass.cfg file to your client machine (the client is the computer that you play your game on).

Note: You may be running a listen server , in which case your client and server are on the same computer. In that case, the file can stay right where it is.

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 form 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 server.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.

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 server.cfg or listenserver.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 (listen)server.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 [ADMIN] password has been set on client

developer 0

Make sure you replace "pw-home" and "password" in the example above with the appropriate information from the password_field in your server.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, c reate 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.