dopewars configuration files
A dopewars server, or a
client (in single-player mode) can be heavily configured by the means
of dopewars configuration files. Clients used to connect to multiplayer
servers can also be configured by the same means, but almost all of these
settings will be overridden on connecting to the server (although the server
location settings Port and Server are still useful).
Example configuration files:
The order of making dopewars settings is as follows:-
- The global configuration file (if present) /etc/dopewars
- The user-specific file (if present) ~/.dopewars
- (Windows only) The file dopewars-config.txt in the current
user's application data directory (e.g.
C:\Users\foo\AppData\Local\dopewars\)
- Options specified on the command line
Settings in a configuration file can set numbers, booleans, strings or
"string lists". A numerical value is set with a command such as
Port=7902 (which sets the TCP port for mulitplayer connections to
7902). Booleans are "on/off" or "true/false" variables, set with commands
such as Sanitized=TRUE (which removes drug references from random
events in the game).
String (text) values are set with commands such as BankName='the bank'
(which sets the name of the bank). Notice that string values must be
enclosed in quotes. Strings in double quotes understand escapes such as "\t";
strings in single quotes do not treat backslash characters specially, and
so should be used for Windows pathnames.
A string list is used for setting an array of strings; for example
SubwaySaying = { "Saying 1", "Saying 2", "Saying 3" } sets up three
"subway sayings". A string list consists of a list of strings, separated by
commas and wrapped with braces - { and } characters. Single strings in a
string list can be replaced individually - for example
SubwaySaying[3]="Third Saying" replaces the third string (which was
previously "Saying 3"). The number of strings in the list
"List" can be set with the variable NumList - for example,
NumSubwaySaying=4 dimensions the SubwaySaying list to contain
four strings.
Whitespace and line breaks are ignored in the configuration files; comments
can be used, and extend from a '#' character to the end of the current line,
or are enclosed by C-style /* and */ symbols. See the
example configuration file for a demonstration.
Valid configuration file settings are listed below. The examples given
generally reproduce the default behaviour; obviously you are free to replace
the parts in italics to customise your own server and client.
- Port=7902
- Tells the dopewars client to look for a server on port 7902, and
tells the dopewars server to bind to port 7902 and wait for connections.
This can be overridden with the -p
command line option.
- Server="localhost"
- Tells the dopewars client to look for a server at the address
localhost. Dotted quad (e.g. 127.0.0.1) addresses may also be used here.
If this variable is set to one of the three "special" names
(MetaServer), (Prompt), or (Single) (including the
brackets) then the client will not connect to a server but instead
list the servers available at the metaserver, prompt the user to enter a
server name and port, or play in single player mode, respectively.
This option can be overridden with the -o
command line option (but be sure to protect the brackets from the shell
if you use one of the "special" names). Note that this only changes
the name of the server that the client connects to - if you're running your
own server it does not change the address that it binds to. For that, see
the BindAddress variable.
- ServerMOTD="Welcome to my dopewars server"
- When running a server, any client that connects displays the welcome
"message of the day" "Welcome to my dopewars server". This can
be used, for example, to inform users of any special features that the
server has.
- BindAddress="localhost"
- Forces your dopewars server (if you run one) to accept network connections
only on the localhost network interface. (This can be a host name,
or an IP address.) If this is left blank (the default) then the server will
accept connections coming in on any valid network interface.
- Socks.Active=FALSE
- Instructs the dopewars client to connect directly to the given server,
without using an intermediate SOCKS server. If this is set to TRUE, all
connections go via the SOCKS server. By default, SOCKS is not used for
metaserver communications - see the MetaServer.UseSocks variable. N.B. You
cannot run a dopewars server behind a SOCKS server, due to limitations in
the SOCKS protocol.
- Socks.NumUID=FALSE
- When connecting to a SOCKS version 4 server, the protocol demands that
the name of the current user be sent for simple authentication; the SOCKS
server then queries identd on your machine to check if you are who you say
you are. dopewars complies with this requirement if this variable is set to
FALSE. However, some Unix implementations of identd send numeric user IDs
rather than user names; dopewars will do the same if you set this variable
to TRUE. (N.B. Not supported on Windows systems.)
- Socks.User="fred"
- Overrides the username detection (discussed above) completely, and instead
sends the user name "fred" to a SOCKS4 server. If this is set to the
blank string ("") - the default - this does not happen.
- Socks.Name="socks"
- If using SOCKS, sets the hostname of the SOCKS server to connect to to
be "socks".
- Socks.Port=1080
- Connects to the SOCKS server on TCP port 1080.
- Socks.Version=4
- Uses SOCKS version 4. Version 5 is also supported; SOCKS5 servers
support username/password authentication, unlike SOCKS4.
- Socks.Auth.User=""
- If using SOCKS5 with user/password authentication, with the server or AI
player (which can both run unattended) then setting this variable to something
other than "" will enable them to authenticate themselves with the SOCKS
server, provided Socks.Auth.Password is also set. (The game clients prompt
the user for a username and password on each connect instead.)
- Socks.Auth.Password=""
- The corresponding password for Socks.Auth.User, above.
- HiScoreFile="/var/lib/dopewars.sco"
- Tells the dopewars server (or the client, if running in single-player
mode, not connected to a server) to use the file /var/lib/dopewars.sco
to store high scores. This can be overridden with the -f
command line option.
(N.B. This option cannot be used to get dopewars to open a high
score file with privilege when running setuid/setgid; all privileges are
dropped by this point for security.)
- MinToSysTray=TRUE
- Rather than behaving as a normal window, the dopewars server window adds
an icon to the Windows System Tray, and, when the window is minimized, it
vanishes completely. Clicking on the System Tray icon will restore the
window to its normal state. If FALSE, the System Tray is not used. Only
supported on Windows systems.
- Daemonize=TRUE
- When the Unix server is successfully started, it immediately uses the
fork() function to become a daemon, running in the background. Since this
can cause problems with debugging, or with other programs that need to keep
track of the process, setting Daemonize to FALSE will run the program in the
foreground. Only supported on Unix systems.
- WebBrowser=/usr/bin/firefox
- Sets the program used to display website URLs. This is used only by the
Unix version, as under Windows the standard mechanism for associating file
types with applications is used, and on MacOS the system-configured default
web browser is used.
- ConfigVerbose=FALSE
- Prints extra feedback information when processing the config. file if set
to TRUE; this only takes effect, of course, after the ConfigVerbose variable is
set, and then remains in force until it is reset again.
- MetaServer.Active=TRUE
- Tells the dopewars server to report its status to the
metaserver. If TRUE
is replaced by FALSE the server will not report to the metaserver.
This setting, if set to TRUE, can be overridden by the -S
command line option.
- MetaServer.URL="https://dopewars.sourceforge.io/metaserver.php"
- Tells dopewars that the metaserver PHP script is located at
https://dopewars.sourceforge.io/metaserver.php. This is used for server
registration (server mode) or listing the available servers (client mode);
see the metaserver page. If a proxy is needed to
connect to the web server, set the
https_proxy environment variable.
- Sets the comment for your server, which appears on the list of servers
maintained by the metaserver, to dopewars server.
- MetaServer.LocalName="dope-serv.com"
- Tells the metaserver that the preferred hostname of your dopewars server
machine is dope-serv.com. By default, the metaserver tries to ascertain
your domain name from the connection, and this can fail if you connect via
a proxy server, or if DNS does not properly translate your IP address to your
domain name. You must also set MetaServer.Password to the password given to
you by the metaserver
maintainer for this to work. A blank LocalName can also be used with a
suitable password to identify "your" server, even if its IP changes.
See the metaserver page for more details.
- MetaServer.Password="auth"
- Uses the password auth to authenticate your dopewars server's
hostname (see MetaServer.LocalName above) with the metaserver.
- NumLocation=8
- Sets the number of locations in the game to 8. Note that if too
many locations are specified, the client may not be able to display them
all!
- Location[4].Name="Manhattan"
- Sets the name of the 4th location in the game to Manhattan.
The index within the square brackets can range from 1 to whatever
NumLocation is set to above, or an error will be reported.
- Location[4].PolicePresence=90
- Sets the police presence in the 4th location to 90%. This
affects how likely it is for the police to attack players at each location
when arriving, dropping drugs, or attacking other players.
- Location[4].MinDrug=4
- Sets the minimum possible number of different drugs that will be on sale
to players in location number 4 to 4.
- Location[4].MaxDrug=10
- Sets the maximum possible number of different drugs that will be on sale
to players in location number 4 to 10.
- LoanShark=1
- Makes the loan shark pop up when players visit location number 1.
To stop the loan shark from appearing at all (making it rather difficult to
pay off debts) set this number to something which is not a valid location,
such as 0 (zero).
- Bank=1
- Makes the bank appear when a player visits location 1 (the
Bronx).
- GunShop=2
- Players can visit the gun shop in location number 2 (the
Ghetto).
- RoughPub=2
- Players can visit the rough pub to hire bitches in location number
2.
- LoanSharkName="the Loan Shark"
- The loan shark is known by the name "the Loan Shark" during the
game.
- BankName="the bank"
- The bank is known by the name "the bank" during the game.
- GunShopName="Dan's House of Guns"
- The gun shop is known by the name "Dan's House of Guns" during
the game.
- RoughPubName="the pub"
- The pub is known by the name "the pub" during the game.
- NumDrug=12
- Sets there to be 12 different types of drug in the game.
- Drug[6].Name="MDA"
- Sets the name of the 6th drug to be MDA.
- Drug[6].MinPrice=1500
- Sets the usual minimum price of the 6th drug (in the absence of
"special events" such as drug busts) to be $1,500.
- Drug[6].MaxPrice=4400
- Sets the usual maximum price of drug number 6 to be
$4,400.
- Drug[1].Cheap=TRUE
- Tells dopewars that drug 1 (by default, Acid) can occasionally
be especially cheap (if this is set to FALSE, this does not happen).
- Drug[1].CheapStr="The market is flooded with cheap
home-made acid!"
- Sets the message to display to alert players that drug number 1
is especially cheap.
- Drugs.CheapDivide=4
- Tells dopewars that whenever a drug is "specially" cheap, divide the
normal price distribution (between Drug[x].MinPrice and Drug[x].MaxPrice) by
4.
- Drug[4].Expensive=TRUE
- Tells dopewars that drug 4 (normally Heroin) can occasionally be
particuarly expensive (FALSE cancels this).
- Drugs.ExpensiveStr1="Cops made a big %tde bust! Prices are
outrageous!"
- Sets the string that is displayed when any drug is particularly
expensive. This is similar to a standard C-style format string - i.e. the
%tde is replaced by the name of the drug which is expensive. (See the
Internationalization page for further information
on this notation.) This string is displayed 50% of the time for expensive
drugs.
- Drugs.ExpensiveStr2="Addicts are buying %tde at ridiculous
prices!"
- Sets the string which is used for expensive drugs the other 50% of the
time.
- Drugs.ExpensiveMultiply=4
- Tells dopewars that whenever a drug is "specially" expensive, multiply the
normal price distribution (between Drug[x].MinPrice and Drug[x].MaxPrice) by
4.
- NumGun=4
- Configures the game to have 4 guns available to players at the
gun shop. (If you set this to zero, you will be unable to buy guns, you
will never be attacked by the cops, and you will be unable to shoot at other
players.)
- Gun[3].Name="Ruger"
- Sets the name of the 3rd gun to Ruger.
- Gun[3].Price=2900
- Sets the price in the gun shop of the 3rd gun to $2,900.
Guns offered "on the street" (i.e. by random events) will be priced at 10%
of the value set here.
- Gun[3].Space=4
- Tells dopewars that gun number 3 uses 4 spaces in the
inventory - i.e. carrying one of these guns uses the same spaces as 4
drugs.
- Gun[3].Damage=4
- Defines gun number 3 to do up to 4 points of damage.
- PlayerArmor=100 or PlayerArmour=100
- Sets the percentage armor rating of each player to 100 - this
defines the amount of health that you lose when you are successfully hit.
If 100, you lose the same number of health points as the gun's damage.
If more than 100, you lose fewer health points, and if less than 100, you lose
more health points than the gun's damage. This rating applies only
when you have no bitches.
- BitchArmor=50 or BitchArmour=50
- Sets the percentage armor rating of each bitch to 50.
- NumCop=3
- Configures the game to have 3 cops. If you kill the first one, you
will later be attacked by the second one, and so on. (The last cop is 'undead'
and will return even if you kill him.) If you set this to zero, then you
will never be attacked by the cops.
- Cop[1].Name=Officer Hardass
- Names the first cop to attack you "Officer Hardass".
- Cop[1].DeputyName=deputy
- Names a solitary deputy accompanying the first cop "deputy".
- Cop[1].DeputiesName=deputies
- Names more than one deputy accompanying the first cop
"deputies".
- Cop[1].Armor=4 or Cop[1].Armour=4
- Sets the armor rating of the first cop to 4%.
- Cop[1].DeputyArmor=3 or Cop[1].DeputyArmour=3
- Sets the armor rating of the first cop's deputies to 3%.
- Cop[1].AttackPenalty=30
- When attacking another player, whether you successfully hit them depends
on whether your attack rating is greater than their defence rating, which are
generally numbers between 0 and 100 (think of them as percentages). This
penalises the first cop (and his deputies) by 30% when attacking
you.
- Cop[1].DefendPenalty=30
- Penalises the first cop (and his deputies) by 30% when defending
against a player.
- Cop[1].MinDeputies=2
- The first cop will be accompanied by a minimum of 2 deputies.
- Cop[1].MaxDeputies=8
- The first cop will be accompanied by a maximum of 8 deputies.
- Cop[1].GunIndex=0
- The first cop, and his deputies, will carry gun number 0
(zero-based).
- Cop[1].CopGun=1
- The first cop will carry 1 gun.
- Cop[1].DeputyGun=1
- The first cop's deputies will each carry 1 gun.
- DebtInterest=10
- Increases your debt to the loan shark by 10% every turn. Negative
numbers can also be used here, to have the debt shrink every day.
- BankInterest=5
- Adds interest at a rate of 5% per turn to your bank balance.
- Currrency.Symbol=$
- Uses the dollar ($) symbol to display all prices of drugs, guns,
etc.
- Currrency.Prefix=TRUE
- Prints Currency.Symbol in front of any price - e.g. "$1,000"; if
FALSE, prints it after the price - e.g. "1,000 $".
- Log.File=dopewars.log
- By default, server log messages are printed to the screen (standard
output). By setting this variable, they will instead be written to the file
dopewars.log.
- Log.Level=2
- Most server log messages are given a priority level, from 0 (most urgent)
to 5 (most verbose). This setting instructs the server only to log messages
from level 0 up to 2, inclusive.
- Log.Timestamp="[%H:%M:%S] "
- Prefixes all log messages with a timestamp of the form (e.g.)
[16:34:49]. This is a string which is passed as input to the
strftime(3) function. If this is set to a blank string, then no
timestamp is added to log messages.
- NumTurns=31
- Defines the game to end after 31 "days" or turns. If this is set
to 0 (zero) the game never ends for a player, unless they quit or are
killed.
- Sanitized=FALSE
- If set to TRUE, this "sanitizes" the game by removing all drug references
from the random events. To completely remove drug references, of course, you
must also alter the drug names above.
- DrugSortMethod=1
- Tells the dopewars client how to sort the names of available drugs at
each location for display. The default, 1, sorts them in alphabetical
order by their names. The choices are as follows:-
- 1. Sort in forward alphabetical order by name
- 2. Sort in reverse alphabetical order by name
- 3. Sort in order of current price, cheapest first
- 4. Sort in order of current price, most expensive first
- FightTimeout=5
- If a player in a firefight with another player fails to fire back
within 5 seconds, lets his/her enemy have another shot. If this
is set to 0 (zero) timeouts are disabled, and players may take as long
as they like to fire back.
- IdleTimeout=14400
- If a connected player in a game does nothing to interact with the
server for 14400 seconds, he/she will be automatically disconnected.
- ConnectTimeout=300
- If a player takes more than 300 seconds to complete the process
of connecting or disconnecting to the server, the server will sever the
connection.
- MaxClients=20
- Prevents more than 20 clients from connecting to the server at
any one time.
- AITurnPause=5
- Makes computer-controlled client players run from this machine (not
necessarily AI players that connect to a server run on this machine) wait
5 seconds between moving from location to location - i.e. a turn
takes at least 5 seconds.
- StartCash=2000
- Each player will start the game with $2,000 in cash.
- StartDebt=5000
- Each player will start the game with a debt to the loan shark of
$5,000.
- Names.Bitch="bitch"
- Sets the word used to describe a single "bitch" in the game. Bitch, gun
and drug names are automatically capitalised where necessary by the dopewars
code.
- Names.Bitches="bitches"
- Sets the word used to describe two or more "bitches".
- Names.Gun="gun"
- Sets the word used to describe a single "gun" (for example, it could be
replaced by "knife").
- Names.Guns="guns"
- Sets the word used to describe two or more "guns".
- Names.Drug="drug"
- Sets the word used to describe a single "drug" (for example, it could be
replaced by "candy bar" or something similarly innocuous).
- Names.Drugs="drugs"
- Sets the word used to describe two or more "drugs".
- Names.Date="%m-%d-%Y"
- Sets the format string (which is passed to the strftime() function) for
displaying the current game date. This example (the default) displays the
date in MM-DD-YYYY format, as is commonplace in the US. Only date (not time)
formats can be used, and the special format %T is used to display the
current game turn.
- StartDate.Day="1"
- Sets the day of the month on which the game starts to 1.
- StartDate.Month="12"
- Sets the month in which the game starts to 12 (i.e. December).
- StartDate.Year="1984"
- Sets the year in which the game starts to 1984.
- Prices.Spy=20000
- Sets the price to pay a bitch to spy on another player to be
$20,000.
- Prices.Tipoff=10000
- Sets the price to pay a bitch to tip off the cops to another player to be
$10,000.
- Bitch.MinPrice=50000
- Sets the minimum price for a bitch at the Rough Pub to be $50,000.
Note that prices for bitches "on the street" (i.e. those that are offered
by random events) are produced by dividing the normal bitch price
distribution by 10.
- Bitch.MaxPrice=150000
- Sets the maximum price for a bitch to $150,000.
- SubwaySaying= { "First saying", "Second saying",
"Third saying" }
- Sets the list of things which the lady you sometimes meet on the subway
says to you; one of "First saying", "Second saying" and
"Third saying" will be displayed each time. Any previous sayings will
be erased. Note that individual sayings can be overwritten by appending an
array suffix to the variable name - for example, to replace
"Third saying" with "3rd saying" the following command would
suffice:-
SubwaySaying[3]="3rd saying"
- NumSubwaySaying=5
- Sets there to be 5 distinct things that the lady on the subway
says to you. If this number is greater than the old number of sayings, the
newly added sayings will be blank; if it is smaller, the sayings that are now
beyond the end of the list will be deleted. If set to zero, the lady will
be mercifully silent.
- Playing= { "Song 1", "Song 2", "Song 3" }
- Sets the list of things which you can sometimes hear playing while
jetting; one of "Song 1", "Song 2" or "Song 3" will be
displayed. See the help for SubwaySaying for more details.
- NumPlaying=4
- Sets there to be 4 distinct things which you can sometimes hear
playing. (Set this to zero to disable this feature.)
- StoppedTo= { "have a beer", "smoke a joint", "smoke a cigar",
"smoke a Djarum", "smoke a cigarette" }
- Sets the list of things which you sometimes stop to do while jetting;
see SubwaySaying for more details. (Set this to zero to disable this
feature.)
- NumStoppedTo=5
- Sets there to be 5 distinct things which you can stop to do.
- DrugValue=TRUE
- If TRUE, then the server will keep track of the price you paid for
any drugs, and clients will display this information if available.
- Sounds.FightHit="hit.wav"
- Plays the sound file "hit.wav" when you fire a gun and hit your
target. The sound must be installed on your system, and you must be using
a functioning sound system, in order to hear anything. Other sounds that
can be configured in the same way are: FightMiss, FightReload,
Jet, TalkToAll, TalkPrivate, JoinGame, and
LeaveGame.
- include "foo"
- Reads in the additional configuration file, "foo".
- encoding "UTF-8"
- Specifies that any text following this directive (in this configuration
file only) is in "UTF-8" encoding. This directive is only supported
if dopewars is built on a Unix system and linked against GLib version 2.
If unspecifed, then it will be assumed that your configuration files are
in the locale's default encoding - e.g. ISO-8859-1 for C or POSIX locales,
ISO-8859-2 for pl_PL, ISO-8859-15 for es_ES@euro, or UTF-8 for en_GB.UTF-8.
Last update: 11-08-2002
Valid XHTML 1.1