Skip to content

Commit e3b2795

Browse files
committed
Update server scripts
1 parent fee4fae commit e3b2795

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+5323
-4178
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
CT_CONFIG_VERSION="3"
2+
CT_EXPERIMENTAL=y
3+
CT_ALLOW_BUILD_AS_ROOT=y
4+
CT_ALLOW_BUILD_AS_ROOT_SURE=y
5+
# CT_SAVE_TARBALLS is not set
6+
CT_PREFIX_DIR="${CT_PREFIX:-/opt/x-tools}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"
7+
# CT_LOG_TO_FILE is not set
8+
CT_ARCH_X86=y
9+
CT_ARCH_32=y
10+
CT_KERNEL_LINUX=y
11+
CT_LINUX_V_2_6_32=y
12+
CT_BINUTILS_LINKER_LD_GOLD=y
13+
CT_BINUTILS_GOLD_THREADS=y
14+
CT_BINUTILS_LD_WRAPPER=y
15+
CT_BINUTILS_PLUGINS=y
16+
CT_CC_LANG_CXX=y
17+
CT_LIBC_GLIBC=y
18+
# CT_LOG_PROGRESS_BAR is not set
19+
CT_GLIBC_V_2_17=y
20+
# CT_COMP_TOOLS_AUTOCONF is not set
21+
# CT_COMP_TOOLS_AUTOMAKE is not set
22+
CT_CC_GCC_BUILD_ID=y
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
CT_CONFIG_VERSION="3"
2+
CT_EXPERIMENTAL=y
3+
CT_ALLOW_BUILD_AS_ROOT=y
4+
CT_ALLOW_BUILD_AS_ROOT_SURE=y
5+
# CT_SAVE_TARBALLS is not set
6+
CT_PREFIX_DIR="${CT_PREFIX:-/opt/x-tools}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"
7+
# CT_LOG_TO_FILE is not set
8+
CT_ARCH_X86=y
9+
CT_ARCH_64=y
10+
CT_KERNEL_LINUX=y
11+
CT_LINUX_V_2_6_32=y
12+
CT_BINUTILS_LINKER_LD_GOLD=y
13+
CT_BINUTILS_GOLD_THREADS=y
14+
CT_BINUTILS_LD_WRAPPER=y
15+
CT_BINUTILS_PLUGINS=y
16+
CT_CC_LANG_CXX=y
17+
CT_LIBC_GLIBC=y
18+
# CT_LOG_PROGRESS_BAR is not set
19+
CT_GLIBC_V_2_17=y
20+
# CT_COMP_TOOLS_AUTOCONF is not set
21+
# CT_COMP_TOOLS_AUTOMAKE is not set
22+
CT_CC_GCC_BUILD_ID=y

โ€Žservers/block.cfgโ€Ž

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ conn_timeout_protection 0
44

55
sv_swap 0
66

7+
auth_add_p Umbra mod 37cdcb65eaeec74cfa4e683b687e4b76 2b5bc6cea41e69fa # deen 2020-10-06
8+
79
sv_reset_file ""
810
sv_find_free_port 0
9-
sv_vanilla_antispoof 0
11+
sv_vanilla_antispoof 1
1012
sv_gametype "DDRace"
1113
sv_kill_protection 0
1214

13-
sv_dnsbl_host blocklist
15+
sv_dnsbl_host SECRET_DNSBL
1416
sv_dnsbl 1
1517
sv_dnsbl_ban 1
1618
sv_dnsbl_vote 1

โ€Žservers/common.cfgโ€Ž

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
sv_sqlite_file "ddnet-server-test.sqlite"
22

3+
sv_swap 1
34
sv_practice 1
45
sv_vanilla_antispoof 1
56
sv_gametype "DDRace"
67
sv_ipv4only 1
7-
sv_emoticon_delay 0
8+
sv_emoticon_ms_delay 20
89

910
#sv_rcon_password numpq010
1011
#sv_rcon_mod_password rand123X
1112
#sv_rcon_helper_password foliba999
1213
sv_rcon_password ""
13-
sv_rcon_mod_password ""
14-
sv_rcon_helper_password ""
14+
#sv_rcon_mod_password ""
15+
#sv_rcon_helper_password ""
1516

1617
sv_server_info_per_second 50
1718
sv_map_vote 1
@@ -23,12 +24,14 @@ exec ddrace_local_auths.cfg
2324
# load namebans
2425
exec ddrace_namebans.cfg
2526

