-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfig.pl
158 lines (135 loc) · 7.42 KB
/
config.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/usr/bin/perl
# Formerly a RallyPt File
$PerlLocation='/usr/bin/perl'; # Local Path
$disableGenerate = 0; # Disable TurnMake
$debug=0;
$WWW_HomePage = 'http://beta.starsautohost.org'; #Must match site URL
$WWW_Image = '/images/';
$WWW_Banner = 'StarsTotalHostBeta.jpg';
$WWW_Notes = '/Notes/';
$WWW_Scripts = '/scripts';
$Location_Index = $WWW_HomePage . $WWW_Scripts . '/index.pl';
# Logging
# The higher the value the more log values show
# 0 - Critical, log every time
# 100 - Warning, Core system functions.
# 200 - Info. DB Calls
# 300 - overly detailed
# 400 - who cares really
$logging = 400;
# Clean .m files before giving them to the player, removing non-player info (mines, MT, etc)
# Also requires a file named 'clean' in the individual game folder
$cleanFiles = 2; # 0, 1, 2: display, clean but don't write, write
# Fixing negates or warns for bug effects.
# Also requires a file named 'fix' in the individual game folder
$fixFiles = 2; # 0, 1, 2: display, clean but don't write, write
# Where the accounts logs go
$Dir_Log = '/home/beta/logs';
$File_Log = '/th.log';
$LogFile = $Dir_Log . $File_Log;
$File_ErrorLog = '/error.log';
$ErrorLog = $Dir_Log . $File_ErrorLog;
$File_SQLLog = '/sql.log';
$SQLLog = $Dir_Log . $File_SQLLog;
$ip = $ENV{'REMOTE_ADDR'};
$browser = $ENV{'HTTP_USER_AGENT'};
$max_login_attempts = 6;
$max_users = 120;
$min_password_length = 6;
$user_admin = 'rsteeves'; # This account will generally get host privs.
$max_inactivity = 14; # The longest a game can stay active, in days, with no turn submissions
$max_forcegen = 50; # The maximum number of turns that can be force generated.
# MYSQL/MariaDB
$DB_NAME = 'beta';
$DB_USER = 'betadb';
$DB_PASSWORD = 'IaMPhxbZFpyAHFrDufAI';
$DB_HOST = 'localhost';
$dsn = "DBI:mysql:database=$DB_NAME;host=$DB_HOST";
# WINE config
$ENV{'DISPLAY'} = ':99';
$ENV{'PERL5LIB'} = '/var/www/beta/scripts';
$PERL5LIB = "PERL5LIB=$ENV{'PERL5LIB'}";
$WINE_executable = '/usr/bin/wine c:\\stars.exe';
$apache_user = 'www-data'; # Linux user account
# Location of ImageMagic convert applications
$imagemagick = '/usr/bin/convert';
# Location of the starmapper executable (Java)
#$starmapper = 'e:\utils\starmapper\starmapper121\Starmapper.bat';
$starmapper = '/home/beta/utils/starmapper/starmapper121/Starmapper.sh';
$FormMethod = 'Post'; # Method used for forms, Post or Get
$Dir_Root = '/var/www/beta';
$Dir_User = '/home/beta';
$Dir_WINE = 'e:';
# You're going to want all of these to be lower case.
$Dir_Sessions = $Dir_User . '/sessions/'; # Note if you change this all the current passwords will invalidate.
$Dir_Upload = $Dir_User . '/upload';
$Dir_Games = $Dir_User . '/games'; # Location of the actual game files used for turn gen
$Dir_Download = $Dir_User . '/download'; #Location where zip files are downloaded
$Dir_Races = $Dir_User . '/races';
$File_Serials = $Dir_User . '/serials.txt'; # Text file of serial numbers
$Dir_Graphs = $Dir_Root . '/downloads'; #Location of movies & Graphs
$Dir_WWWRoot = $Dir_Root;
$Dir_Scripts = $Dir_Root . '/scripts';
$WINE_Races = '\\races'; # Location of the actual race files used in the .def file
$WINE_Games = '\\games'; # Location of the actual game files used in the .def file for game creation & turn gen
$File_Planets = $Dir_User . '/strings_planets.txt'; # Planet name file
# Email
# Currently expects an localhost open relay
$mail_present = 1;
$mail_server = 'localhost';
#$mail_user = '[email protected]';
#$mail_password = '';
$mail_from = '[email protected]';
$mail_prefix = '[TH Beta] ';
#Internet Detection
$internet_status_log = $Dir_Log . '/internet_status.log';
$internet_threshold = 5;
$internet_site = 'www.google.com'; # Google
$min_players = 1; # The minimum number of players to create/launch a game
$secret_key = 'secret_key_for_md5_hashing';
%TurnResult = ("turned in" => "In", "still out" => "Out", "right game" => "Wrong Game", "dead" => "Deceased", "right year" => "Wrong Year", "file corrupt" => "Corrupt");
%TurnBall = ("In" => "$WWW_Image" . "greenball.gif", "Out" => "$WWW_Image" . "yellowball.gif", "Wrong Game" => "$WWW_Image" . "redball.gif", "Deceased" => "$WWW_Image" . "blackball.gif", "Wrong Year" => "$WWW_Image" . "redball.gif", "Corrupt" => "$WWW_Image" . "redball.gif", "Error" => "$WWW_Image" . "redball.gif", "Idle" => "$WWW_Image" . "purpleball.gif", "Banned" => "$WWW_Image" . "grayball.gif", "AI" => "$WWW_Image" . "orangeball.gif");
%StatusBall = ("Finished" => "$WWW_Image" . "blackball.gif", "Awaiting Players" => "$WWW_Image" . "goldball.gif", "In Progress" => "$WWW_Image" . "greenball.gif", "Delayed" => "$WWW_Image" . "babyblueball.gif", "Active" => "$WWW_Image" . "greenball.gif", "Idle" => "$WWW_Image" . "grayball.gif", "Creation in Progress" => "$WWW_Image" . "animball.gif", "Pending Start" => "$WWW_Image" . "blueball.gif", "Paused" => "$WWW_Image" . "blueball.gif");
@WeekDays = qw(Sun. Mon. Tue. Wed. Thu. Fri. Sat.);
@GameStatus = ('Pending Start', 'Pending Closed', 'Active','Delayed','Paused','Need Replacement','Creation in Progress','Awaiting Players','','Finished');
@HourlyTime = qw(.167 .25 .5 1 2 3 4 6 8 12 24 36 42 48 56 72 84 96 120 144 168 240 336);
# Defaults for new games
$default_daily = '0101010'; # Defaults for new daily games
$default_hourly = '000000001111111111111100'; # defaults for new hourly games
$default_numdelay = 2;
$default_mindelay = 5;
# Starstat data
@dt_verbose = ('Universe Definition (.xy) File', 'Player Log (.x) File', 'Host (.hst) File', 'Player Turn (.m) File', 'Player History (.h) File', 'Race Definition (.r) File', 'Unknown (??) File');
@dt = qw(XY Log Host Turn Hist Race Max);
@fDone = ('Turn Saved','Turn Saved/Submitted');
@fMulti = ('Single Turn', 'Multiple Turns');
@fGameOver = ('Game In Progress', 'Game Over');
@fShareware = ('Registered','Shareware');
@fInUse = ('Host instance not using file','Host instance using file'); # No idea what this value is.
%Version = ('1.2a' => '1.1a', '2.65' => '2.0a', '2.81j' => '2.6i', '2.83.0' => '2.6jrc4');
# Permit displaying checkboxes or not depending on variable
@Checked = ('','CHECKED');
@Checked_Display = ('Disabled', 'Enabled');
@Selected = ('', 'SELECTED');
$lp_width=125;
$rp_width=200;
$height_help = 300;
$height_news = 500;
$width_news = 300;
# Add all the Host and game related buttons
$admin_style = qq|style="color:red;width:120px;height:24;"|;
$host_style = qq|style="color:green;width:120px;height:24;"|;
$user_style = qq|style="width:120px;height:24;"|;
(@singularRaceName, @pluralRaceName);
$singularRaceName[0] = 'Everyone';
$timezone = 'America/New_York';
@timezones = (
'UTC', 'America/New_York', 'America/Chicago', 'America/Denver',
'America/Los_Angeles', 'Europe/London', 'Europe/Paris', 'Asia/Tokyo',
'Australia/Sydney'
);
@GameSize = ('Tiny','Small','Medium','Large','Huge');
@GameDensity = ('Sparse','Normal','Dense','Packed');
@GamePositions = ('Close','Moderate','Farther','Distant');
@GameParameters = ('Beginner: Max Minerals', 'Slower Tech Advances','Single Player', 'Tutorial', 'Computer Players Form Alliances', 'Accelerated BBS Play','Public Player Scores','No Random Events','Galaxy Clumping','wGen','unused');
@GameVictory = ('Owns x of all planets','Attains Tech x','in x Tech Fields', 'Exceeds score of x','Exceeds second place score by x','Has production capacity of x thousand','Owns x capital ships','Has the highest score after x years','Must meet x criteria', 'At least x years');