Skip to content

Commit e226c4a

Browse files
author
leak
committed
- Added Perl based conf merger script
- Removed LogSQL config option until reimplementation on code side - A bit of cosmetics for .conf files --HG-- branch : trunk
1 parent 59c1a23 commit e226c4a

File tree

4 files changed

+62
-21
lines changed

4 files changed

+62
-21
lines changed

contrib/conf_merge/README

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
This is a PHP script for merging a new .dist file with your existing .conf file (trinitycore and trinityrealm)
1+
==== PHP merger (index.php + merge.php) ====
2+
3+
This is a PHP script for merging a new .dist file with your existing .conf file (worldserver.conf.dist and authserver.conf.dist)
24
It should also work with mangos dist/conf files as well.
35

46
It uses sessions so it is multi user safe, it adds any options that are removed to the bottom of the file,
57
commented out, just in case it removes something it shouldn't,
68
and, if you add all of your custom patch configs below "# Custom" they will be copied exactly as they are.
9+
10+
==== Perl merger (tc-conf-merger.pl) ====
11+
12+
Perl based command line merger script. This script feeds a .conf.dist file with variables that exist in an old .conf file,
13+
comments and custom options are ignored.

contrib/conf_merge/tc-conf-merger.pl

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/perl -w
2+
3+
# Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
4+
# Author: leak
5+
# Date: 2010-12-06
6+
# Note: Based on conf file format of rev 10507
7+
8+
use strict;
9+
10+
if (@ARGV != 3)
11+
{
12+
print("Usage:\ntc-conf-merger.pl <path to new .conf.dist> <path to old .conf> <path to output .conf>\n");
13+
exit(1);
14+
}
15+
16+
if (! -e $ARGV[0])
17+
{
18+
print("No file found at: ".$ARGV[0]);
19+
exit(1);
20+
}
21+
elsif (! -e $ARGV[1])
22+
{
23+
print("No file found at: ".$ARGV[1]);
24+
exit(1);
25+
}
26+
27+
open CONFDIST, "<", $ARGV[0] or die "Error: Could not open ".$ARGV[0]."\n";
28+
my $confdist = join "", <CONFDIST>;
29+
close CONFDIST;
30+
31+
open CONFOLD, "<", $ARGV[1] or die "Error: Could not open ".$ARGV[1]."\n";
32+
my $confold = join "", <CONFOLD>;
33+
close CONFOLD;
34+
35+
while ($confold =~ m/^(?!#)(.*?)\s+?=\s+?(.*?)$/mg) {
36+
my $key = $1, my $value = $2;
37+
$confdist =~ s/^(\Q$key\E)(\s+?=\s+?)(.*)/$1$2$value/mg;
38+
}
39+
40+
open OUTPUT, ">", $ARGV[2] or die "Error: Could not open ".$ARGV[2]."\n";
41+
binmode(OUTPUT);
42+
print OUTPUT $confdist;
43+
close OUTPUT;

src/server/authserver/authserver.conf.dist

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ LogsDir = ""
4141
#
4242
# MaxPingTime
4343
# Description: Time (in minutes) between database pings.
44-
# Default: 30 - (minutes)
44+
# Default: 30
4545

4646
MaxPingTime = 30
4747

@@ -225,16 +225,16 @@ LoginDatabaseInfo = "127.0.0.1;3306;trinity;trinity;auth"
225225
# LoginDatabase.WorkerThreads
226226
# Description: The amount of worker threads spawned to handle asynchronous (delayed) MySQL
227227
# statements.
228-
# Default: 1 - (LoginDatabase.WorkerThreads)
228+
# Default: 1
229229

230-
LoginDatabase.WorkerThreads = 1
230+
LoginDatabase.WorkerThreads = 1
231231

232232
#
233233
# LoginDatabase.Connections
234234
# Description: The amount of MySQL connections spawned.
235-
# Default: 1
235+
# Default: 1
236236

237-
LoginDatabase.Connections = 1
237+
LoginDatabase.Connections = 1
238238

239239
#
240240
###################################################################################################

src/server/worldserver/worldserver.conf.dist

+6-15
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ CharacterDatabase.Connections = 2
119119
#
120120
# MaxPingTime
121121
# Description: Time (in minutes) between database pings.
122-
# Default: 30 - (minutes)
122+
# Default: 30
123123

124124
MaxPingTime = 30
125125

@@ -389,16 +389,6 @@ CleanCharacterDB = 0
389389

390390
###################################################################################################
391391
# SERVER LOGGING
392-
#
393-
# LogSQL
394-
# Description: Enable logging of SQL queries triggered by in game commands from in game
395-
# All commands are written to a file: YYYY-MM-DD_logSQL.sql
396-
# A new file will be created every day at 00:00:00.
397-
# Default: 1 - (Enabled)
398-
# 0 - (Disabled)
399-
400-
LogSQL = 1
401-
402392
#
403393
# PidFile
404394
# Description: World daemon PID file
@@ -1370,7 +1360,7 @@ DungeonFinder.Enable = 0
13701360

13711361
#
13721362
# DBC.EnforceItemAttributes
1373-
# Description: Disallow overriding item attributes stored in DBC files with values from the
1363+
# Description: Disallow overriding item attributes stored in DBC files with values from the
13741364
# database.
13751365
# Default: 1 - (Enabled, Enforce DBC values)
13761366
# 0 - (Disabled, Use database values)
@@ -1640,6 +1630,7 @@ ListenRange.TextEmote = 40
16401630
# Default: 300
16411631

16421632
ListenRange.Yell = 300
1633+
16431634
#
16441635
###################################################################################################
16451636

@@ -1747,7 +1738,7 @@ AllowPlayerCommands = 1
17471738
#
17481739
# PreserveCustomChannels
17491740
# Description: Store custom chat channel settings like password, automatic ownership handout
1750-
# or ban list in the database. Needs to be enabled to save custom
1741+
# or ban list in the database. Needs to be enabled to save custom
17511742
# world/trade/etc. channels that have automatic ownership handout disabled.
17521743
# (.channel set ownership $channel off)
17531744
# Default: 0 - (Disabled, Blizzlike, Channel settings are lost if last person left)
@@ -1926,7 +1917,7 @@ Visibility.Distance.BGArenas = 180
19261917

19271918
Visibility.Notify.Period.OnContinents = 1000
19281919
Visibility.Notify.Period.InInstances = 1000
1929-
Visibility.Notify.Period.InBGArenas = 1000
1920+
Visibility.Notify.Period.InBGArenas = 1000
19301921

19311922
#
19321923
###################################################################################################
@@ -2083,7 +2074,7 @@ Rate.Mining.Amount = 1
20832074
# Description: Mining rates.
20842075
# Default: Chance to to mine a deposit again.
20852076

2086-
Rate.Mining.Next = 1
2077+
Rate.Mining.Next = 1
20872078

20882079
#
20892080
# Rate.Talent

0 commit comments

Comments
 (0)