26-
sv_dnsbl_host blocklist
27+
#sv_dnsbl_host blocklist
28+
sv_dnsbl_host SECRETDNSBL
29+
sv_dnsbl_key SECRETKEY
2730
sv_dnsbl 1
28-
sv_dnsbl_ban 1
29-
sv_dnsbl_vote 1
31+
sv_dnsbl_ban 0
32+
sv_dnsbl_vote 0
3033

31-
sv_register 1,ipv4
34+
sv_register ipv4
3235
sv_max_clients 64
3336
sv_max_clients_per_ip 4
3437
sv_spectator_slots 0
@@ -63,9 +66,6 @@ sv_vote_kick_min 5
6366

6467
sv_spectator_votes 0
6568

66-
sv_banned_versions "16,502,602,605,708,1003,10072,11017,11072,12073" # baumalein, fclient, zclient, zclient, baumalein, original ath, ath, replay, ath, sash
67-
# Consider removing 903 for DDNet Android support
68-
6969
#sv_deepfly 0
7070

7171
access_level logout 2
@@ -92,6 +92,9 @@ access_level unmute 1
9292
access_level unmuteid 1
9393
#access_level muteip 1
9494
access_level mutes 1
95+
access_level sv_dnsbl_ban 1
96+
access_level sv_dnsbl_vote 1
97+
access_level dump_log 1
9598

9699
sv_ddrace_rules "0"
97100
sv_rules_line1 "Rules:"
@@ -107,7 +110,7 @@ sv_rules_line9 "Breaking these rules will result in a penalty."
107110
sv_tee_historian 1
108111

109112
sv_reserved_slots 1
110-
sv_reserved_slots_pass SECRETSLOT
113+
#sv_reserved_slots_pass cake
111114

112115
sv_saveswapgames_delay 30
113116
sv_saveswapgames_penalty 30

โ€Žservers/reset.cfgโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
sv_welcome "Welcome to DDraceNetwork!"
2-
#sv_motd "DDraceNetwork - https://ddnet.tw\nDownload DDNet client for 64 players!"
2+
sv_motd "DDraceNetwork - https://ddnet.tw\nDownload DDNet client for 64 players!"
33

44
sv_savegames 1
55
sv_min_team_size 2

โ€Žservers/runasan.shโ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
while true; do
3+
mv servers/$1.log servers/$1.log.old
4+
ASAN_OPTIONS=log_path=./ASAN:print_stacktrace=1:check_initialization_order=1:detect_leaks=1:halt_on_errors=0 ni -15 2 ./DDNet-Server-asan -f servers/$1.cfg
5+
sleep 1
6+
done

โ€Žservers/runubsan.shโ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
while true; do
3+
mv servers/$1.log servers/$1.log.old
4+
UBSAN_OPTIONS=log_path=./UBSAN:print_stacktrace=1 ni -15 2 ./DDNet-Server-ubsan -f servers/$1.cfg
5+
sleep 1
6+
done

โ€Žservers/scripts/ddnet.pyโ€Ž

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
webDir = "/var/www"
4040
htmlRanksPath = "/home/teeworlds/servers/scripts/discord-ranks.html"
41-
countries = ["NLD", "FRA", "GER", "POL", "RUS", "TUR", "IRN", "CHL", "BRA", "ARG", "MEX", "USA", "CAN", "CHN", "KOR", "JAP", "SGP", "ZAF", "IND", "AUS", "OLD"]
41+
countries = ["NLD", "FRA", "GER", "POL", "RUS", "TUR", "IRN", "SAU", "CHL", "BRA", "ARG", "MEX", "PER", "USA", "CAN", "CHN", "KOR", "TWN", "SGP", "ZAF", "IND", "AUS", "OLD"]
4242

