1 ##########################################################################
3 # Copyright (c) 2003-2012 Aymargeddon Development Team
5 # This file is part of "Last days of Aymargeddon" - a massive multi player
6 # onine game of strategy
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU Affero General Public License as
10 # published by the Free Software Foundation, either version 3 of the
11 # License, or (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 # See the GNU Affero General Public License for more details.
19 # You should have received a copy of the GNU Affero General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 ###########################################################################
25 # TODO: seperate FROGS-config from Aymargeddon-config in different files
27 # TODO: add some kind of local configuration file (db-passwd etc...)
29 # change this file to configure your game
34 @::ISA = qw(Exporter);
35 @::EXPORT_OK = qw($conf);
39 -DB_SOURCE => 'mysql:RAGNAROEK',
40 -DB_USER => 'aymargeddon',
41 -DB_SECRETS => '/home/benni/aymargeddon/current/+secrets',
42 -COMMANDS => 'AymCommand.pm',
43 -GAME_NAME => 'Aymargeddon',
44 -DEFAULT_LANGUAGE => 'EN',
45 -LOG_TIME_IN_LOOP => 1000, # loops until next time output in log
49 -FULL_DEBUG_FILE => '/home/benni/aymargeddon/current/src/FROGS/+out',
50 -SCHEDULER_SLEEP => 2,
51 -DELETE_OLD_EVENTS => 1, # dont touch this, it will not work!
52 -DELETE_OLD_COMMANDS => 1, # dont touch this, it will not work!
53 -SEND_MESSAGE_TO_FIELD => 1, # set to 0 to stop slow messages
54 -MAX_ARGS => 4, # maximum arguments for localisation tags
55 # (hardcoded in database-structure)
58 # Aymargeddon stuff... you maybe dont need this for other games
63 -MAX_MOUNTAINS => 1, # mountains per god/earthling-combination
64 -MIN_DISTANCE_HOME => 3, # minimal distance between homecitys
65 -NEIGHBOUR_CITIES => 2, # number of citys in the neighbourhood of a home
66 -MIN_DISTANCE_MOUNTAIN => 2,
67 -WANTED_DISTANCE_MOUNTAIN => 3,
68 -MIN_DISTANCE_MOUNTAIN_FROM_WATER => 2,
71 -MANA_FOR_TEMPLE => 1,
72 -FORTUNE_FAKTOR_ISLAND => 1,
73 -FORTUNE_FAKTOR_MOUNTAIN => 2,
74 -MAX_UNBUILD_DESTROY => 1,
75 # -ARK_RETREAT_POSSIBILITY => 0.5, (in the moment hardcoded)
76 -WINNER_DEATH_COUNT_FRACTION => 5,
77 -LOOSER_DEATH_COUNT_FRACTION => 3,
78 -WINNER_AVATARS_DYING_FRACTION => 4,
79 -LOOSER_AVATARS_DYING_FRACTION => 2,
80 -DEATH_SHARE_ROW => [0.4, 0.3, 0.2, 0.1], # should sum to 1
81 -DEFAULT_DYING => 'KHP',
83 -PLAGUES => ['INFLUENZA','PESTILENTIA','TUBERCULOSIS'],
84 -PESTILENTIA_DEATH_SHARE => 0.5,
85 -SPREAD_PLAGUE => {'CITY' => 0.1,
92 # can gods give earthlings right to see?
93 -GODS_SHOW_EARTHLINGS => 0,
95 # which fields keep there owner without units?
96 -HOMECITY_KEEP_OWNER => 1,
97 -TEMPLE_KEEP_OWNER => 1,
98 -KEEP_OWNER => {'CITY' => 1},
100 # which fields fight without owner?
101 -FIGHTS_WITHOUT_OWNER => {'CITY' => 1},
103 # which fields fights without units?
104 #-HOMECITY_FIGHTS => 1,
105 #-FIGHTS_WITHOUT_UNIT => {'CITY' => 1},
113 # -MOVE_PROPHET => 6, # 12
115 -FIGHT_EARTHLING => 6,
116 -FIGHT_GOD => 10, #10
117 -BUILD_TEMPLE => 3, # 50
121 -PRODUCE_WARRIOR => 40, # 40
122 -PRODUCE_WARRIOR_HOME => 20, # 20
123 -PRODUCE_WARRIOR_CHANGE => 0,
124 -PRODUCE_PRIEST => 40, # 40
125 -PRODUCE_PRIEST_HOME => 40, # 40
126 -BUILD_ARK => 30, #30
136 -AVATAR => 4, # maximum
157 #-AVATAR => 4, # maximum
186 -NEUTRAL => '#b8a266',
190 # read password from secrets-file. password should not be included in source!
192 my $conf = $::conf->{-DB_SECRETS};
194 # substitute "~" (UNIX only!) from Perl Cookbook 7.3 not really useful
195 # here, because HOME is different in webserver and in user context
196 $conf =~ s{ ^ ~ ( [^/]* ) }{ $1 ? (getpwnam($1))[7] : ($ENV{HOME}||$ENV{LOGDIR}||
197 (getpwuid($<))[7])}ex;
199 open(CONFIG,$conf) or die "could not open config file $conf: $!\n";
205 $::conf->{-DB_PASSWD} = $_;
208 close CONFIG or die "could not close config file $conf: $!\n";