4343
pointsDict = {
4444
'Novice': (1, 0),
@@ -157,9 +157,9 @@ def textJoinNames(names):
157157
return result
158158

159159
def joinNames(names):
160-
result = ', '.join(names[:-1])
160+
result = '‭, '.join(names[:-1])
161161
if names[-1]:
162-
result += ' & ' + names[-1]
162+
result += '‭ & ' + names[-1]
163163
return result
164164

165165
def renderStars(points):
@@ -503,7 +503,7 @@ def serverStatus(title):
503503
<a href="/stats/server/">Statistics</a>, <a href="https://github.com/BotoX/ServerStatus">ServerStatus</a>
504504
</h3>
505505
</div>
506-
<script src="js/jquery-1.10.2.min.js"></script>
506+
<script src="/jquery.js"></script>
507507
<script src="js/bootstrap.min.js"></script>
508508
<script src="js/serverstatus.js?version=3"></script>
509509
""" % title
@@ -825,7 +825,7 @@ def getRecords(cursor, startTime, endTime):
825825
cursor.execute("""
826826
select Name, lll.Map, Time, min(lll.Timestamp), min(Type), Server, max(OldTime), Points, Country from
827827
(
828-
select Name, Map, Time, Timestamp, "2 Top 1 rank" as Type, (select Time from record_race where Map = l.map and Timestamp < "{0}" order by Time limit 1) as OldTime, Country from (select Timestamp, Name, Map, Time, Server as Country from record_race where Timestamp >= "{0}" and Timestamp < "{1}") as l where Time <= (select min(Time) from record_race where Map = l.Map)
828+
select Name, Map, Time, Timestamp, "2 Top 1 rank" as Type, (select Time from record_race where Map = l.map and Timestamp < "{0}" order by Time limit 1) as OldTime, Country from (select Timestamp, Name, Map, Time, Server as Country from record_race where Timestamp >= "{0}" and Timestamp < "{1}") as l where Time <= (select min(Time) from record_race where Map = l.Map) and (Time < (select min(Time) from record_race where Map = l.Map and Timestamp < "{0}") or Name != l.Name)
829829
union all
830830
select record_teamrace.Name, record_teamrace.Map, record_teamrace.Time, record_teamrace.Timestamp, "1 Top 1 team rank" as Type, OldTime, record_race.Server as Country from (select ID, (select Time from record_teamrace where Map = l.Map and ID != l.ID and Timestamp < "{0}" order by Time limit 1) as OldTime from (select distinct ID, Map, Time from record_teamrace where Timestamp >= "{0}" and Timestamp < "{1}") as l left join (select Map, min(Time) as minTime from record_teamrace group by Map) as r on l.Map = r.Map where Time = minTime) as ll inner join record_teamrace on ll.ID = record_teamrace.ID join record_race on record_teamrace.Map = record_race.Map and record_teamrace.Name = record_race.Name and record_teamrace.Time = record_race.Time and record_teamrace.Timestamp = record_race.Timestamp
831831
union all

โ€Žservers/scripts/discord-ranks.pyโ€Ž

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,18 @@
2525
'COL': '๐Ÿ‡จ๐Ÿ‡ด',
2626
'CRI': '๐Ÿ‡จ๐Ÿ‡ท',
2727
'MEX': '๐Ÿ‡ฒ๐Ÿ‡ฝ',
28+
'PER': '๐Ÿ‡ต๐Ÿ‡ช',
2829
'USA': '๐Ÿ‡บ๐Ÿ‡ธ',
2930
'CAN': '๐Ÿ‡จ๐Ÿ‡ฆ',
3031
'CHN': '๐Ÿ‡จ๐Ÿ‡ณ',
3132
'KOR': '๐Ÿ‡ฐ๐Ÿ‡ท',
3233
'JAP': '๐Ÿ‡ฏ๐Ÿ‡ต',
34+
'TWN': '๐Ÿ‡น๐Ÿ‡ผ',
3335
'SGP': '๐Ÿ‡ธ๐Ÿ‡ฌ',
3436
'ZAF': '๐Ÿ‡ฟ๐Ÿ‡ฆ',
3537
'AUS': '๐Ÿ‡ฆ๐Ÿ‡บ',
3638
'IND': '๐Ÿ‡ฎ๐Ÿ‡ณ',
39+
'SAU': '๐Ÿ‡ธ๐Ÿ‡ฆ',
3740
}
3841

3942
htmlRanksPathTmp = "%s.%d.tmp" % (htmlRanksPath, os.getpid())
@@ -79,9 +82,9 @@ def postRecord(row, namesDiscord, namesHtml, namesTitle):
7982

8083
with open("scripts/discord-ranks-last", 'r+') as f:
8184
startTime = parseDatetime(f.read().rstrip())
82-
# give mysql replication 1 minute to get the rank over to us, otherwise we
85+
# give mysql replication 3 minutes to get the rank over to us, otherwise we
8386
# won't see it here
84-
endTime = datetime.datetime.now() - datetime.timedelta(minutes=1)
87+
endTime = datetime.datetime.now() - datetime.timedelta(minutes=3)
8588
f.seek(0)
8689
f.write(formatDateExact(endTime))
8790
f.truncate()

โ€Žservers/scripts/extract-master.pyโ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
for server in j['servers']:
2929
for player in server['info'].get('clients', []):
3030
# rstrip() because some servers allow trailing spaces, ddnet doesn't, and mysql considers strings the same if only trailing space differs
31+
if 'name' not in player or not isinstance(player['name'], unicode):
32+
continue
3133
name = player['name'].rstrip()
3234
if name not in playersNow:
3335
players[name] += 5

0 commit comments

Comments
ย (0)